use cgmath::{Angle, Point2, Rad, Vector2}; #[derive(Debug, Clone, Copy)] pub struct Polar { pub center: Point2, pub radius: f32, pub angle: Rad, } impl Polar { pub fn to_cartesian(self) -> Point2 { let v = Vector2 { x: self.radius * self.angle.sin(), y: self.radius * self.angle.cos(), }; return self.center + v; } }