Expand description
Exact (BigRational) predicate tier — the correctness ground truth and the
cascade’s last-resort exact fallback. f64 coordinates are exactly
representable as BigRational, so every sign here is mathematically exact.
Functions§
- cmp_
along - Exact sign of
(a − b)·u— order two points along directionu, over ANY Explicit/Lpi/Tpi mix (generaliseslpi_compare_along). Witha=λa/da,b=λb/db:(a−b)·u = ((λa·u)·db − (λb·u)·da)/(da·db). - cmp_lex
- Exact lexicographic total order on points (x, then y, then z), over any mix
of
Explicit/Lpi/Tpi.Zero⇔ the two points are EXACTLY coincident — this is the interner’s symbolic vertex-identity test (no float weld). A strict total order: antisymmetric, transitive (proven by property test). - lpi_
compare_ along - Exact sign of
(proj_u(l1) − proj_u(l2))whereproj_u(X)=X·u— i.e. order two LPI points along directionu.proj = (λ·u)/d, so the sign isassemble_sign(sign((λ1·u)·d2 − (λ2·u)·d1), &[sign(d1), sign(d2)]). - lpi_
lambda - LPI λ-construction (exact): the implicit point is
(λx/d, λy/d, λz/d). LinePQ∩ planeRST: parametriseX = P + τ·(Q−P); on-plane gives(P−R)·(SR×TR) + τ·(Q−P)·(SR×TR) = 0, i.e.n + τ·d = 0, soτ = −n/dandλ = d·P − n·(Q−P)(the MINUS is load-bearing —+lands off the plane; verified bytritri::edge_crossing_lpi_lies_exactly_on_the_plane).qp=Q−P; sr=S−R; tr=T−R; pr=P−R; d=det3(qp,sr,tr); n=det3(pr,sr,tr). - lpi_
orient2d - Exact
orient2d(p1=LPI, b, c)(b,c explicit), projected afteraxis. - lpi_
orient3d - Exact
orient3d(p1=LPI, p2, p3, p4)withp2,p3,p4explicit. - lpi_
point - The materialised LPI point
λ/d(exact). Used by the oracle test that independently checks the homogenised form inlpi_orient3d. - orient2d_
2i - orient2d with TWO implicit points (a,b) and one explicit (c), projected after
axis.orient2d = Λ′/(d1·d2)withΛ′ = (λ1_i−d1·c_i)(λ2_j−d2·c_j) − (λ1_j−d1·c_j)(λ2_i−d2·c_i); both denominators are odd →den_signs = [sign(d1), sign(d2)]. - orient2d_
3i - orient2d with THREE implicit points (a,b,c), projected after
axis, based ona:Λ′ = (d1·λ2_i−d2·λ1_i)(d1·λ3_j−d3·λ1_j) − (d1·λ2_j−d2·λ1_j)(d1·λ3_i−d3·λ1_i).D′ = d1²·d2·d3, so the squaredd1is dropped →den_signs = [sign(d2), sign(d3)]. - orient2d_
exact - Exact orient2d on the two axes remaining after dropping
axis. - orient2d_
exact_ pt - Oracle cross-check: orient2d with the first arg already materialised.
- orient3d_
exact - Exact explicit orient3d — Shewchuk’s sign convention (matches
geometry_predicates::orient3d). - orient3d_
exact_ pt - Oracle cross-check: orient3d with the first argument already materialised
(the exact LPI point). Independent of the homogenisation above — the two
MUST agree, which is what proves the
Λ′/flip construction is correct. - tpi_
lambda - TPI λ-construction (exact) via Cramer on the three plane equations
nᵢ·x = cᵢ, withnᵢ=(Bᵢ−Aᵢ)×(Cᵢ−Aᵢ),cᵢ=nᵢ·Aᵢ(un-normalised → all polynomials, no sqrt). Cite: Attene 2020 §4.d=det3(n1,n2,n3),λ= the Cramer numerators (column k replaced by(c1,c2,c3)). - tpi_
orient2d - Exact
orient2d(p1=TPI, b, c)(b,c explicit), projected afteraxis. - tpi_
orient3d - Exact
orient3d(p1=TPI, p2, p3, p4)withp2,p3,p4explicit. - tpi_
point - Materialised TPI point
λ/d(exact) — for the oracle cross-check.