Continuing from part 1 of this series, consider a knot sequence, P_{0}, P_{1}, P_{2}, … P_{n-1} . The Cardinal spline fits a sequence of cubic polynomials to these knots, the first of which is between P_{0} and P_{1}. The second polynomial curve is between P_{1} and P_{2}, and so forth. Hermite interpolation is used to compute the polynomial coefficients, so start- and end-tangents are required at each knot.

Cardinal splines specify the tangents at interior points based on the vector from previous point to subsequent point. Each tangent is parallel to this vector and some multiple of its length. For example, the tangent direction at point P_{1} is parallel to the vector P_{2} – P_{0}, or we could simply write something like T_{1} = s(P_{2} – P_{0}) where s is a real number.

An astute reader immediately notices that this is very similar to the approach taken with the Catmull-Rom spline. As it happens, the C-R spline is a special case of the cardinal spline with a fixed multiplier value. It would be helpful to review this TechNote [PDF] on Catmull-Rom splines. The complete derivation of the Cardinal spline basis matrix is provided in the pages leading up to equation 5b.

The Cardinal spline provides an extra control parameter in terms of s. Adjusting this parameter controls the degree to which the spline follows the tangent vector leading into and exiting from the join point.

One item not discussed in detail in the C-R TechNote is that that of locality in terms of knot movement. In some splines, changing the location of a knot has a ‘ripple’ effect through the entire spline. With Cardinal splines, individual cubic polynomials are constructed with overlapping sets of four knots. The sets are

[P_{0}, P_{1}, P_{2}, P_{3}]

[P_{1}, P_{2}, P_{3}, P_{4}]

[P_{2}, P_{3}, P_{4}, P_{5}]

.

.

[P_{n-4}, P_{n-3}, P_{n-2}, P_{n-1}]

Denoting an arbitrary set by

[P_{a}, P_{b}, P_{c}, P_{d}]

Hermite interpolation is applied to points P_{b} and P_{c} with start tangent s(P_{c} – P_{a}) and s(P_{d} – P_{b}).

So, each knot participates in at most four spline segments. This tends to localize the effect of moving any single knot. Hermite interpolation is very efficient, so there is no system of equations to be solved to compute polynomial coefficients. A price is paid, however, for this convenience and this is loss of second-derivative continuity. A Cardinal spline is at best C-1 continuous.

The next part of this series looks at the s parameter in more detail. While it is tempting to think of it directly as a tension parameter, it is related to tension. It will be shown that the Catmull-Rom spline is a zero-tension or ‘neutral’ Cardinal spline. We will also discuss tangent directions at the initial and terminal knot as these are clearly arbitrary in the above analysis.

## One thought on “Cardinal Splines Part 2”

Comments are closed.