#[derive(Debug, Clone, Copy, PartialEq)] pub struct Vec2d { pub x: f64, pub y: f64 } impl Vec2d { pub fn distance(&self, other: Vec2d) -> f64 { ((other.x-self.x).powi(2) + (other.y-self.y).powi(2)).sqrt() } }