4 ms·
I used quadratic curves to render strokes in TabletDraw, although that's not user level. Another advantage of quadratic curves is that they can be converted to
by mistercow 12y ago
I used quadratic curves to render strokes in TabletDraw, although that's not user level.
Another advantage of quadratic curves is that they can be converted to a parabolic function plus a rotation. That opens the door for all sorts of optimization that is much harder with cubic bezier curves, which are not guaranteed to be functions.
- TheRealPomax 12y agoNot entirely true, but not entirely false either: the quadratic has degenerate cases where it can't be represented by a single quadratic polynomial, and regardless of the order, each dimension in a nth order Bezier curve is guaranteed to be a plain old nth order polynomial function. Most properties for the cubic curve as a whole come from evaluating each dimension independently, which still allows for a fair number of optimizations, and we can classify cubics in a few canonical forms that let us do even more optimizations ("a geometric characterization of parametric cubic curves" by Stone and DeRose is a good read on that) So a cautionary note: finding the angle necessary to turn a quadratic curve into a parabola (for unbalanced curves) can cost as much as using an optimized canonical cubic, where the user's input only defines the linear transform that you throw at the graphics context to make sure the curve you then draw matches the curve the user expected.