[Math] Cubic Hermite spline Derivative

hermite-polynomialsspline

I’m using the cubic Hermite spline to interpolate the position of a body as a function of time, here’s the formula:
https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Interpolation_on_an_arbitrary_interval

I know the exact derivatives $m_k$ and $m_{k+1}$.

I need to calculate also the speed, so I use the derivative of $h_{00}, h_{10}, h_{01}, h_{11}$:

$h_{00}’ = (x – 1) \cdot 6 x$
$h_{10}’ = 6 x – 6 x^2$
$h_{01}’ = 3 x^2 – 4 x + 1$
$h_{11}’ = 3 x^2 – 2 x$

but it seems that I don’t know how to combine them to obtain the correct solution. Please, could anyone write the correct formula for the speed?

Best Answer

I assume your body is moving on a 2D plane or in 3D space. If so, then, to describe its position as a function of time, you need to use parametric curves, where $x$, $y$ and $z$ are functions of time, t. Then, if $\mathbf{p}(t) = \bigl(x(t),y(t),z(t)\bigr)$, we have \begin{align*} \mathbf{p}(t) &= h_{00}(t)\mathbf{p}_0 + h_{10}(t)\mathbf{m}_0 + h_{01}(t)\mathbf{p}_1 + h_{11}(t)\mathbf{m}_1 \\ &= (2t^3-3t^2+1)\mathbf{p}_0 + (t^3-2t^2+t)\mathbf{m}_0 + (3t^2-2t^3)\mathbf{p}_1 + (t^3-t^2)\mathbf{m}_1 \end{align*} where $\mathbf{p}_0$ and $\mathbf{p}_1$ are 3D points, and $\mathbf{m}_0$ and $\mathbf{m}_1$ are 3D first derivative vectors.

Then we have \begin{align*} \mathbf{p}'(t) &= h_{00}'(t)\mathbf{p}_0 + h_{10}'(t)\mathbf{m}_0 + h_{01}'(t)\mathbf{p}_1 + h_{11}'(t)\mathbf{m}_1 \\ &= (6t^2-6t)\mathbf{p}_0 + (3t^2-4t+1)\mathbf{m}_0 + (6t-6t^2)\mathbf{p}_1 + (3t^2-2t)\mathbf{m}_1 \end{align*}

You seem to be thinking of $y$ as a function of $x$, and that's not going to work in your situation.