Vec2: re-enable the arg
method
This commit is contained in:
@@ -138,11 +138,14 @@ impl<R: Real> Vec2<R> {
|
||||
}
|
||||
}
|
||||
|
||||
// /// 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();
|
||||
|
Reference in New Issue
Block a user