Different root isolation algorithms now live in separate modules,
and are all instances of the RootIsolationAlgorithm typeclass.
This separates the algorithmic code from the top-level driver code
in Math.Root.Isolation.
Based on ideas from the paper
"The Ins and Outs of Solving Quadratic Equations with Floating-Point Arithmetic"
(Frédéric Goualard, 2023)
Could still be improved further, but I think this is acceptable for now.
This commit bakes in a certain kind of representation for brush strokes:
c(t,s) = p(t) + R(theta(t)) b(t,s)
This representation allows us to cancel out some rotation terms when
computing the envelope equation, improving the efficiency of the
cusp-finding methods.
This commit makes it easier to switch between the 2-dim and 3-dim
formulations of the cusp-finding problem. This is still work in progress,
trying to improve the performance of the cusp-finding algorithms.
The code is now generic over the dimension. There is a slight performance
loss that I need to investigate; perhaps some things are not getting
specialised? Maybe it is better to be more explicit about staging and
splice in the functions with fixed dimensions.
Computing a rotation in interval arithmetic can lose tightness.
Instead of computing
a cos phi + b sin phi
which doesn't account for the difference in phase in the two sinusoids,
it is better to use
sqrt (a² + b²) * cos ( phi - atan2(a,b) )
which correctly estimates the maximum amplitude of the sum to be
sqrt(a²+b²) instead of abs(a) + abs(b).
This seems to worsen the performance of the interval Newton method
at the moment, possibly due to the complexity of the new formula,
which involves computing atan(b/a). Further investigation is needed.
Now we evaluate Bézier curves using an AABB computation. This results
in tighter intervals, which means that the cusp-finding algorithm
is better behaved.
also includes the start of a way to observe which equations
are being solved, which should help with improving the performance of
the interval Newton method