MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / angle_between

Function angle_between

splashsurf_lib/src/mesh.rs:60–69  ·  view source on GitHub ↗

Computes the angle at vertex `b` of the given triangle

(
    a: &Vector3<RIn>,
    b: &Vector3<RIn>,
    c: &Vector3<RIn>,
)

Source from the content-addressed store, hash-verified

58
59/// Computes the angle at vertex `b` of the given triangle
60pub 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
72pub fn tri_min_max_angles<RIn: Real, RComp: Real>(

Callers 1

tri_min_max_anglesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected