In discussing the natural cubic spline, I mentioned that it was a piecewise cubic interpolant intended for tables of data with non-overlapping intervals. While there are some very useful theoretical advantages to this spline as an interpolant, it is difficult to use the spline as a drawing tool. A parametric spline is built on top of the natural cubic spline and it suitable for static drawings.

The spline is parameterized on chord-length. Each knot is mapped into [0,1] based on the fraction of the cumultative Euclidean distance between knots to the total distance. The domain in this parameterization is monotonically increasing. Two natural cubic splines are fit to the parameterized data; x vs. t and y vs. t.

The screen shot below shows an example plot.

The drawing is old-school; simple line segments. As such, it is not yet a candidate for direct inclusion in Degrafa. Because of the plotting method and the internal computational complexity, I would only use such a spline for static drawings. It is, however, built on top of the Degrafa natural cubic spline and serves as an example of how that spline can be used in practice.

If time allows this weekend, I will modify the demo to compare the parametric cubic spline to the Degrafa cubic Bezier spline. The current demo provides the parametric cubic spline as a standalone .as file. Degrafa is required to build the demo.

## One thought on “Parametric Spline”

Comments are closed.