Expand description
Certified orientation predicates.
orient2d answers “does C lie left of, right of, or exactly on the directed
line AB”. The answer is a sign, and a sign drives topology, so a plausible
answer is not good enough: this module returns Certified and escalates
to exact arithmetic rather than guessing when the filter is inconclusive.
The strategy is the standard filtered cascade:
- Evaluate the determinant in plain f64 and compute a forward error bound.
- If the magnitude exceeds the bound, the sign is proven; return it.
- Otherwise recompute exactly with error-free transformations.
Step 1 succeeds for almost all real inputs, so the exact path is rare.
Functions§
- orient2d
- Orientation of
crelative to the directed linea->b. - orient2d_
filter - The fast filter alone, exposed so the escalation can be observed and tested.