1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/// 2D point. #[derive(Copy, Clone, Debug)] pub struct Point { x: f64, y: f64, } impl Point { pub fn new(x: f64, y: f64) -> Self { Point { x, y } } pub fn x(&self) -> f64 { self.x } pub fn y(&self) -> f64 { self.y } }