From fdbe91b2818901a35e6616a9d496f8e64286b4f1 Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 13 Sep 2022 00:48:13 -0700 Subject: [PATCH] Vec2: re-enable the `arg` method --- crates/cross/src/vec.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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();