This is something I started many years ago and put on the shelf because I never had an immediate use for it. Two utilities are forthcoming in Degrafa; spline->Bezier anad function->Bezier. These utilities approximate functions and specific splines over an interval with quadratic Bezier curves. With these utilities, splines such as natural cubic, parametric, and Catmull-Rom will be easily plottable in the normal Degrafa geometry pipeline.
Following is a screen shot of work in progress on a natural cubic spline. This was originally a derivative test as the spline slope at various points is required for the algorithm. The derivative formula is covered in this TechNote. There is no overlap between successive knot intervals. The blue curve shows a simple point-to-point plot of the natural cubic spline. The red curve shows the quadratic Bezier approximation.
Well over a hundred small lines are used in the traditional plot. There are ten quads. in the above example.
Instead of trying to minimize the total number of quad. Bezier curves, the algorithm produces a modest number of quads in exchange for exact representation at knots and an integral number of quads. per spline segment. This makes it very easy to create specific shapes out of the quad. approximation between knots which could be useful in charting applications.
More to come!