Hermite Spline 04/26/2026 Why Splines A single high-degree polynomial that passes through many points tends to wiggle uncontrollably between them (Runge's phenomenon). The fix is to break the curve into short pieces and stitch them together so the joints look smooth. Each piece is a low-degree polynomial — usually cubic. The collection is called a spline. The cubic Hermite spline is the simplest member of this family that lets you specify both endpoint positions and endpoint tangents directly. Each segment is defined by just four pieces of information: the two endpoints, and the tangent vectors at those endpoints. "Where you start, where you end, and how fast you leave / arrive (in the parameter \(u\), not in arc length)" is enough to pin down a unique cubic. Definition A Hermite segment uses four control elements: two endpoints \(P(0), P(1)\) and two tangent vectors \(P'(0), P'(1)\). The segment itself is a cubic polynomial in a parameter \(u \in [0, 1]\): \[ P(u) = a u^3 + b u^2 + c u + d \] The four unknown coefficient vectors \(a, b, c, d\) are uniquely determined by the four control elements. Visually, the endpoints fix where the curve passes, and the tangent vectors fix which way and how strongly it leaves and arrives. Two Hermite segments sharing the same endpoint locations but driven by different tangent vectors. The endpoints fix where the curve goes; the tangents fix the entry/exit direction and speed. Holding the endpoints fixed and only varying the tangent vectors already gives a rich family of shapes. A longer tangent means the curve "lingers" longer in that direction before turning toward the other endpoint. Same endpoints, four different tangent configurations. Top-left: short tangents in the natural direction. Top-right: long tangents both horizontal — the curve "lingers" before turning. Bottom-left: tangent at \(p_1\) reversed — the curve overshoots and returns. Bottom-right: tangents perpendicular and opposite — the curve arches above and descends into \(p_1\). Continuity at Joints When two segments meet, the joint can be smooth or kinked. "How smooth" is captured by two related but different notions: geometric continuity \(G^n\) and parametric continuity \(C^n\). Geometric continuity \(G^n\) depends only on the shape at the joint and is invariant under any orientation-preserving regular reparameterization (one whose derivative stays positive). \(G^0\): the two segments share the joint point — they touch. \(G^1\): in addition to \(G^0\), their tangent directions agree at the joint. The magnitudes are allowed to differ. \(G^n\): the two segments can be reparameterized so that all derivatives up to order \(n\) agree at the joint. Equivalently, the geometric invariants line up — tangent direction for \(G^1\), curvature (including its center) for \(G^2\), torsion for \(G^3\). For \(n \geq 2\) this is stronger than just "\(n\)-th derivative directions match"; \(G^2\) demands a common center of curvature, not merely parallel second derivatives. Parametric continuity \(C^n\) is the stricter version: at the joint the \(n\)-th derivatives must be equal as vectors (same direction and same magnitude). Concretely, \(C^1\) requires the tangent vectors \(P'(u)\) on both sides to be equal — which simultaneously pins down direction and parametric speed \(|P'(u)|\). Higher \(C^n\) extends this to equality of all derivatives up to order \(n\). At regular points (where \(P'(u) \neq 0\)), \(C^n\) implies \(G^n\), but not the other way around. Two segments can share a smooth-looking tangent direction (\(G^1\)) while their parameter speeds differ (not \(C^1\)). The implication can fail at stationary points where \(P'(u) = 0\): the canonical example is \(\alpha(t) = (t^2, t^3)\), which is \(C^\infty\) in \(t\) but has a geometric cusp at the origin. The diagram below makes the staircase concrete. Top row: geometric continuity — increasing visual smoothness. Bottom row: at the joint, only the direction must match for \(G^1\), whereas \(C^1\) demands the full tangent vector. Top: geometric continuity from \(G^0\) (touching only) through \(G^1\) (tangent direction matches) to \(G^2\) (curvature also matches). Bottom: \(G^1\) only requires matching tangent directions; \(C^1\) requires the full tangent vectors to be equal. Why Hermite splines make this easy: each segment directly exposes its endpoint tangents \(P'(0), P'(1)\) as control elements. To enforce \(C^1\) at a joint between segment \(i\) and \(i+1\), set \(P'_i(1) = P'_{i+1}(0)\). To enforce only \(G^1\), require \(P'_{i+1}(0) = \alpha\, P'_i(1)\) for some scalar \(\alpha > 0\). Generation: from Control Elements to \(P(u)\) A cubic curve has four unknown coefficient vectors: \[ P(u) = a u^3 + b u^2 + c u + d, \qquad P'(u) = 3 a u^2 + 2 b u + c \] Plugging in \(u = 0\) and \(u = 1\) gives four equations: \[ \begin{aligned} P(0) &= d \\ P(1) &= a + b + c + d \\ P'(0) &= c \\ P'(1) &= 3a + 2b + c \end{aligned} \] Solving for \(a, b, c, d\) and substituting back yields the Hermite form: \[ \,\\ P(u) = (2u^3 - 3u^2 + 1)\,P(0) + (-2u^3 + 3u^2)\,P(1) + (u^3 - 2u^2 + u)\,P'(0) + (u^3 - u^2)\,P'(1) \,\\ \] The four polynomials in front of the control elements are the Hermite blending functions. The position pair is a partition of unity — \(h_{00}(u) + h_{01}(u) = 1\) — so when both tangents are zero the curve stays in the affine hull of \(P(0), P(1)\) (a straight line segment between them). The tangent pair \(h_{10}, h_{11}\) are vector weights, not affine weights; they can be negative and they don't sum to anything special. Notice two structural properties that come straight from the interpolation conditions \(h_{ij}(0)\) and \(h_{ij}(1)\): At \(u = 0\): \(h_{00} = 1\), all others = 0. So \(P(0) = P(0)\). At \(u = 1\): \(h_{01} = 1\), all others = 0. So \(P(1) = P(1)\). The tangent blends \(h_{10}, h_{11}\) vanish at both endpoints, so changing tangent magnitudes only bends the curve in the middle — it never moves the endpoints. Worked Example Take the four control elements from the lecture: \[ P(0) = \begin{bmatrix} 1 \\ 1 \end{bmatrix},\; P(1) = \begin{bmatrix} 5 \\ 3 \end{bmatrix},\; P'(0) = \begin{bmatrix} 3 \\ 0 \end{bmatrix},\; P'(1) = \begin{bmatrix} 6 \\ -3 \end{bmatrix} \] Substituting into the Hermite form: \[ \begin{aligned} P(u) &= \begin{bmatrix} 1 \\ 1 \end{bmatrix}(2u^3 - 3u^2 + 1) + \begin{bmatrix} 5 \\ 3 \end{bmatrix}(-2u^3 + 3u^2) \\ &\quad + \begin{bmatrix} 3 \\ 0 \end{bmatrix}(u^3 - 2u^2 + u) + \begin{bmatrix} 6 \\ -3 \end{bmatrix}(u^3 - u^2) \\ &= \begin{bmatrix} u^3 + 3u + 1 \\ -7u^3 + 9u^2 + 1 \end{bmatrix} \end{aligned} \] Sanity-check the boundary values: \(P(0) = (1, 1)\), \(P(1) = (1+3+1,\; -7+9+1) = (5, 3)\). Both endpoints land. Differentiating: \(P'(u) = (3u^2 + 3,\; -21u^2 + 18u)\), so \(P'(0) = (3, 0)\) and \(P'(1) = (6, -3)\). Both tangents land. Sampling \(P(u)\) at \(u = 0, 0.1, 0.2, \dots, 1\) produces the curve drawn below. The dashed arrows are the prescribed tangents at the two endpoints. The Hermite curve generated from \(P(0) = (1,1)\), \(P(1) = (5,3)\), \(P'(0) = (3,0)\), \(P'(1) = (6,-3)\). It leaves \(P(0)\) horizontally (the start tangent has zero \(y\) component), rises past \(P(1)\), and arrives at \(P(1)\) heading down-right. Matrix Form Writing the cubic as \(P(u) = [a\;b\;c\;d]\,U\) with \(U = [u^3, u^2, u, 1]^T\) and stacking the four boundary conditions in matrix form, we get: \[ [P(0)\;\; P(1)\;\; P'(0)\;\; P'(1)] = [a\;b\;c\;d] \begin{bmatrix} 0 & 1 & 0 & 3 \\ 0 & 1 & 0 & 2 \\ 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 0 \end{bmatrix} \] Inverting that matrix gives the Hermite basis matrix \(M_H\): \[ M_H = \begin{bmatrix} \phantom{-}2 & -3 & \phantom{-}0 & \phantom{-}1 \\ -2 & \phantom{-}3 & \phantom{-}0 & \phantom{-}0 \\ \phantom{-}1 & -2 & \phantom{-}1 & \phantom{-}0 \\ \phantom{-}1 & -1 & \phantom{-}0 & \phantom{-}0 \end{bmatrix} \] and the curve becomes a clean sandwich: \[ \,\\ P(u) = \underbrace{[\,P(0)\;\; P(1)\;\; P'(0)\;\; P'(1)\,]}_{\text{control}} \cdot \underbrace{M_H}_{\text{basis}} \cdot \underbrace{\begin{bmatrix} u^3 \\ u^2 \\ u \\ 1 \end{bmatrix}}_{\text{parameter}} \,\\ \] Each row of \(M_H \cdot U\) is exactly one of the four blending functions: \[ M_H \begin{bmatrix} u^3 \\ u^2 \\ u \\ 1 \end{bmatrix} = \begin{bmatrix} 2u^3 - 3u^2 + 1 \\ -2u^3 + 3u^2 \\ u^3 - 2u^2 + u \\ u^3 - u^2 \end{bmatrix} \] The same factorization (control · basis · parameter) shows up per-segment for Bézier curves and for uniform B-spline segments — same shape, different basis matrix. (General non-uniform B-splines are evaluated by the Cox–de Boor recursion rather than one global matrix, but each cubic segment can still be put in this form.) Once you internalize the shape, switching between these families becomes "swap the basis matrix and keep the rest."