Commit f595b94 1 parent 9fb62bf commit f595b94 Copy full SHA for f595b94
File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,15 @@ impl<T: Euclid + RealField> RelativeEq for Angle<T> {
42
42
epsilon : Self :: Epsilon ,
43
43
max_relative : Self :: Epsilon ,
44
44
) -> bool {
45
- self . normalized ( )
45
+ self . angle_between ( other . clone ( ) )
46
46
. 0
47
- . relative_eq ( & other . normalized ( ) . 0 , epsilon, max_relative)
47
+ . relative_eq ( & T :: zero ( ) , epsilon, max_relative)
48
48
}
49
49
}
50
50
51
51
impl < T : Euclid + RealField > PartialEq for Angle < T > {
52
52
fn eq ( & self , other : & Self ) -> bool {
53
- self . normalized ( ) . 0 == other . normalized ( ) . 0
53
+ self . angle_between ( other . clone ( ) ) . 0 == T :: zero ( )
54
54
}
55
55
}
56
56
@@ -62,10 +62,9 @@ impl<T: Euclid + RealField + Clone> AbsDiffEq for Angle<T> {
62
62
}
63
63
64
64
fn abs_diff_eq ( & self , other : & Self , epsilon : Self :: Epsilon ) -> bool {
65
- let difference = ( self . clone ( ) - other. clone ( ) ) . normalized ( ) . into_inner ( ) ;
66
-
67
- difference. abs_diff_eq ( & T :: zero ( ) , epsilon. clone ( ) )
68
- || difference. abs_diff_eq ( & T :: two_pi ( ) , epsilon)
65
+ self . angle_between ( other. clone ( ) )
66
+ . 0
67
+ . abs_diff_eq ( & T :: zero ( ) , epsilon)
69
68
}
70
69
}
71
70
You can’t perform that action at this time.
0 commit comments