This commit is contained in:
Antonio Scandurra 2023-10-23 17:41:22 +02:00
commit 4d621f355d
23 changed files with 679 additions and 419 deletions

View file

@ -40,6 +40,10 @@ impl Point<Pixels> {
y: self.y.scale(factor),
}
}
pub fn magnitude(&self) -> f64 {
((self.x.0.powi(2) + self.y.0.powi(2)) as f64).sqrt()
}
}
impl<T, Rhs> Mul<Rhs> for Point<T>