Module orient3

Source
Expand description

orient3d: which side of a plane a point lies on.

Returns the sign of the 3x3 determinant

| ax-dx  ay-dy  az-dz |
| bx-dx  by-dy  bz-dz |
| cx-dx  cy-dy  cz-dz |

Positive means d sees a, b, c counter-clockwise, i.e. d is below the plane under the right-hand rule. Zero means the four points are exactly coplanar – the case that decides tetrahedralisation, convex hull facets, and whether a boolean surface passes through a vertex.

Same filtered cascade as orient2d: cheap f64 with an error bound, then exact expansion arithmetic when the bound cannot exclude zero.

Functions§

orient3d
Orientation of d relative to the plane through a, b, c.
orient3d_filter
The fast filter alone, exposed so escalation can be measured.