Expand description
Numbers of the form (a + b*sqrt(c)) / d.
A line meets a circle at such a parameter; comparing two such hits, or
asking which side of a line one lies on, is a sign question about them.
Signs are decided by squaring with case analysis (the approach of CGAL’s
Root_of_2), never by evaluating a root, so in exact arithmetic the
answer is exact, including an exact zero.
Degree note: sign_root squares once (degree 2 in a, b, c);
sign_two_roots squares twice. Mantissa length, and so exact-tier cost,
grows with that degree. Both run the interval filter first.
Structs§
- Root2
- The value
(a + b*sqrt(c)) / d, withc >= 0andd != 0.
Functions§
- sign_
root - Sign of
a + b*sqrt(c)forc >= 0. - sign_
two_ roots - Sign of
p + q*sqrt(c) + r*sqrt(e)forc, e >= 0.