Module construct

Source
Expand description

Exact constructions over f64 inputs, decided without division.

Each construction’s result is kept symbolically – as its inputs plus a recipe – and every question about it is a SignExpr, answered by the interval filter or, when that cannot decide, exactly. Nothing is rounded until a caller asks for an approximate value for output: the approx_* methods are for output only, and a decision is always asked as a sign question.

Where an answer is provable from structure, it is not evaluated: the two hits of one circle are ordered by Branch, because subtracting two equal intervals can never certify zero.

Structs§

Circle
A circle; a zero radius is allowed and behaves as a point.
Line
The line through two distinct points, parameterised from + t*(to - from).
LineHit
A point where a line meets a circle, held exactly.

Enums§

Branch
Which of the two solutions: Minus has the smaller parameter.
HitCount
How a line meets a circle, hits in increasing parameter order.

Functions§

compare_along
Sign of t(first) - t(second): which hit comes first along their line.
crossing_orientation
Which side of the directed line a -> b the crossing of first and second lies on: [Sign::Positive] for left.
crossing_orientation_filter
The interval filter alone for crossing_orientation, so the escalation rate can be observed and tested. [Certified::Uncertain] means the exact tier would run; parallel lines also report uncertain.
line_circle_hits
Where line meets circle, exactly: missed, tangent, or two hits.