ConceptComplete

Spline Interpolation

Spline interpolation uses piecewise polynomials to achieve smooth approximation without the oscillations of high-degree polynomial interpolation, providing the foundation for modern computer graphics and CAD systems.

DefinitionCubic Spline

Given data points (x0,y0),,(xn,yn)(x_0, y_0), \ldots, (x_n, y_n) with x0<x1<<xnx_0 < x_1 < \cdots < x_n, a cubic spline S(x)S(x) satisfies:

  1. S(x)S(x) is a cubic polynomial Si(x)S_i(x) on each interval [xi,xi+1][x_i, x_{i+1}]
  2. S(xi)=yiS(x_i) = y_i for all ii (interpolation condition)
  3. Si(xi+1)=Si+1(xi+1)S_i(x_{i+1}) = S_{i+1}(x_{i+1}) (continuity)
  4. Si(xi+1)=Si+1(xi+1)S_i'(x_{i+1}) = S_{i+1}'(x_{i+1}) (smooth first derivative)
  5. Si(xi+1)=Si+1(xi+1)S_i''(x_{i+1}) = S_{i+1}''(x_{i+1}) (smooth second derivative)

Additional boundary conditions are needed to make the system determined. Common choices include natural spline (S(x0)=S(xn)=0S''(x_0) = S''(x_n) = 0), clamped spline (specified S(x0)S'(x_0), S(xn)S'(x_n)), or periodic spline.

Cubic splines balance computational efficiency with smoothness. Linear splines (C0C^0 continuous) are simple but have discontinuous derivatives. Quadratic splines require asymmetric boundary conditions. Cubic splines provide C2C^2 continuity and are the lowest-degree polynomials achieving this naturally.

ExampleNatural Cubic Spline Construction

For three points (0,0)(0,0), (1,1)(1,1), (2,0)(2,0), construct the natural cubic spline.

On [0,1][0,1]: S0(x)=a0+b0x+c0x2+d0x3S_0(x) = a_0 + b_0 x + c_0 x^2 + d_0 x^3 On [1,2][1,2]: S1(x)=a1+b1x+c1x2+d1x3S_1(x) = a_1 + b_1 x + c_1 x^2 + d_1 x^3

The interpolation and continuity conditions give 6 equations in 8 unknowns. Natural boundary conditions S0(0)=0S_0''(0) = 0 and S1(2)=0S_1''(2) = 0 provide 2 more, yielding a tridiagonal linear system:

S0(x)=x+34x234x3S_0(x) = x + \frac{3}{4}x^2 - \frac{3}{4}x^3 S1(x)=7+9x154x2+34x3S_1(x) = -7 + 9x - \frac{15}{4}x^2 + \frac{3}{4}x^3

This spline is C2C^2 continuous at x=1x=1 and interpolates all three points.

Remark

Optimality of Cubic Splines: Among all C2C^2 functions interpolating given data, the natural cubic spline minimizes: x0xn[f(x)]2dx\int_{x_0}^{x_n} [f''(x)]^2 \, dx

This variational property models a thin elastic beam passing through the data points, explaining why splines appear "natural" and smooth. The minimization leads to a tridiagonal system that can be solved efficiently in O(n)O(n) operations.

Practical spline implementations use parametric representations for curves and surfaces. B-splines provide local control (changing one control point affects only nearby curve segments) and form the basis of NURBS (Non-Uniform Rational B-Splines) used in CAD/CAM systems. Tensor product splines extend to multidimensional approximation for image processing and scientific visualization.

Splines avoid the Runge phenomenon that plagues high-degree polynomial interpolation. While polynomial error grows as O(hn+1)O(h^{n+1}) with degree nn and spacing hh, cubic spline error is O(h4)O(h^4), independent of the number of points. This makes splines practical for large datasets where high-degree polynomials would be numerically unstable.