use crate::elements::point::Point;
impl Point {
pub fn new(x: f32, y: f32) -> Self {
Self { x, y, ..Default::default() }
}
}
impl Point {
pub fn distance_to(&self, other: &Self) -> f32 {
let dx = self.x - other.x;
let dy = self.y - other.y;
(dx * dx + dy * dy).sqrt()
}
}