Computes the angle at vertex `b` of the given triangle
(
a: &Vector3<RIn>,
b: &Vector3<RIn>,
c: &Vector3<RIn>,
)
| 58 | |
| 59 | /// Computes the angle at vertex `b` of the given triangle |
| 60 | pub fn angle_between<RIn: Real, RComp: Real>( |
| 61 | a: &Vector3<RIn>, |
| 62 | b: &Vector3<RIn>, |
| 63 | c: &Vector3<RIn>, |
| 64 | ) -> RComp { |
| 65 | let a = a.convert::<RComp>(); |
| 66 | let b = b.convert::<RComp>(); |
| 67 | let c = c.convert::<RComp>(); |
| 68 | ((a - b).dot(&(c - b)) / ((a - b).norm() * (c - b).norm())).acos() |
| 69 | } |
| 70 | |
| 71 | /// Computes the minimum and maximum angle in the given triangle |
| 72 | pub fn tri_min_max_angles<RIn: Real, RComp: Real>( |
no outgoing calls
no test coverage detected