Computes the unsigned area of the given triangle
(
a: &Vector3<RIn>,
b: &Vector3<RIn>,
c: &Vector3<RIn>,
)
| 32 | |
| 33 | /// Computes the unsigned area of the given triangle |
| 34 | pub fn tri_area<RIn: Real, RComp: Real>( |
| 35 | a: &Vector3<RIn>, |
| 36 | b: &Vector3<RIn>, |
| 37 | c: &Vector3<RIn>, |
| 38 | ) -> RComp { |
| 39 | let a = a.convert::<RComp>(); |
| 40 | let b = b.convert::<RComp>(); |
| 41 | let c = c.convert::<RComp>(); |
| 42 | ((b - a).cross(&(c - a))) |
| 43 | .norm() |
| 44 | .unscale(RComp::one() + RComp::one()) |
| 45 | } |
| 46 | |
| 47 | /// Computes the face normal of the given triangle |
| 48 | pub fn tri_normal<RIn: Real, RComp: Real>( |
no outgoing calls
no test coverage detected