Module sphere

Source
Expand description

incircle and insphere: is a point inside a circumscribed ball?

These are the Delaunay predicates. incircle(a, b, c, d) asks whether d lies inside the circle through a, b, c; insphere is the 3D analogue. A zero means d lies exactly on the ball – the cocircular/cospherical case that makes a Delaunay triangulation non-unique and, if misjudged, produces inverted or overlapping cells.

Both are lifted determinants: adding a coordinate equal to the squared distance from the origin turns “inside a ball” into “below a hyperplane”. That lift squares the operand magnitudes, so the error bound grows faster than orient*’s and the filter fails sooner – which is why the escalation rate is measured rather than assumed.

Functions§

incircle
Is d inside the circle through a, b, c?
incircle_filter
The fast filter alone, exposed so escalation can be measured.
insphere
Is e inside the sphere through a, b, c, d?
insphere_filter
The fast filter alone, exposed so escalation can be measured.