Computes the minimum and maximum angle in the given triangle
(
a: &Vector3<RIn>,
b: &Vector3<RIn>,
c: &Vector3<RIn>,
)
| 70 | |
| 71 | /// Computes the minimum and maximum angle in the given triangle |
| 72 | pub fn tri_min_max_angles<RIn: Real, RComp: Real>( |
| 73 | a: &Vector3<RIn>, |
| 74 | b: &Vector3<RIn>, |
| 75 | c: &Vector3<RIn>, |
| 76 | ) -> (RComp, RComp) { |
| 77 | let a = a.convert::<RComp>(); |
| 78 | let b = b.convert::<RComp>(); |
| 79 | let c = c.convert::<RComp>(); |
| 80 | let alpha1: RComp = angle_between(&a, &b, &c); |
| 81 | let alpha2: RComp = angle_between(&b, &c, &a); |
| 82 | let alpha3 = RComp::pi() - alpha1 - alpha2; |
| 83 | |
| 84 | ( |
| 85 | alpha1.min(alpha2.min(alpha3)), |
| 86 | alpha1.max(alpha2.max(alpha3)), |
| 87 | ) |
| 88 | } |
| 89 | |
| 90 | /// Computes the aspect ratio of the given triangle |
| 91 | /// |
no test coverage detected