Interpolation & Splines
Interpolation
Given a set of data points from an (unknown) function
e.g. Given
Estimate
Theorem (Unisolvence Theorem)
Given
Vandermonde Matrices

The monomial basis
The familiar form
The sequence,
Monomial form is a sum of coefficients
The Lagrange basis
We will define the Lagrange basis functions,
where
Given
When
When
Ensures
by construction
- They give the same interpolating polynomial
- We can directly write down the polynomial from the Lagrange basis functions
- No need to solve a linear system
Polynomial Interpolation for many points
Fitting a “high degree” (
- Runge’s phenomenon
Piecewise Interpolation
Hermite Interpolation
The problem of fitting a polynomial given function values and derivatives
Closed-form Solution
Defining the polynomial on the
We saw that the direct formulas for the polynomial coefficients are:
where we define
and

Some Terminology
Knots: Points where the interpolant transitions from one polynomial/interval to another
Nodes: Points where some control points/data is specified
- For Hermite interpolation, these are the same
- For other curve types (e.g. Bezier Curves), they can differ

Can we still fit a piecewise cubic to the set of points?
- Yes, but each “piece” needs data from more than just its 2 endpoints
Cubic Splines
Fit a cubic,
Require interpolating conditions on each interval
and derivative conditions at each interior point
Counting Unknowns
Assuming
- 4 unknowns for each of
intervals
Counting Equations
Assuming
- 2 interpolating conditions per interval:
- 2 derivative conditions per interior point:
No! Not enough information for unique solution!
Need 2 more equations
- Usually at domain endpoints
- Boundary conditions or end conditions
Boundary Conditions
Clamped
Slope set to specific value
specified
If both boundaries clamped, it is a complete or clamped spline
Free/natural/variational
If both boundaries are free, called a natural cubic spline.
- Curve “straightens out”
Periodic boundary
- Start and end derivates match each other
“Not-a-knot” boundary conditions
- Match 3rd derivates on end segments
- Last two segments on an end become the same polynomial
Hermite vs. Cubic Splines
Hermite Interpolation: each interval can be found independently
Cubic Spline: must solve for all polynomials together at once!
Basic cubic spline approach
For
Write down:
interpolating conditions: match inputs at interval endpoints first derivative conditions: match first derivatives at interior nodes second derivative conditions: match second derivatives at interior nodes - Additional boundary conditions for the 2 ends
Solve linear system ofequations for all polynomial coefficients
Cubic Splines via Hermite Interpolation
Use Hermite interpolation as a stepping stone to build a cubic spline!
- Express unknown polys with closed form Hermite equations
- Treat the
as unknowns - Solve for
that gives continuous 2nd derivates - Given
, plug into closed form Hermite equations to recover poly coefficients.
Efficient Splines Summary
Interior nodes
where we define
and
Clamped BC:
Free BC:
Matrix Form
We can write this linear system for the slopes in matrix/vector form

New system has one equation per node, no matrix size is
Matrix Structure
The matrix is tridiagonal. Only the entries on the diagonal and its two neighbours are ever non-zero!

Shortcomings So Far
Cannot handle curve that has different

Parametric Curves
Lets us handle more general curves
- Cannot express as
Solution
Let
Then a point’s position is given by the vector

Parameter
Non-Uniqueness
A given curve can be “parameterized” in different ways, while yielding the exact same shape.
- Can traverse
in opposite direction
Speeds
2 parameterizations can also traverse the curve in the same direction, but at different speeds/rates
Repeated Points
Curves with self-intersections are supported easily
Piecewise Parametric Curves

Arc-Length Parameterization
Common to choose

This gives unit speed traversal of the curve
- Travel 1 unit of distance in 1 unit of time
Parametric Curves using Interpolation
Parametric curves are just the general concept
We can combine existing interpolant types with parametric curves by considering
- Use two Lagrange polynomials,
, to fit small set of - use Hermite interpolation for
given - Fit separate cubic splines to
, given many points
Parameterizations for Piecewise Polynomials
Given ordered
- We need data for
, to form and pairs to fit curves to
Option 1: Use node indexas the parameterization
Option 2: Approximate arc-length parameterization - set
at first node - Recursively compute
- Distance between
and
- Distance between