Skip to main content

Module robust

Module robust 

Source
Expand description

Numerically robust geometric predicates.

Uses Shewchuk’s adaptive precision floating-point arithmetic via the robust crate to guarantee correct results even for near-degenerate geometric configurations.

§Background

Standard floating-point arithmetic can produce incorrect results for geometric predicates when points are nearly collinear or cocircular. This module provides robust alternatives.

§References

Enums§

Orientation
Result of an orientation test.

Functions§

is_ccw
Checks if a polygon has counter-clockwise winding order.
is_convex
Checks if a polygon is convex using robust orientation tests.
orient2d
Determines the orientation of three points using exact arithmetic.
orient2d_filtered
Fast orientation test with exact fallback.
orient2d_raw
Returns the raw orientation determinant (twice the signed area).
point_in_triangle
Checks if a point lies strictly inside a triangle.
point_in_triangle_inclusive
Checks if a point lies inside or on the boundary of a triangle.