Splines

Quadratic Bezier

$$B(t)=(1-t)^2P_0 + 2t(1-t)P_1 + t^2P_2$$

Cubic Bezier

$$\begin{align} &\text{factored } B(t) = (1-t)^3P_0 + 3t(1-t)^2P_1 + 3t^2(1 - t) P_2 + t^3 P_3 \\ &\text{expanded } B(t) = (-t^3 + 3t^2 - 3t + 1)P_0 + (3t^3 - 6t^2 + 3t)P_1 + (-3t^3 + 3t^2)P_2 + t^3 P_3 \end{align}$$ $$P = \begin{bmatrix} t^3 & t^2 & t & 1\end{bmatrix} \begin{bmatrix} -1 & 3 & -3 & 1 \\ 3 & -6 & 3 & 0 \\ -3 & 3 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ \end{bmatrix} \begin{bmatrix} P_0 \\ P_1 \\ P_2 \\ P_3 \end{bmatrix}$$

Cubic Hermite

Note order. Some references use \(P_0, m_0, P1, m_1\) while other use \(P_0, P_1, m_0, m_1\) $$P = (2t^3 - 3t^2+1)p_0 + (t^3-2t^2+t)m_0 + (-2t^3+3t^2)p_1 + (t^3-t^2)m_1$$ $$P = \begin{bmatrix} t^3 & t^2 & t & 1\end{bmatrix} \begin{bmatrix} 2 & 3 & -2 & 1 \\ -3 & -2 & 3 & -1 \\ 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ \end{bmatrix} \begin{bmatrix} P_0 \\ m_0 \\ P_1 \\ m_1 \end{bmatrix}$$

Cubic Hermite Interpolation

$$ t = \frac{x-x_k}{x_{k+1}-x_k} $$ $$\begin{align} &h_{00} = \ 2t^3-3t^2+1 \\ &h_{10} = \ \ t^3-2t^2+t \\ &h_{01} = -2t^3+3t^2 \\ &h_{11} = \ t^3-t^2 \end{align}$$ $$f(x) = h_{00}(t) y_k + h_{10}(t)(x_{k+1} - x_k)m_k + h_{01}(t) y_{k+1} + h_{11}(t)(x_{k+1}-x_k)m_{k+1}$$