diff --git a/src/physics/polar.rs b/src/physics/polar.rs index ed56f0b..3d83134 100644 --- a/src/physics/polar.rs +++ b/src/physics/polar.rs @@ -1,5 +1,5 @@ use super::Pfloat; -use cgmath::{Angle, Deg, EuclideanSpace, Point2}; +use cgmath::{Angle, Deg, Point2, Vector2}; #[derive(Debug, Clone, Copy)] pub struct Polar { @@ -10,9 +10,11 @@ pub struct Polar { impl Polar { pub fn to_cartesian(self) -> Point2 { - return Point2 { + let v = Vector2 { x: self.radius * self.angle.sin(), y: self.radius * self.angle.cos(), - } + self.center.to_vec(); + }; + + return self.center + v; } }