Hermite Interpolation
Hermite Interpolation is a method of interpolating data points that accounts for not only the values of the function but also the values of its derivatives. While standard linear or polynomial interpolation only ensures the curve passes through the points . Hermite interpolation ensures the curve matches the "slope"(tangent) at those points as well. This results in a much smoother and more physically realistic transition between points, particularly in motion planning or structural deflection models where velocity or tangency must be continuous.
1. The Cubic Hermite Spline
The most common form is the Cubic Hermite Spline. For a single interval between and the interpolant is a third-degree polynomial.To construct it, we need four pieces of information: The starting and ending values: and The starting and ending derivatives (slopes): and
The resulting curve is expressed using Hermite Basis Functions, which act as weights for the coordinates and the slopes.
Example 1C#

2. Implementation in SepalSolver
In SepalSolver, Hermite interpolation is often used when the user provides a "slope vector" alongside their dataset. This is common in trajectory generation where you know where a robot should be and how fast it should be moving at that specific moment.
Example 2C#
Smooth transition value: 5
Examples
.. Admonition:: Example 1 : Compare Linear and Hermite interpolation for sparsely compited sin(x)
If sin(x) is give at 7 points between and . Interpolate for sin(x) for 100 points between and using linear and hermite spline and compare the plots.
Example 3C#

.. Admonition:: Example 2 :
If a robot moves from point A to point B, a linear path causes an abrupt change in velocity at the corners. By using Hermite interpolation and specifying the desired entry/exit velocity vectors, we create a path that the robot can follow without stopping or jerking.
Example 4C#
Key Difference: Hermite vs. Cubic Spline
| Feature | Hermite Interpolation | Cubic Spline | |
|---|---|---|---|
| Input Requirements | Requires and (slopes) | Requires only | |
| Local Control | Changing one slope only affects the two adjacent segments | Changing one point can affect the entire curve | |
| Complexity | Mathematically simpler (local calculation) | Requires solving a system of equations (global) |
Exercise: Animation of Slope Impact
Task: Observe how changing the slope at the first point affects the plot of the function.
Example 5C#
</example 4>
.. Admonition:: Example 5 : Using Hermite Spline as Sin Approximator
Lets use table of Sine and Cosine at 15 degrees interval given in table
| Angle (°) | Sine () | Cosine () |
|---|---|---|
| 0° | ||
| 15° | ||
| 30° | ||
| 45° | ||
| 60° | ||
| 75° | ||
| 90° |
Example 6C#
Angle | Sineapprox | Sine ---------+--------------+------------- 38.66 | 0.624755 | 0.624762 31.20 | 0.517998 | 0.517998 74.74 | 0.964735 | 0.964735 35.07 | 0.574501 | 0.574507 35.91 | 0.586494 | 0.586500 74.93 | 0.965631 | 0.965631 71.45 | 0.948014 | 0.948020 81.84 | 0.989870 | 0.989882 13.01 | 0.225130 | 0.225131 49.30 | 0.758148 | 0.758155 64.10 | 0.899534 | 0.899541 42.08 | 0.670135 | 0.670138 35.39 | 0.579114 | 0.579120 50.41 | 0.770582 | 0.770590 73.23 | 0.957489 | 0.957491 57.68 | 0.845030 | 0.845033 67.52 | 0.924027 | 0.924039 65.86 | 0.912567 | 0.912577 89.95 | 1.000000 | 1.000000 26.69 | 0.449116 | 0.449119