Catmull-Rom Spline Derivatives

Catmull-Rom splines are interpolating, piece-wise cubic splines: a spline of this class passes through each of its control points, and restricted to each knot interval it is a cubic function.

How you choose the knot intervals has a significant effect on the spline’s quality. Long story short: you get the best results by setting them to the Euclidean distance between the two corresponding control points. Splines with such knot assignments are called centripetal splines.

For more information, this Wikipedia page has a nice summary and comparison plots for different choices of knot intervals. Cem Yuksel’s project page has more interesting details as well as many applications.

Computing a spline’s value at time is easy using a pyramidal formulation described here.

You can use the same pyramid structure to evaluate the tangent as well:

Here is a little MATLAB script that computes and plots a centripetal Catmull-Rom spline and its tangents.