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]
|
/// returns the angle of this point, (-pi, pi]
|
||||||
// pub fn arg(&self) -> R {
|
/// requires std feature
|
||||||
// // self.y.atan2(self.x)
|
#[cfg(feature = "std")]
|
||||||
// self.y.to_f64().atan2(self.x.to_f64()).cast()
|
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 {
|
pub fn rotate(&self, angle: R) -> Self {
|
||||||
let (sin, cos) = angle.sin_cos();
|
let (sin, cos) = angle.sin_cos();
|
||||||
|
Reference in New Issue
Block a user