lpi_compare_along

Function lpi_compare_along 

Source
pub fn lpi_compare_along(l1: &Lpi, l2: &Lpi, u: [f64; 3]) -> Sign
Expand description

Exact sign of (proj_u(l1) − proj_u(l2)) where proj_u(X)=X·u — i.e. order two LPI points along direction u. proj = (λ·u)/d, so the sign is assemble_sign(sign((λ1·u)·d2 − (λ2·u)·d1), &[sign(d1), sign(d2)]).

u need only be APPROXIMATELY along the points’ shared line L: for points on L, proj_u(p1)−proj_u(p2) = (s1−s2)(L_dir·u), so as long as L_dir·u > 0 the exact sign equals the true 1D order along L regardless of u’s rounding.