Skip to main content

Module sphere

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.

The determinants have degree 4 (incircle) and 5 (insphere) in the coordinate differences, so their products leave binary64’s range much sooner than orient*’s (#430). The filter and the expansion stage of the exact path therefore run only where every nonzero difference lies in a range that keeps all products normal: [2^-128, 2^128) for the filters, about [1e-60, 1e60] for the incircle expansion stage and [1e-45, 1e45] for the insphere one; the expansion stage also needs every nonzero rounding tail of a difference at least as large as the range’s lower bound. Any other finite input goes to a fixed-size dyadic evaluation over the original coordinates (sphere_dyadic), which forms no difference and no rounded product and is exact for every finite input. A non-finite coordinate returns Certified::Uncertain.

Functions§

in_diametral_sphere
Is d inside the diametral sphere of the triangle a, b, c?
in_diametral_sphere_filter
The running-error filter alone, exposed so escalation can be measured.
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.