Cubic Hermite Interpolation
Shape a cubic with two endpoint values and slopes and inspect how its four Hermite basis functions combine.
By Riano · Published · Updated · Report a correction
Cubic Hermite Interpolation
Concept Overview
Cubic Hermite interpolation is a method to construct a continuous curve given its values and derivatives (slopes) at its endpoints. Instead of fitting a generic polynomial to data points, it ensures both position and tangent direction match specific constraints. We construct this unique cubic function on the normalized unit interval [0, 1] using four basis functions.
Worked Example
Consider a straight line from y0 = 0 to y1 = 1 with matching slopes m0 = 1 and m1 = 1. Let's find the value and derivative at the probe point x = 0.25.
The four cubic Hermite basis functions are:
- h00(t) = 2t3 - 3t2 + 1
- h10(t) = t3 - 2t2 + t
- h01(t) = -2t3 + 3t2
- h11(t) = t3 - t2
Evaluating them at t = 0.25:
h00(0.25) = 2(0.25)3 - 3(0.25)2 + 1 = 2(0.015625) - 3(0.0625) + 1 = 0.84375 h10(0.25) = (0.25)3 - 2(0.25)2 + 0.25 = 0.015625 - 0.125 + 0.25 = 0.140625 h01(0.25) = -2(0.25)3 + 3(0.25)2 = -0.03125 + 0.1875 = 0.15625 h11(0.25) = (0.25)3 - (0.25)2 = 0.015625 - 0.0625 = -0.046875
The value of the cubic curve at t = 0.25 is given by:
Value = h00(0.25)y0 + h10(0.25)m0 + h01(0.25)y1 + h11(0.25)m1 = (0.84375)(0) + (0.140625)(1) + (0.15625)(1) + (-0.046875)(1) = 0 + 0.140625 + 0.15625 - 0.046875 = 0.25
The derivatives of the basis functions are:
- h00'(t) = 6t2 - 6t
- h10'(t) = 3t2 - 4t + 1
- h01'(t) = -6t2 + 6t
- h11'(t) = 3t2 - 2t
Evaluating the derivatives at t = 0.25:
h00'(0.25) = 6(0.25)2 - 6(0.25) = 0.375 - 1.5 = -1.125 h10'(0.25) = 3(0.25)2 - 4(0.25) + 1 = 0.1875 - 1 + 1 = 0.1875 h01'(0.25) = -6(0.25)2 + 6(0.25) = -0.375 + 1.5 = 1.125 h11'(0.25) = 3(0.25)2 - 2(0.25) = 0.1875 - 0.5 = -0.3125
The derivative of the curve at t = 0.25 is given by:
Derivative = h00'(0.25)y0 + h10'(0.25)m0 + h01'(0.25)y1 + h11'(0.25)m1 = (-1.125)(0) + (0.1875)(1) + (1.125)(1) + (-0.3125)(1) = 0 + 0.1875 + 1.125 - 0.3125 = 1
Interactive Experiment
You can test the same values in the interactive module using these steps:
- Open the Cubic Hermite Interpolation module.
- Set the Left value y0 to 0.
- Set the Right value y1 to 1.
- Set the Left slope m0 to 1.
- Set the Right slope m1 to 1.
- Set the Probe x to 0.25.
- Observe that the value is exactly 0.25, and the derivative is exactly 1. Note the individual basis contributions matching our calculations.
Limitations
The formulation used in this module relies on the normalized interval [0, 1]. In practical scenarios (like animation keyframing or geometric modeling), control points may be spaced unevenly in time or space. Applying Hermite interpolation to arbitrary intervals requires scaling the derivatives by the length of the interval, which this simplified representation abstracts away. Additionally, cubic polynomials can exhibit overshoot or oscillation when endpoint constraints force extreme slopes relative to the values.
References
The following reference material was used to verify the mathematical formulations:
- Cornell CS5620 Lecture Slides: Modeling (Pages 4-5) - Hermite endpoint value and derivative conditions, along with the definition of the four basis functions.
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Cubic Hermite Interpolation module.
Try Cubic Hermite Interpolation on Riano →