Skip to main content

Spline Interpolation

Spline interpolation creates smooth curves by connecting data points with piecewise polynomials. It combines the best aspects of linear and polynomial interpolation.

The Concept

Instead of using a single high-degree polynomial, splines use multiple low-degree polynomials (typically cubic) between consecutive points. These pieces are carefully matched to ensure smoothness.

Types of Splines

Cubic Splines

Most common type, using cubic polynomials between each pair of points.

Properties:

  • Passes through all data points
  • Continuous first and second derivatives
  • Minimizes curvature

Natural Cubic Splines

Cubic splines with zero second derivative at endpoints.

Hermite Splines

Require both values and derivatives at data points.

B-Splines

Offer even more local control, don't necessarily pass through points.

Advantages

Smooth: Continuous derivatives
Stable: No Runge's phenomenon
Local control: Changes affect only nearby segments
Accurate: Good approximation of smooth functions
Flexible: Different boundary conditions available

Disadvantages

More complex: Harder to understand than linear
Computational cost: More expensive than linear
Requires contiguous data: Best with ordered data points

When to Use Spline Interpolation

Splines are ideal when:

  • You need smooth curves
  • Data represents a smooth underlying function
  • You have many data points
  • Local control is important
  • Derivatives matter (e.g., velocity from position)

Example in Excel

Using our Excel add-in:

=INTERP.SPLINE(x_values, y_values, x_new)

Sample Data

XY
00
11
24
39
416

To interpolate at X = 2.5:

=INTERP.SPLINE(A2:A6, B2:B6, 2.5)
// Result: ~6.25 (smooth curve)

Mathematical Details

For cubic splines between points ii and i+1i+1, each segment is:

Si(x)=ai+bi(xxi)+ci(xxi)2+di(xxi)3S_i(x) = a_i + b_i(x-x_i) + c_i(x-x_i)^2 + d_i(x-x_i)^3

The coefficients are chosen to ensure:

  1. Si(xi)=yiS_i(x_i) = y_i (passes through points)
  2. Si(xi+1)=yi+1S_i(x_{i+1}) = y_{i+1} (continuity)
  3. Si(xi+1)=Si+1(xi+1)S'_i(x_{i+1}) = S'_{i+1}(x_{i+1}) (smooth first derivative)
  4. Si(xi+1)=Si+1(xi+1)S''_i(x_{i+1}) = S''_{i+1}(x_{i+1}) (smooth second derivative)

Visualization

Data Points

Divide into Segments

Fit Cubic Polynomial per Segment

Match Derivatives at Joints

Smooth Continuous Curve

Comparison with Other Methods

FeatureLinearPolynomialSpline
Smoothness
Stability
Speed✅✅
Accuracy⚠️✅✅
Best Choice

For most applications requiring smooth interpolation, cubic splines are the gold standard.

Practical Applications

Engineering

  • CAD/CAM curve design
  • Path planning for robotics
  • Signal interpolation

Finance

  • Yield curve construction
  • Volatility surface modeling

Graphics

  • Animation curves
  • Font rendering
  • Image scaling