Cubic Hermite spline
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
In numerical analysis, a cubic Hermite spline or cubic Hermite interpolator is a spline where each piece is a third-degree polynomial specified in Hermite form:[1] that is, by its values and first derivatives at the end points of the corresponding domain interval.
Cubic Hermite splines are typically used for interpolation of numeric data specified at given argument values , to obtain a smooth continuous function. The data should consist of the desired function value and derivative at each
. (If only the values are provided, the derivatives must be estimated from them.) The Hermite formula is applied to each interval
separately. The resulting spline will be continuous and will have continuous first derivative.
Cubic polynomial splines can be specified in other ways, the Bézier form being the most common. However, these two methods provide the same set of splines, and data can be easily converted between the Bézier and Hermite forms; so the names are often used as if they were synonymous.
Cubic polynomial splines are extensively used in computer graphics and geometric modeling to obtain curves or motion trajectories that pass through specified points of the plane or three-dimensional space. In these applications, each coordinate of the plane or space is separately interpolated by a cubic spline function of a separate parameter t.
Cubic splines can be extended to functions of two or more parameters, in several ways. Bicubic splines (Bicubic interpolation) are often used to interpolate data on a regular rectangular grid, such as pixel values in a digital image or altitude data on a terrain. Bicubic surface patches, defined by three bicubic splines, are an essential tool in computer graphics.
Cubic splines are often called csplines, especially in computer graphics. Hermite splines are named after Charles Hermite.
Contents
Interpolation on a single interval
Unit interval (0, 1)
On the unit interval , given a starting point
at
and an ending point
at
with starting tangent
at
and ending tangent
at
, the polynomial can be defined by
where t ∈ [0, 1].
Interpolation on an arbitrary interval
Interpolating in an arbitrary interval
is done by mapping the latter to
through an affine (degree 1) change of variable. The formula is
with and
refers to the basis functions, defined below. Note that the tangent values have been scaled by
compared to the equation on the unit interval.
Uniqueness
The formulae specified above provide the unique third-degree polynomial path between the two points with the given tangents.
Proof:
Let be another third degree polynomial satisfying the given boundary conditions. Define
. Since both
and
are third degree polynomials,
is at most a third degree polynomial. Furthermore:
(We assume both
and
satisfy the boundary conditions)
So must be of the form:
We know furthermore that:
-
(1)
-
(2)
Putting (1) and (2) together, we deduce that and therefore
, thus
Representations
We can write the interpolation polynomial as
where ,
,
,
are Hermite basis functions. These can be written in different ways, each way revealing different properties.
expanded | factorized | Bernstein | |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The "expanded" column shows the representation used in the definition above. The "factorized" column shows immediately, that and
are zero at the boundaries. You can further conclude that
and
have a zero of multiplicity 2 at 0 and
and
have such a zero at 1, thus they have slope 0 at those boundaries. The "Bernstein" column shows the decomposition of the Hermite basis functions into Bernstein polynomials of order 3:
Using this connection you can express cubic Hermite interpolation in terms of cubic Bézier curves with respect to the four values and do Hermite interpolation using the de Casteljau algorithm. It shows that in a cubic Bézier patch the two control points in the middle determine the tangents of the interpolation curve at the respective outer points.
Interpolating a data set
A data set, for
, can be interpolated by applying the above procedure on each interval, where the tangents are chosen in a sensible manner, meaning that the tangents for intervals sharing endpoints are equal. The interpolated curve then consists of piecewise cubic Hermite splines, and is globally continuously differentiable in
.
The choice of tangents is non-unique, and there are several options available.
Finite difference
The simplest choice is the three-point difference, not requiring constant interval lengths,
for internal points , and one-sided difference at the endpoints of the data set.
Cardinal spline
A cardinal spline, sometimes called a canonical spline,[2] is obtained[3] if
is used to calculate the tangents. The parameter is a tension parameter that must be in the interval
. In some sense, this can be interpreted as the "length" of the tangent.
will yield all zero tangents, and
yields a Catmull–Rom spline.
Catmull–Rom spline
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
For tangents chosen to be
a Catmull–Rom spline is obtained, being a special case of a cardinal spline. This assumes uniform parameter spacing.
The curve is named after Edwin Catmull and Raphael Rom. The principal advantage of this technique is that the points along the original set of points also make up the control points for the spline curve.[4] Two additional points are required on either end of the curve. The default implementation of the Catmull–Rom algorithm can produce loops and self intersections. The chordal and centripetal Catmull–Rom implementations [5] solve this problem, but use a slightly different calculation.[6] In computer graphics, Catmull–Rom splines are frequently used to get smooth interpolated motion between key frames. For example, most camera path animations generated from discrete key-frames are handled using Catmull–Rom splines. They are popular mainly for being relatively easy to compute, guaranteeing that each key frame position will be hit exactly, and also guaranteeing that the tangents of the generated curve are continuous over multiple segments.
Kochanek–Bartels spline
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
A Kochanek–Bartels spline is a further generalization on how to choose the tangents given the data points ,
and
, with three parameters possible, tension, bias and a continuity parameter.
Monotone cubic interpolation
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
If a cubic Hermite spline of any of the above listed types is used for interpolation of a monotonic data set, the interpolated function will not necessarily be monotonic, but monotonicity can be preserved by adjusting the tangents.
Interpolation on the unit interval without exact derivatives
Given pn−1, pn, pn+1 and pn+2 as the values that the function, f(x), takes at integer ordinates n−1, n, n+1 and n+2, we can use centered differences instead of exact derivatives.[7] Thus the Catmull–Rom spline is
for , where the left-hand vector is independent of the p.
This writing is relevant for tricubic interpolation, where one optimization requires you to compute CINTx sixteen times with the same x and different p.
See also
- Bicubic interpolation, a generalization to two dimensions
- Tricubic interpolation, a generalization to three dimensions
- Hermite interpolation
- Multivariate interpolation
- Spline interpolation
- Discrete spline interpolation
References
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Charles Petzold. "Canonical Splines in WPF and Silverlight". 2009.
- ↑ Cardinal Splines at Microsoft Developer Network
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ N. Dyn, M. S. Floater, and K. Hormann. Four-point curve subdivision based on iterated chordal and centripetal parameterizations. Computer Aided Geometric Design, 26(3):279{286, 2009
- ↑ P. J. Barry and R. N. Goldman. A recursive evaluation algorithm for a class of Catmull-Rom splines. SIGGRAPH Computer Graphics, 22(4):199{204, 1988.
- ↑ Two hierarchies of spline interpolations. Practical algorithms for multivariate higher order splines
External links
- Spline Curves, Prof. Donald H. House Clemson University
- Multi-dimensional Hermite Interpolation and Approximation, Prof. Chandrajit Bajaj, Purdue University
- Introduction to Catmull–Rom Splines, MVPs.org
- Interpolating Cardinal and Catmull–Rom splines
- Interpolation methods: linear, cosine, cubic and hermite (with C sources)
- Common Spline Equations