Use Float for trait bounds instead of Real + ApproxEq<S>

This commit is contained in:
Brendan Zabarauskas 2013-09-03 17:14:27 +10:00
parent a89a5d70e8
commit ca432e9728

View file

@ -152,7 +152,7 @@ impl<S: Clone + Num> Vec3<S> {
/// 2-dimensional and 3-dimensional vectors.
pub trait EuclideanVector
<
S: Clone + Real + ApproxEq<S>,
S: Clone + Float,
Slice
>
: Vector<S, Slice>
@ -201,14 +201,14 @@ pub trait EuclideanVector
}
}
impl<S: Clone + Real + ApproxEq<S>> EuclideanVector<S, [S, ..2]> for Vec2<S> {
impl<S: Clone + Float> EuclideanVector<S, [S, ..2]> for Vec2<S> {
#[inline]
fn angle(&self, other: &Vec2<S>) -> S {
atan2(self.perp_dot(other), self.dot(other))
}
}
impl<S: Clone + Real + ApproxEq<S>> EuclideanVector<S, [S, ..3]> for Vec3<S> {
impl<S: Clone + Float> EuclideanVector<S, [S, ..3]> for Vec3<S> {
#[inline]
fn angle(&self, other: &Vec3<S>) -> S {
atan2(self.cross(other).length(), self.dot(other))