in_progress port from cpp

This commit is contained in:
Henry Schimke
2023-03-18 15:48:47 -05:00
parent 07b934283b
commit 4c8db1f73f
9 changed files with 544 additions and 5 deletions

View File

@@ -499,6 +499,24 @@ impl std::ops::Sub for ConcentricPattern {
}
}
impl std::ops::Add for ConcentricPattern {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
let new_p = self.p - rhs.p;
Self {
p: new_p,
size: self.size,
}
}
}
impl From<Point> for ConcentricPattern {
fn from(value: Point) -> Self {
Self { p: value, size: 0 }
}
}
impl ConcentricPattern {
pub fn dot(self, other: ConcentricPattern) -> f32 {
Point::dot(self.p, other.p)