diff --git a/src/cgmath/angle.rs b/src/cgmath/angle.rs index 9b7defc..89441b4 100644 --- a/src/cgmath/angle.rs +++ b/src/cgmath/angle.rs @@ -181,7 +181,7 @@ Equiv> for Deg { impl> Angle for Rad { #[inline] fn from>(theta: A) -> Rad { theta.to_rad() } - #[inline] fn full_turn() -> Rad { rad(Real::two_pi()) } + #[inline] fn full_turn() -> Rad { rad(Float::two_pi()) } } impl> diff --git a/src/test/vector.rs b/src/test/vector.rs index 029308b..61e4978 100644 --- a/src/test/vector.rs +++ b/src/test/vector.rs @@ -137,17 +137,17 @@ mod test_length { #[test] fn test_angle() { - assert!(Vec2::new(1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec2::new(10.0, 0.0).angle(&Vec2::new(0.0, 5.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec2::new(-1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &-rad(Real::frac_pi_2()) )); + assert!(Vec2::new(1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec2::new(10.0, 0.0).angle(&Vec2::new(0.0, 5.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec2::new(-1.0, 0.0).angle(&Vec2::new(0.0, 1.0)).approx_eq( &-rad(Float::frac_pi_2()) )); - assert!(Vec3::new(1.0, 0.0, 1.0).angle(&Vec3::new(1.0, 1.0, 0.0)).approx_eq( &rad(Real::frac_pi_3()) )); - assert!(Vec3::new(10.0, 0.0, 10.0).angle(&Vec3::new(5.0, 5.0, 0.0)).approx_eq( &rad(Real::frac_pi_3()) )); - assert!(Vec3::new(-1.0, 0.0, -1.0).angle(&Vec3::new(1.0, -1.0, 0.0)).approx_eq( &rad(2.0 * Real::frac_pi_3()) )); + assert!(Vec3::new(1.0, 0.0, 1.0).angle(&Vec3::new(1.0, 1.0, 0.0)).approx_eq( &rad(Float::frac_pi_3()) )); + assert!(Vec3::new(10.0, 0.0, 10.0).angle(&Vec3::new(5.0, 5.0, 0.0)).approx_eq( &rad(Float::frac_pi_3()) )); + assert!(Vec3::new(-1.0, 0.0, -1.0).angle(&Vec3::new(1.0, -1.0, 0.0)).approx_eq( &rad(2.0 * Float::frac_pi_3()) )); - assert!(Vec4::new(1.0, 0.0, 1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec4::new(10.0, 0.0, 10.0, 0.0).angle(&Vec4::new(0.0, 5.0, 0.0, 5.0)).approx_eq( &rad(Real::frac_pi_2()) )); - assert!(Vec4::new(-1.0, 0.0, -1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Real::frac_pi_2()) )); + assert!(Vec4::new(1.0, 0.0, 1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec4::new(10.0, 0.0, 10.0, 0.0).angle(&Vec4::new(0.0, 5.0, 0.0, 5.0)).approx_eq( &rad(Float::frac_pi_2()) )); + assert!(Vec4::new(-1.0, 0.0, -1.0, 0.0).angle(&Vec4::new(0.0, 1.0, 0.0, 1.0)).approx_eq( &rad(Float::frac_pi_2()) )); } #[test]