Cubic Hermite spline: Difference between revisions
The final row of the spline equation forgot the powers of 'u' from the above row. |
Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
(26 intermediate revisions by 17 users not shown) | |||
Line 18: | Line 18: | ||
Cubic polynomial splines are extensively used in [[computer graphics]] and [[geometric modeling]] to obtain [[curve]]s or motion [[trajectory|trajectories]] that pass through specified points of the [[plane (geometry)|plane]] or three-dimensional [[space (geometry)|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 polynomial splines are extensively used in [[computer graphics]] and [[geometric modeling]] to obtain [[curve]]s or motion [[trajectory|trajectories]] that pass through specified points of the [[plane (geometry)|plane]] or three-dimensional [[space (geometry)|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 polynomial splines are also used extensively in structural analysis applications, such as [[Euler–Bernoulli beam theory]]. |
Cubic polynomial splines are also used extensively in structural analysis applications, such as [[Euler–Bernoulli beam theory]]. Cubic polynomial splines have also been applied to mortality analysis<ref name=richards> |
||
{{cite journal |
|||
| title = A Hermite-spline model of post-retirement mortality |
|||
| author = Stephen Richards |
|||
| publisher = Taylor and Francis |
|||
| journal = Scandinavian Actuarial Journal |
|||
| pages = 110-127 |
|||
| doi = 10.1080/03461238.2019.1642239 |
|||
| year = 2020 |
|||
}}</ref> and mortality forecasting.<ref name=tanglieandtickle> |
|||
{{cite journal |
|||
| title = A Hermite spline approach for modelling population mortality |
|||
| author = Sixian Tang, Jackie Li and Leonie Tickle |
|||
| publisher = Cambridge University Press |
|||
| journal = Annals of Actuarial Science |
|||
| pages = 1-42 |
|||
| doi = 10.1017/S1748499522000173 |
|||
| year = 2022 |
|||
}}</ref> |
|||
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. [[Bézier patch|Bicubic surface patches]], defined by three bicubic splines, are an essential tool in computer graphics. |
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. [[Bézier patch|Bicubic surface patches]], defined by three bicubic splines, are an essential tool in computer graphics. |
||
Line 25: | Line 43: | ||
==Interpolation on a single interval== |
==Interpolation on a single interval== |
||
===Unit interval |
===Unit interval [0, 1]=== |
||
[[File:HermiteBasis.svg|thumb|300px|right|The four Hermite basis functions. The interpolant in each subinterval is a linear combination of these four functions.]] |
[[File:HermiteBasis.svg|thumb|300px|right|The four Hermite basis functions. The interpolant in each subinterval is a linear combination of these four functions.]] |
||
On the unit interval <math> |
On the unit interval <math>[0,1]</math>, given a starting point <math>\boldsymbol{p}_0</math> at <math>t = 0</math> and an ending point <math>\boldsymbol{p}_1</math> at <math>t = 1</math> with starting tangent <math>\boldsymbol{m}_0</math> at <math>t = 0</math> and ending tangent <math>\boldsymbol{m}_1</math> at <math>t = 1</math>, the polynomial can be defined by |
||
<math display="block">\boldsymbol{p}(t) = \left(2t^3 - 3t^2 + 1\right) \boldsymbol{p}_0 + \left(t^3 - 2t^2 + t\right) \boldsymbol{m}_0 + \left(-2t^3 + 3t^2\right) \boldsymbol{p}_1 + \left(t^3 - t^2\right) \boldsymbol{m}_1,</math> |
|||
where ''t'' ∈ [0, 1]. |
where ''t'' ∈ [0, 1]. |
||
===Interpolation on an arbitrary interval=== |
===Interpolation on an arbitrary interval=== |
||
Interpolating <math>x</math> in an arbitrary interval <math>(x_k, x_{k+1})</math> is done by mapping the latter to <math>[0, 1]</math> through an [[affine function|affine]] (degree-1) change of variable. The formula is |
Interpolating <math>x</math> in an arbitrary interval <math>(x_k, x_{k+1})</math> is done by mapping the latter to <math>[0, 1]</math> through an [[affine function|affine]] (degree-1) change of variable. The formula is |
||
<math display="block">\boldsymbol{p}(x) = h_{00}(t) \boldsymbol{p}_k + h_{10}(t) (x_{k+1} - x_k)\boldsymbol{m}_k + h_{01}(t) \boldsymbol{p}_{k+1} + h_{11}(t)(x_{k+1} - x_k)\boldsymbol{m}_{k+1},</math> |
|||
where <math>t = (x - x_k)/(x_{k+1} - x_k)</math>, and <math>h</math> refers to the basis functions, defined [[#Representations|below]]. Note that the tangent values have been scaled by <math>x_{k+1} - x_k</math> compared to the equation on the unit interval. |
where <math>t = (x - x_k)/(x_{k+1} - x_k)</math>, and <math>h</math> refers to the basis functions, defined [[#Representations|below]]. Note that the tangent values have been scaled by <math>x_{k+1} - x_k</math> compared to the equation on the unit interval. |
||
===Uniqueness=== |
===Uniqueness=== |
||
The formula specified above |
The formula specified above provides the unique third-degree polynomial path between the two points with the given tangents. |
||
'''Proof.''' Let <math>P, Q</math> be two third-degree polynomials satisfying the given boundary conditions. Define <math>R = Q - P,</math> then: |
'''Proof.''' Let <math>P, Q</math> be two third-degree polynomials satisfying the given boundary conditions. Define <math>R = Q - P,</math> then: |
||
Line 43: | Line 61: | ||
: <math>R(1) = Q(1) - P(1) = 0.</math> |
: <math>R(1) = Q(1) - P(1) = 0.</math> |
||
Since both <math>Q</math> and <math>P</math> are third-degree polynomials, <math>R</math> is at most a third-degree polynomial. So <math>R</math> must be of the form |
Since both <math>Q</math> and <math>P</math> are third-degree polynomials, <math>R</math> is at most a third-degree polynomial. So <math>R</math> must be of the form |
||
<math display="block">R(x) = ax(x - 1)(x - r).</math> |
|||
Calculating the derivative gives |
Calculating the derivative gives |
||
<math display="block">R'(x) = ax(x - 1) + ax(x - r) + a(x - 1)(x - r).</math> |
|||
We know furthermore that |
We know furthermore that |
||
Line 60: | Line 78: | ||
We can write the interpolation polynomial as |
We can write the interpolation polynomial as |
||
<math display="block">\boldsymbol{p}(t) = h_{00}(t)\boldsymbol{p}_0 + h_{10}(t)(x_{k+1}-x_k)\boldsymbol{m}_0 + h_{01}(t)\boldsymbol{p}_1 + h_{11}(t)(x_{k+1}-x_k)\boldsymbol{m}_1</math> |
|||
where <math>h_{00}</math>, <math>h_{10}</math>, <math>h_{01}</math>, <math>h_{11}</math> are Hermite basis functions. |
where <math>h_{00}</math>, <math>h_{10}</math>, <math>h_{01}</math>, <math>h_{11}</math> are Hermite basis functions. |
||
These can be written in different ways, each way revealing different properties: |
These can be written in different ways, each way revealing different properties: |
||
Line 79: | Line 97: | ||
| <math>t^3 - 2t^2 + t</math> |
| <math>t^3 - 2t^2 + t</math> |
||
| <math>t (1 - t)^2</math> |
| <math>t (1 - t)^2</math> |
||
| <math>\ |
| <math>\tfrac{1}{3} B_1(t)</math> |
||
|- |
|- |
||
| <math>h_{01}(t)</math> |
| <math>h_{01}(t)</math> |
||
Line 89: | Line 107: | ||
| <math>t^3 - t^2</math> |
| <math>t^3 - t^2</math> |
||
| <math>t^2 (t - 1)</math> |
| <math>t^2 (t - 1)</math> |
||
| <math>-\ |
| <math>-\tfrac{1}{3} B_2(t)</math> |
||
|} |
|} |
||
The "expanded" column shows the representation used in the definition above. |
The "expanded" column shows the representation used in the definition above. |
||
The "factorized" column shows immediately that <math>h_{10}</math> and <math>h_{11}</math> are zero at the boundaries. |
The "factorized" column shows immediately that <math>h_{10}</math> and <math>h_{11}</math> are zero at the boundaries. |
||
You can further conclude that <math>h_{01}</math> and <math>h_{11}</math> have a [[ |
You can further conclude that <math>h_{01}</math> and <math>h_{11}</math> have a [[Multiplicity (mathematics)#Multiplicity of a zero of a function|zero of multiplicity 2]] at 0, and <math>h_{00}</math> and <math>h_{10}</math> 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 polynomial]]s of order 3: |
The "Bernstein" column shows the decomposition of the Hermite basis functions into [[Bernstein polynomial]]s of order 3: |
||
⚫ | |||
⚫ | Using this connection you can express cubic Hermite interpolation in terms of cubic [[Bézier curve]]s with respect to the four values <math display="inline">\boldsymbol{p}_0, \boldsymbol{p}_0 + \frac{1}{3} \boldsymbol{m}_0, \boldsymbol{p}_1 - \frac{1}{3} \boldsymbol{m}_1, \boldsymbol{p}_1</math> and do Hermite interpolation using the [[de Casteljau algorithm]]. |
||
⚫ | |||
⚫ | Using this connection you can express cubic Hermite interpolation in terms of cubic [[Bézier curve]]s with respect to the four values <math>\boldsymbol{p}_0, \boldsymbol{p}_0 + \frac{\boldsymbol{m}_0 |
||
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. |
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. |
||
We can also write the polynomial in standard form as |
|||
<math display="block">\boldsymbol{p}(t) = \left(2\boldsymbol{p}_0 + \boldsymbol{m}_0 - 2\boldsymbol{p}_1 + \boldsymbol{m}_1\right) t^3 + \left(-3\boldsymbol{p}_0 + 3\boldsymbol{p}_1 - 2\boldsymbol{m}_0 - \boldsymbol{m}_1\right) t^2 + \boldsymbol{m}_0 t + \boldsymbol{p}_0</math> |
|||
where the control points and tangents are coefficients. This permits efficient evaluation of the polynomial at various values of ''t'' since the constant coefficients can be computed once and reused. |
|||
==Interpolating a data set== |
==Interpolating a data set== |
||
Line 118: | Line 139: | ||
A '''cardinal spline''', sometimes called a '''canonical spline''',<ref>{{cite web |last=Petzold |first=Charles |author-link=Charles Petzold |url=http://www.charlespetzold.com/blog/2009/01/Canonical-Splines-in-WPF-and-Silverlight.html |title=Canonical Splines in WPF and Silverlight |date=2009}}</ref> is obtained<ref>{{cite web |url=http://msdn2.microsoft.com/en-us/library/ms536358.aspx |title=Cardinal Splines |website=Microsoft Developer Network |access-date=2018-05-27}}</ref> if |
A '''cardinal spline''', sometimes called a '''canonical spline''',<ref>{{cite web |last=Petzold |first=Charles |author-link=Charles Petzold |url=http://www.charlespetzold.com/blog/2009/01/Canonical-Splines-in-WPF-and-Silverlight.html |title=Canonical Splines in WPF and Silverlight |date=2009}}</ref> is obtained<ref>{{cite web |url=http://msdn2.microsoft.com/en-us/library/ms536358.aspx |title=Cardinal Splines |website=Microsoft Developer Network |access-date=2018-05-27}}</ref> if |
||
: <math>\boldsymbol{m}_k = (1 - c) \frac{\boldsymbol{p}_{k+1} - \boldsymbol{p}_{k-1}}{x_{k+1} - x_{k-1}}</math> |
: <math>\boldsymbol{m}_k = (1 - c) \frac{\boldsymbol{p}_{k+1} - \boldsymbol{p}_{k-1}}{x_{k+1} - x_{k-1}}</math> |
||
is used to calculate the tangents. The parameter {{mvar|c}} is a ''tension'' parameter that must be in the interval {{math|[0, 1]}}. In some sense, this can be interpreted as the "length" of the tangent. Choosing {{math|1=''c'' = 1}} yields all zero tangents, and choosing {{math|1=''c'' = 0 |
is used to calculate the tangents. The parameter {{mvar|c}} is a ''tension'' parameter that must be in the interval {{math|[0, 1]}}. In some sense, this can be interpreted as the "length" of the tangent. Choosing {{math|1=''c'' = 1}} yields all zero tangents, and choosing {{math|1=''c'' = 0}} yields a Catmull–Rom spline in the uniform parameterization case. |
||
=== Catmull–Rom spline === <!-- Redirect "Catmull-Rom spline" points directly to this section --> |
=== Catmull–Rom spline === <!-- Redirect "Catmull-Rom spline" points directly to this section --> |
||
Line 125: | Line 146: | ||
For tangents chosen to be |
For tangents chosen to be |
||
: <math>\boldsymbol{m}_k = |
: <math>\boldsymbol{m}_k = \frac{\boldsymbol{p}_{k+1} - \boldsymbol{p}_{k-1}}{2}</math> |
||
a '''Catmull–Rom spline''' is obtained, being a special case of a cardinal spline. This assumes uniform parameter spacing. |
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.<ref>{{citation |
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.<ref>{{citation|last1=Catmull|first1=Edwin|author1-link=Edwin Catmull|last2=Rom|first2=Raphael|author2-link=Raphael Rom|chapter=A class of local interpolating splines|editor1-first=R. E.|editor1-last=Barnhill|editor2-first=R. F.|editor2-last=Riesenfeld|title=Computer Aided Geometric Design|publisher=Academic Press|location=New York|year=1974|pages=317–326}}</ref> Two additional points are required on either end of the curve. The uniform Catmull–Rom implementation can produce loops and self-intersections. The chordal and [[centripetal Catmull–Rom spline|centripetal Catmull–Rom]] implementations<ref>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.</ref> solve this problem, but use a slightly different calculation.<ref>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.</ref> In [[computer graphics]], Catmull–Rom splines are frequently used to get smooth interpolated motion between [[key frame]]s. 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=== |
===Kochanek–Bartels spline=== |
||
Line 144: | Line 165: | ||
In addition, assume that the tangents at the endpoints are defined as the centered differences of the adjacent points: |
In addition, assume that the tangents at the endpoints are defined as the centered differences of the adjacent points: |
||
⚫ | |||
⚫ | |||
To evaluate the interpolated ''f''(''x'') for a real ''x'', first separate ''x'' into the integer portion ''n'' and fractional portion ''u'': |
To evaluate the interpolated ''f''(''x'') for a real ''x'', first separate ''x'' into the integer portion ''n'' and fractional portion ''u'': |
||
Line 157: | Line 177: | ||
Then the Catmull–Rom spline is<ref>[https://arxiv.org/abs/0905.3564 Two hierarchies of spline interpolations. Practical algorithms for multivariate higher order splines].</ref> |
Then the Catmull–Rom spline is<ref>[https://arxiv.org/abs/0905.3564 Two hierarchies of spline interpolations. Practical algorithms for multivariate higher order splines].</ref> |
||
⚫ | |||
⚫ | |||
f(x) = f(n + u) &= \text{CINT}_u(p_{n-1}, p_n, p_{n+1}, p_{n+2}) \\ |
f(x) = f(n + u) &= \text{CINT}_u(p_{n-1}, p_n, p_{n+1}, p_{n+2}) \\ |
||
&= |
&= |
||
Line 164: | Line 183: | ||
1 & u & u^2 & u^3 |
1 & u & u^2 & u^3 |
||
\end{bmatrix} |
\end{bmatrix} |
||
\cdot |
|||
\begin{bmatrix} |
\begin{bmatrix} |
||
0 & 1 & 0 & 0 \\ |
0 & 1 & 0 & 0 \\ |
||
Line 171: | Line 189: | ||
-\tfrac12 & \tfrac32 & -\tfrac32 & \tfrac12 |
-\tfrac12 & \tfrac32 & -\tfrac32 & \tfrac12 |
||
\end{bmatrix} |
\end{bmatrix} |
||
\cdot |
|||
\begin{bmatrix} |
\begin{bmatrix} |
||
p_{n-1} \\ |
p_{n-1} \\ |
||
Line 185: | Line 202: | ||
u^3 - u^2 |
u^3 - u^2 |
||
\end{bmatrix}^\mathrm{T} |
\end{bmatrix}^\mathrm{T} |
||
\cdot |
|||
\begin{bmatrix} |
\begin{bmatrix} |
||
p_{n-1} \\ |
p_{n-1} \\ |
||
Line 199: | Line 215: | ||
u^2(u - 1) |
u^2(u - 1) |
||
\end{bmatrix}^\mathrm{T} |
\end{bmatrix}^\mathrm{T} |
||
\cdot |
|||
\begin{bmatrix} |
\begin{bmatrix} |
||
p_{n-1} \\ |
p_{n-1} \\ |
||
Line 209: | Line 224: | ||
&= \tfrac12 \big((-u^3 + 2u^2 - u) p_{n-1} + (3u^3 - 5u^2 + 2) p_n + (-3u^3 + 4u^2 + u) p_{n+1} + (u^3 - u^2) p_{n+2}\big) \\ |
&= \tfrac12 \big((-u^3 + 2u^2 - u) p_{n-1} + (3u^3 - 5u^2 + 2) p_n + (-3u^3 + 4u^2 + u) p_{n+1} + (u^3 - u^2) p_{n+2}\big) \\ |
||
&= \tfrac12 \big((-p_{n-1} + 3p_n - 3p_{n+1} + p_{n+2}) u^3 + (2p_{n-1} - 5p_n + 4p_{n+1} - p_{n+2})u^2 + (-p_{n-1} + p_{n+1}) u + 2p_n\big) \\ |
&= \tfrac12 \big((-p_{n-1} + 3p_n - 3p_{n+1} + p_{n+2}) u^3 + (2p_{n-1} - 5p_n + 4p_{n+1} - p_{n+2})u^2 + (-p_{n-1} + p_{n+1}) u + 2p_n\big) \\ |
||
&= \tfrac12 \Big(\big((-p_{n-1} + 3p_n - 3p_{n+1} + p_{n+2}) u |
&= \tfrac12 \Big(\big((-p_{n-1} + 3p_n - 3p_{n+1} + p_{n+2}) u + (2p_{n-1} - 5p_n + 4p_{n+1} - p_{n+2})\big)u + (-p_{n-1} + p_{n+1})\Big)u + p_n, |
||
\end{align}</math> |
\end{align}</math> |
||
where <math>\mathrm{T}</math> denotes the [[matrix transpose]]. The bottom equality is depicting the application of [[Horner's method]]. |
where <math>\mathrm{T}</math> denotes the [[matrix transpose]]. The bottom equality is depicting the application of [[Horner's method]]. |
||
Latest revision as of 00:20, 19 April 2024
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, that is, by its values and first derivatives at the end points of the corresponding domain interval.[1]
Cubic Hermite splines are typically used for interpolation of numeric data specified at given argument values , to obtain a 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 Bezier cubic 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 polynomial splines are also used extensively in structural analysis applications, such as Euler–Bernoulli beam theory. Cubic polynomial splines have also been applied to mortality analysis[2] and mortality forecasting.[3]
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.
Interpolation on a single interval
[edit]Unit interval [0, 1]
[edit]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
[edit]Interpolating in an arbitrary interval is done by mapping the latter to through an affine (degree-1) change of variable. The formula is where , 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
[edit]The formula specified above provides the unique third-degree polynomial path between the two points with the given tangents.
Proof. Let be two third-degree polynomials satisfying the given boundary conditions. Define then:
Since both and are third-degree polynomials, is at most a third-degree polynomial. So must be of the form Calculating the derivative gives
We know furthermore that
(1) |
(2) |
Putting (1) and (2) together, we deduce that , and therefore thus
Representations
[edit]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.
We can also write the polynomial in standard form as where the control points and tangents are coefficients. This permits efficient evaluation of the polynomial at various values of t since the constant coefficients can be computed once and reused.
Interpolating a data set
[edit]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 not unique, and there are several options available.
Finite difference
[edit]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
[edit]A cardinal spline, sometimes called a canonical spline,[4] is obtained[5] if
is used to calculate the tangents. The parameter c is a tension parameter that must be in the interval [0, 1]. In some sense, this can be interpreted as the "length" of the tangent. Choosing c = 1 yields all zero tangents, and choosing c = 0 yields a Catmull–Rom spline in the uniform parameterization case.
Catmull–Rom spline
[edit]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.[7] Two additional points are required on either end of the curve. The uniform Catmull–Rom implementation can produce loops and self-intersections. The chordal and centripetal Catmull–Rom implementations[8] solve this problem, but use a slightly different calculation.[9] 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
[edit]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
[edit]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 with matched derivatives at endpoints
[edit]Consider a single coordinate of the points and as the values that a function f(x) takes at integer ordinates x = n − 1, n, n + 1 and n + 2,
In addition, assume that the tangents at the endpoints are defined as the centered differences of the adjacent points:
To evaluate the interpolated f(x) for a real x, first separate x into the integer portion n and fractional portion u:
where denotes the floor function, which returns the largest integer no larger than x.
Then the Catmull–Rom spline is[10] where denotes the matrix transpose. The bottom equality is depicting the application of Horner's method.
This writing is relevant for tricubic interpolation, where one optimization requires computing CINTu sixteen times with the same u and different p.
See also
[edit]- Bicubic interpolation, a generalization to two dimensions
- Tricubic interpolation, a generalization to three dimensions
- Hermite interpolation
- Multivariate interpolation
- Spline interpolation
- Discrete spline interpolation
References
[edit]- ^ Erwin Kreyszig (2005). Advanced Engineering Mathematics (9 ed.). Wiley. p. 816. ISBN 9780471488859.
- ^ Stephen Richards (2020). "A Hermite-spline model of post-retirement mortality". Scandinavian Actuarial Journal. Taylor and Francis: 110–127. doi:10.1080/03461238.2019.1642239.
- ^ Sixian Tang, Jackie Li and Leonie Tickle (2022). "A Hermite spline approach for modelling population mortality". Annals of Actuarial Science. Cambridge University Press: 1–42. doi:10.1017/S1748499522000173.
- ^ Petzold, Charles (2009). "Canonical Splines in WPF and Silverlight".
- ^ "Cardinal Splines". Microsoft Developer Network. Retrieved 2018-05-27.
- ^ Cubic interpolation is not unique: this model using a Catmull-Rom spline and Lagrange basis polynomials passes through all four points. Note: If the black point is left of the yellow point, the yellow horizontal distance is negative; if the black point is on the right of the green point, the green horizontal distance is negative.
- ^ Catmull, Edwin; Rom, Raphael (1974), "A class of local interpolating splines", in Barnhill, R. E.; Riesenfeld, R. F. (eds.), Computer Aided Geometric Design, New York: Academic Press, pp. 317–326
- ^ 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
[edit]- 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