diff --git a/src/angle.rs b/src/angle.rs index aef9cf9..5c0ae2d 100644 --- a/src/angle.rs +++ b/src/angle.rs @@ -1,5 +1,4 @@ use core::cmp::{Eq, Ord}; -use core::f64::consts::pi; use funs::triganomic::{cos, sin}; use mat::{Mat3, Mat4}; @@ -48,11 +47,11 @@ pub impl Radians: Angle { #[inline(always)] static pure fn zero() -> Radians { Radians(Number::zero()) } #[inline(always)] pure fn to_radians(&self) -> Radians { *self } - #[inline(always)] pure fn to_degrees(&self) -> Degrees { Degrees(**self * cast(180.0 / pi)) } + #[inline(always)] pure fn to_degrees(&self) -> Degrees { Degrees(**self * cast(180.0 / Float::pi())) } #[inline(always)] pure fn wrap(&self) -> Radians { - let theta = (*self) % cast(2.0 * pi); + let theta = (*self) % cast(2.0 * Float::pi()); // keep in the domain of 0 to 1 rad if theta >= Angle::zero() { @@ -141,7 +140,7 @@ pub impl Degrees: Angle { #[inline(always)] static pure fn octant() -> Degrees { Degrees(cast(45.0)) } #[inline(always)] static pure fn zero() -> Degrees { Degrees(cast(0.0)) } - #[inline(always)] pure fn to_radians(&self) -> Radians { Radians(**self * cast(pi / 180.0)) } + #[inline(always)] pure fn to_radians(&self) -> Radians { Radians(**self * cast(Float::pi::() / 180.0)) } #[inline(always)] pure fn to_degrees(&self) -> Degrees { *self } #[inline(always)]