use nalgebra::{Point2, Vector2}; #[derive(Debug, Clone, Copy)] pub struct Polar { /// The center of this polar coordinate pub center: Point2, /// The radius of this polar coordinate pub radius: f32, /// In radians pub angle: f32, } impl Polar { pub fn to_cartesian(self) -> Point2 { let v = Vector2::new( self.radius * self.angle.sin(), self.radius * self.angle.cos(), ); return self.center + v; } }