Skip to main content

orient2d_sos

Function orient2d_sos 

Source
pub fn orient2d_sos(
    a: Point2,
    b: Point2,
    c: Point2,
    ia: usize,
    ib: usize,
    ic: usize,
) -> f64
Expand description

Compute orient2d(a, b, c) with symbolic perturbation to resolve degeneracy.

When the exact orient2d returns 0 (collinear points), applies an index-based perturbation: the point with the highest index is perturbed infinitesimally upward, breaking ties consistently.

Returns a non-zero f64 whose sign indicates the resolved orientation. The magnitude is arbitrary when the exact result was zero.