Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cubic Hermite spline
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Interpolation on a single 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.]] 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]. ===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 <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. ===Uniqueness=== 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: : <math>R(0) = Q(0)-P(0) = 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 <math display="block">R(x) = ax(x - 1)(x - r).</math> 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 : <math>R'(0) = Q'(0) - P'(0) = 0,</math> {{NumBlk|:|<math>R'(0) = 0 = ar,</math>|{{EquationRef|1}}}} : <math>R'(1) = Q'(1) - P'(1) = 0,</math> {{NumBlk|:|<math>R'(1) = 0 = a(1 - r).</math>|{{EquationRef|2}}}} Putting ({{EquationNote|1}}) and ({{EquationNote|2}}) together, we deduce that <math>a = 0</math>, and therefore <math>R = 0,</math> thus <math>P = Q.</math> ===Representations=== We can write the interpolation polynomial on the unit interval (for an arbitrary interval see the rescaled version [[#Interpolation_on_an_arbitrary_interval|above]]) as <math display="block">\boldsymbol{p}(t) = h_{00}(t)\boldsymbol{p}_0 + h_{10}(t)\boldsymbol{m}_0 + h_{01}(t)\boldsymbol{p}_1 + h_{11}(t)\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. These can be written in different ways, each way revealing different properties: {| class="wikitable" |- ! ! expanded ! factorized ! Bernstein |- | <math>h_{00}(t)</math> | <math>2t^3 - 3t^2 + 1</math> | <math>(1 + 2t)(1 - t)^2</math> | <math>B_0(t) + B_1(t)</math> |- | <math>h_{10}(t)</math> | <math>t^3 - 2t^2 + t</math> | <math>t (1 - t)^2</math> | <math>\tfrac{1}{3} B_1(t)</math> |- | <math>h_{01}(t)</math> | <math>-2t^3 + 3t^2</math> | <math>t^2 (3 - 2t)</math> | <math>B_3(t) + B_2(t)</math> |- | <math>h_{11}(t)</math> | <math>t^3 - t^2</math> | <math>t^2 (t - 1)</math> | <math>-\tfrac{1}{3} B_2(t)</math> |} 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. 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: <math display="block">B_k(t) = \binom{3}{k} \cdot t^k \cdot (1 - t)^{3-k}.</math> 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]]. 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)