diff --git a/crates/cross/src/vec.rs b/crates/cross/src/vec.rs index a15aca0..60ffb74 100644 --- a/crates/cross/src/vec.rs +++ b/crates/cross/src/vec.rs @@ -138,11 +138,14 @@ impl Vec2 { } } - // /// Returns the angle of this point, (-pi, pi] - // pub fn arg(&self) -> R { - // // self.y.atan2(self.x) - // self.y.to_f64().atan2(self.x.to_f64()).cast() - // } + /// returns the angle of this point, (-pi, pi] + /// requires std feature + #[cfg(feature = "std")] + pub fn arg(&self) -> R { + // self.y.atan2(self.x) + // TODO: add `Real::atan2` and remove these casts + self.y.to_f64().atan2(self.x.to_f64()).cast() + } pub fn rotate(&self, angle: R) -> Self { let (sin, cos) = angle.sin_cos();