Hermite Interpolation Calculator
How Hermite interpolation works in plain language
Hermite interpolation is a way to draw a smooth cubic curve when you know more than just two points. Instead of saying only where the curve starts and ends, you also tell it how steep the curve should be at each end. Those four conditions are powerful: the starting x-value and y-value, the starting slope, the ending x-value and y-value, and the ending slope determine one unique cubic polynomial. This calculator solves for that cubic and then evaluates it at any x you choose.
That makes Hermite interpolation useful when the shape of the curve matters, not merely the endpoints. Linear interpolation connects points with a straight line, which ignores local trend. A generic cubic fit can pass through data but may not respect known derivatives. Hermite interpolation sits in the middle: it honors the endpoint values and also matches the tangent direction at both ends. In motion planning, computer graphics, numerical methods, and engineering models, that extra slope information often makes the result feel much more realistic.
If you are new to the topic, it helps to picture two pins holding a flexible strip at the endpoints while your fingers set the direction of the strip at those same endpoints. Changing the pin locations moves the ends of the strip. Changing the slopes rotates the strip as it leaves each end. The curve that appears between the pins is exactly the kind of shape this calculator computes.
What each input means
The form uses standard Hermite notation. x0 and x1 are the two known x-values. At those x-values, the function values are y(x0) and y(x1). The derivative inputs y′(x0) and y′(x1) describe how steep the curve is at each endpoint. Finally, Evaluate at x is the location where you want the calculator to report the interpolated value and the derivative of the resulting cubic.
Units matter here in a specific way. The x-values can use any consistent unit such as seconds, meters, degrees, or years. The y-values can use any consistent output unit such as meters, volts, dollars, or temperature. The derivative inputs are not in the same units as y alone; they are in y-units per x-unit. For example, if x is time in seconds and y is position in meters, then the derivative inputs are meters per second. If those derivative units do not match the x and y scales, the curve will still compute, but it will describe the wrong physical or geometric behavior.
The sample values prefilled in the form are simply a worked example so you can see the calculator in action immediately. They are not recommended defaults for every problem. Replace them with your own data when you use the tool for real interpolation work.
What the calculator actually computes
Mathematically, the tool builds a cubic polynomial p(x) that satisfies four endpoint conditions:
One common way to write the interpolant is to normalize the interval with
and then use the cubic Hermite basis functions:
The JavaScript on this page solves the equivalent 4-by-4 linear system for the cubic coefficients directly. That is why the result area can show both the interpolated value and the explicit polynomial. If you want to reuse the polynomial elsewhere, the coefficient form is convenient. If you want to reason about shape, the Hermite basis form is often easier to interpret because it shows exactly how endpoint values and endpoint slopes contribute.
For completeness, the general notation below expresses the broader idea that a result depends on several inputs. Hermite interpolation is a specific, much tighter version of that idea, with four endpoint conditions determining one cubic.
Worked example with the sample values
The example values in the form use x0 = 0, y(x0) = 1, y′(x0) = 0, x1 = 2, y(x1) = 3, and y′(x1) = 1. With those conditions, the unique cubic is:
If you evaluate that cubic at x = 1, the interpolated value is 1.75. The derivative at x = 1 is 1.25. This example is a good quick check because the left endpoint is flat, the right endpoint is rising, and the midpoint lands between the two y-values as you would expect from a smooth increasing curve.
Notice what happens conceptually. The endpoints force the curve through two fixed positions. The derivative at the left endpoint prevents the curve from rising immediately, while the positive derivative at the right endpoint ensures the curve is climbing as it reaches the second point. If you keep the same endpoints but change the slopes, the interpolated midpoint can move noticeably even though the endpoints never change. That sensitivity to endpoint slope is the core reason Hermite interpolation is different from ordinary two-point interpolation.
How slope choices change the shape
The table below keeps the same endpoints as the worked example and changes only the endpoint derivatives. The midpoint value is shown at x = 1, halfway between x0 = 0 and x1 = 2. This is not a separate algorithm; it is the same Hermite interpolation idea with different tangents.
| Slope pair | Midpoint value at x = 1 | Shape interpretation |
|---|---|---|
| m0 = 0, m1 = 1 | 1.75 | Baseline example with a gentle rise that becomes steeper toward the right endpoint. |
| m0 = 2, m1 = 1 | 2.25 | A stronger upward launch at the left endpoint lifts the middle of the curve. |
| m0 = -1, m1 = 2 | 1.25 | The curve initially dips or flattens before turning up sharply near the right endpoint. |
This sensitivity table is useful when you are estimating derivatives rather than measuring them exactly. If small changes in the endpoint slopes produce large movement in the interior value you care about, then the interpolation is telling you that derivative uncertainty matters and should be reported alongside the final number.
How to interpret the result panel
After you click Interpolate, the result box shows three pieces of information. The first is the interpolated function value at your chosen x. The second is the derivative of the cubic at that same x, which is often just as useful as the function value when you care about trend, velocity, or growth rate. The third is the cubic polynomial itself in coefficient form, so you can inspect or reuse the exact interpolant.
A result inside the interval from x0 to x1 is interpolation. A result outside that interval is extrapolation. The calculator allows both because the same cubic is defined everywhere, but extrapolated values deserve more caution: cubic curves can bend quickly beyond the data range, especially when the endpoint slopes are large. If the result looks surprisingly high or low, first check whether your evaluation point lies outside the interval, and then verify that the derivative units match your x and y units.
A good sanity check is simple. Ask whether the reported cubic exactly matches both endpoint values and both endpoint slopes. Then ask whether a small increase in one derivative should make the curve leave that endpoint more steeply. If the answer is yes and the output behaves that way, the model is probably being used correctly.
Assumptions and practical limitations
This calculator assumes that one cubic polynomial is the right local model between the two endpoints you provide. That is often a sensible assumption for a short interval, but it is not a promise that the real process is globally cubic. If your data are noisy, if the interval is very wide, or if the underlying function has sharp corners or discontinuities, Hermite interpolation may produce a smooth curve that looks elegant but does not reflect the true phenomenon.
Another important assumption is that your endpoint derivatives are meaningful. In some problems they come from measurement, from a differential equation, or from a reliable slope estimate. In other problems they are guessed. A guessed derivative can still be useful, but you should treat the result as shape-controlled modeling rather than hard evidence. When in doubt, run the calculator with a low and high derivative estimate and compare the outputs.
Finally, remember that x0 and x1 must differ. If they are the same, there is no interval to interpolate across, and the system for the cubic becomes invalid. The page checks for that case automatically. The safest workflow is to enter your endpoints, confirm the derivative units, evaluate at one or two interior points, and then vary the slopes slightly to understand how stable the interior result is.
Optional mini-game: Tangent Tuner
This short arcade challenge turns Hermite interpolation into a hands-on puzzle. Two anchor points stay fixed, and your job is to tune the left and right endpoint slopes so the glowing tracer rides your cubic through every gate. Each gate sits on a hidden Hermite curve, so winning means you are learning the same idea the calculator uses: endpoint values fix the ends, while endpoint derivatives control the shape in the middle.
0
75.0s
0
0
0
