Cardinal spline

From Wikipedia, the free encyclopedia

In the mathematical subfield numerical analysis, a cardinal spline is a cubic Hermite spline whose tangents are defined by the points and a tension parameter. This spline creates a curve from one waypoint to another taking into account the waypoints before and after. By taking into account the way points before and after the current curve, the curves appear to join together making one seamless curve.

Cardinal Spline Example. The line represents the curve, and the squares represent the control points. Notice that the curve does not reach the first and last points, these points do however affect the shape of the curve. The tension parameter used is 0.1
Cardinal Spline Example. The line represents the curve, and the squares represent the control points. Notice that the curve does not reach the first and last points, these points do however affect the shape of the curve. The tension parameter used is 0.1

Given n+1 points

p0, ..., pn,

to be interpolated with n cubic Hermite curve segments, for each curve we have a starting point pi and an ending point pi+1 with starting tangent mi and ending tangent mi+1 with the tangents defined by

\mathbf{m}_i = \begin{matrix}\frac{1}{2}\end{matrix}(1-c)(\mathbf{p}_{i+1}-\mathbf{p}_{i-1})

where the first and last tangent m0 and mn are given and c is a constant that modifies the length of the tangent (the tension parameter).

The tension parameter c should be between 0 and 1. A Catmull-Rom spline is a cardinal spline with tension parameter c = 0.