|
1 |
| -use crate::f32::{Angle, Mat2, Mat3, Mat4, Quat, Vec2, Vec3, Vec4}; |
| 1 | +use crate::f32::{Mat2, Mat3, Mat4, Quat, Vec2, Vec3, Vec4}; |
2 | 2 | use approx::{AbsDiffEq, RelativeEq, UlpsEq};
|
3 | 3 |
|
4 |
| -impl AbsDiffEq for Angle { |
5 |
| - type Epsilon = <f32 as AbsDiffEq>::Epsilon; |
6 |
| - fn default_epsilon() -> Self::Epsilon { |
7 |
| - f32::default_epsilon() |
8 |
| - } |
9 |
| - fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool { |
10 |
| - let a1 = self.radians(); |
11 |
| - let a2 = other.radians(); |
12 |
| - a1.abs_diff_eq(&a2, epsilon) |
13 |
| - } |
14 |
| -} |
15 |
| - |
16 |
| -impl RelativeEq for Angle { |
17 |
| - fn default_max_relative() -> Self::Epsilon { |
18 |
| - f32::default_max_relative() |
19 |
| - } |
20 |
| - fn relative_eq( |
21 |
| - &self, |
22 |
| - other: &Self, |
23 |
| - epsilon: Self::Epsilon, |
24 |
| - max_relative: Self::Epsilon, |
25 |
| - ) -> bool { |
26 |
| - let a1 = self.radians(); |
27 |
| - let a2 = other.radians(); |
28 |
| - a1.relative_eq(&a2, epsilon, max_relative) |
29 |
| - } |
30 |
| -} |
31 |
| - |
32 |
| -impl UlpsEq for Angle { |
33 |
| - fn default_max_ulps() -> u32 { |
34 |
| - f32::default_max_ulps() |
35 |
| - } |
36 |
| - fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool { |
37 |
| - let a1 = self.radians(); |
38 |
| - let a2 = other.radians(); |
39 |
| - a1.ulps_eq(&a2, epsilon, max_ulps) |
40 |
| - } |
41 |
| -} |
42 |
| - |
43 | 4 | impl AbsDiffEq for Quat {
|
44 | 5 | type Epsilon = <f32 as AbsDiffEq>::Epsilon;
|
45 | 6 | fn default_epsilon() -> Self::Epsilon {
|
|
0 commit comments