CompGeoJS Natural Cubic Spline
As I alluded to in the prior post, it is necessary to temporarily alter the direction of the CompGeoJS project to suit some near-term requirements, particularly in the area of data visualization and analysis. I will also be dividing the library into an open-source version and a clients-only version. The latter contains IP and advanced capability for which clients specifically expect a greater degree of control and assurance that such capability will not later become open-source.
So, I have temporarily diverged from the Bezier curve development and moved to the natural cubic spline. This spline interpolates a set of control points with increasing x-coordinate values. The spline is piecewise-cubic and represents (provably) the smoothest interpolator for the control points with a piecewise cubic curve.
The advanced version of CompGeoJS (for clients only) currently contains methods to approximate the cubic spline with a sequence of quadratic Bezier curves. Arc length of each quadratic Bezier segment is efficiently computed during the approximation process and recorded along with each Bezier. An auxiliary array containing the list of quads that comprise each segment of the cubic spline is also recorded. This technique is very useful for fast rendering and supplemental analytics.