Freya Holmér Shows C2 Continuity Destroys Bézier Spline Control

The Continuity of Splines — Freya Holmér

Freya Holmér

Enforcing second-derivative acceleration continuity across cubic Bézier splines triggers a cascading lock that destroys local control, forcing 3D graphics and CAD pipelines to abandon direct point interpolation in favor of B-splines.

AI-assisted summary of The Continuity of Splines — original source. Check the original for full context.

Source published:

Key ideas

  • Parametric continuity ($C^n$) enforces derivative matching across knots, but attempting to enforce $C^2$ acceleration continuity across a cubic Bézier spline creates an unwieldy cascading lock that destroys local control. (20:25)
  • Geometric continuity ($G^n$) evaluates curve shape independently of parameterization speed, making $G^2$ curvature continuity essential in CAD and automotive design to prevent visible cracks in specular reflections. (27:46)
  • Different cubic spline families represent different tradeoffs in control point transformation: Bézier offers explicit handle manipulation, Hermite sets boundary velocities, Catmull-Rom provides smooth point interpolation at $C^1$, and B-splines achieve $C^2$ smoothness at the expense of interpolating control points. (57:37)
  • Any isolated uniform cubic segment can be identically parameterized as a Bézier, Hermite, Catmull-Rom, B-spline, or projectile trajectory; a spline is defined not by an individual segment, but by its continuity contract across joins. (56:35)

Detailed notes

## Background Published on YouTube by educator and tool developer Freya Holmér on December 7, 2022, this video serves as an exhaustive, visually driven deep dive into the mathematical nature and practical implementation of splines. As detailed in the description, the project expanded far beyond its original scope into a year-long research endeavor built in Unity using her vector rendering library Shapes and math library Mathfs, presenting a comprehensive guide despite the severe personal burnout experienced during production.

## TL;DR Holmér deconstructs how smooth curves and piecewise splines are formulated, starting with iterative linear interpolation and the mathematical structures of cubic Bézier curves. She unpacks the critical hierarchy of continuity, distinguishing parametric continuity ($C^0$ through $C^3$) from geometric continuity ($G^1$ and $G^2$) while illustrating why $C^2$ continuity cannot be achieved on cubic Bézier splines without causing an unmanageable cascading loss of local control. Venturing into alternative spline formulations, the lesson systematically evaluates Hermite, Cardinal, Catmull-Rom, and uniform cubic B-splines by deriving their characteristic matrices and analyzing basis functions to resolve trade-offs between point interpolation and derivative smoothness.

## Atmosphere & style The presentation strikes an engaging balance between meticulous academic precision and intimate, witty warmth, elevated by polished custom real-time visual tools that make abstract linear algebra and calculus intuitively legible. Holmér's delivery is deeply enthusiastic yet candid, openly sharing the grueling labor behind the project, venting playfully when mathematical constraints 'yeet' control points off into nowhere, and admitting the burnout that stalled production. Watching the video feels like sitting through a masterclass taught by a brilliantly inventive developer who treats every curve derivative with rigorous respect while remaining delightfully unpretentious.

## Bulletin - [20:25](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1225s) Parametric continuity ($C^n$) enforces derivative matching across knots, but attempting to enforce $C^2$ acceleration continuity across a cubic Bézier spline creates an unwieldy cascading lock that destroys local control. - [27:46](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1666s) Geometric continuity ($G^n$) evaluates curve shape independently of parameterization speed, making $G^2$ curvature continuity essential in CAD and automotive design to prevent visible cracks in specular reflections. - [57:37](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3457s) Different cubic spline families represent different tradeoffs in control point transformation: Bézier offers explicit handle manipulation, Hermite sets boundary velocities, Catmull-Rom provides smooth point interpolation at $C^1$, and B-splines achieve $C^2$ smoothness at the expense of interpolating control points. - [56:35](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3395s) Any isolated uniform cubic segment can be identically parameterized as a Bézier, Hermite, Catmull-Rom, B-spline, or projectile trajectory; a spline is defined not by an individual segment, but by its continuity contract across joins.

## Key takeaways - [01:17](https://www.youtube.com/watch?v=jvPPXbo87ds&t=77s) Mathematical paths and splines underpin diverse computational systems, including game traversal mechanics, UI animations, skeletal rigs, and vector typography. - [03:54](https://www.youtube.com/watch?v=jvPPXbo87ds&t=234s) A cubic Bézier curve evaluates four control points via nested linear interpolations using De Casteljau's algorithm, Bernstein polynomials, or power basis matrices. - [07:41](https://www.youtube.com/watch?v=jvPPXbo87ds&t=461s) High-degree Bézier curves suffer from a total lack of local control and severe numerical instability because their basis polynomials exert global influence across the entire curve. - [12:11](https://www.youtube.com/watch?v=jvPPXbo87ds&t=731s) Cubic Bézier splines restore local control by chaining cubic segments end-to-end, isolating interior control point adjustments to individual segments. - [15:28](https://www.youtube.com/watch?v=jvPPXbo87ds&t=928s) $C^0$ continuity requires curve endpoints to meet at the exact same spatial coordinates, establishing positional connection without derivative guarantees. - [17:32](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1052s) $C^1$ velocity continuity requires mirrored tangent handles to equalize velocity vectors across joins, eliminating speed jumps at the cost of one degree of freedom per boundary. - [20:25](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1225s) Enforcing $C^2$ continuity on a cubic Bézier spline locks downstream control points in a cascading chain reaction, demonstrating that cubic Béziers cannot maintain both $C^2$ continuity and local control. - [23:46](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1426s) Achieving $C^3$ continuity locks all degrees of freedom in adjacent segments, causing the piecewise spline to collapse into a single global $C^\infty$ polynomial. - [26:50](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1610s) Geometric continuity ($G^n$) evaluates smoothness purely based on curve shape rather than parameter speed, making $G^1$ correspond to matched unit tangents. - [27:46](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1666s) Tangent alignment alone ($G^1$) fails the reflection test on 3D surfaces; $G^2$ curvature continuity, defined via the osculating circle, is required to prevent reflection seams. - [38:06](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2286s) The rule that parametric continuity ($C^n$) implies geometric continuity ($G^n$) holds only for regular curves; if velocity drops to zero, a curve can form a sharp geometric cusp while remaining parametrically continuous. - [39:25](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2365s) Hermite splines define segments by boundary positions and velocities, guaranteeing $C^1$ continuity while allowing straightforward mathematical conversion to Bézier handles. - [44:09](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2649s) Linear splines are limited to $C^0$ continuity but possess unique superpowers, including trivial arc-length parameterization for constant-speed traversal. - [48:20](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2900s) Catmull-Rom splines derive automatic tangents from neighboring points, providing an intuitive $C^1$ interpolating spline well-suited for camera paths and waypoints. - [53:15](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3195s) Uniform cubic B-splines achieve $C^2$ acceleration continuity while preserving local control, but sacrifice direct interpolation of their control points. - [57:37](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3457s) A single isolated curve is not inherently a spline; splines represent transformations of control points governed by continuity contracts across segments. - [01:01:35](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3695s) Non-uniform knot spacing prevents unwanted cusps and loops in Catmull-Rom splines, while NURBS introduce control point weights to represent exact conic sections.

## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=jvPPXbo87ds&t=0s) The Question of Smoothness

Freya Holmér opens with an innocent-sounding problem that consumed an entire year of her life: “How do you define a smooth path?” While paths have been an essential tool throughout human history—and are ubiquitous in fields like game development—the concepts beneath them turn out to be unexpectedly intricate. What does it actually mean for something to be a "path," and what rigorous mathematical meaning do we assign to the word "smooth"?

Exploring these questions led her down a grueling research path involving stacks of academic papers, pages of handwritten notes, and uncovering errors across numerous established online resources. The sheer scale and difficulty of the subject pushed her to burnout, but reaching the end of that journey allowed her to synthesize this deep dive into the continuity of splines.

[01:17](https://www.youtube.com/watch?v=jvPPXbo87ds&t=77s) Examples of Paths in the Digital World

Paths appear across almost every domain of software and digital graphics, often disguising themselves under different terminology: - Conveyor belts winding through factories in games like *Satisfactory*. - Rollercoasters, which require a path that governs not only 3D position over time, but orientation and rotation as well. - 2D character and UI animations that move elements fluidly across a screen. - Skeletal animation systems in game engines, where distinct animation curves govern the transformation of every single joint in a character's rig. - Modern web typography, where every glyph in every font on screen is defined via vector path outlines. - Art application features like gradient maps, which function as mathematical paths taking a single input of luminosity and outputting coordinates within a multidimensional color space.

Though drawn from wildly divergent software domains, every single one of these systems relies on the same core mathematical construct: they are all splines.

[02:16](https://www.youtube.com/watch?v=jvPPXbo87ds&t=136s) Lerp and Quadratic Bézier Curves

The simplest path between two points is a straight line segment. To find intermediate locations along that segment, one performs a linear interpolation—commonly abbreviated as *lerp*. The lerp function takes a scalar parameter, the percentage $t \in [0, 1]$, where $t = 0$ corresponds strictly to the start point and $t = 1$ to the endpoint.

```mermaid flowchart LR accTitle: Linear Interpolation Flow accDescr: Linear interpolation blends two points using parameter t to yield a straight segment. P0["Point P₀"] -->|"lerp(P₀, P₁, t)"| Res["Interpolated Point"] P1["Point P₁"] -->|"lerp(P₀, P₁, t)"| Res ```

However, practical applications require curves rather than rigid lines. Introducing a third point yields two connected line segments. By evaluating the same lerp function at identical parameter values of $t$ on both segments, we produce two moving points. Drawing a new line between those two derived points and lerping across it once more with the same parameter $t$ traces out a smooth curve. As Freya observes: “This, is the magic of Bézier curves. Using only linear interpolation, we end up with a smooth curve.” This specific construction produces a quadratic Bézier curve.

[03:54](https://www.youtube.com/watch?v=jvPPXbo87ds&t=234s) Cubic Bézier Curves and Their Formulations

Adding one additional control point—making four points total, designated $P_0, P_1, P_2, P_3$—and repeating the iterative interpolation yields a cubic Bézier curve. Three initial line segments lerp into two, which lerp into one final segment, whose interpolated point traces the cubic curve as $t$ travels from $0$ to $1$. The cubic Bézier is the undisputed industry workhorse: “The cubic Bézier is by far, the most common curve,” powering almost every vector graphics tool and digital font format in existence.

Mathematically, this curve can be expressed in several distinct but equivalent ways:

1. **De Casteljau’s Algorithm:** Evaluating points via repeated geometric lerping. As Freya characterizes it: “you just lerp until you run out of things to lerp!” This formulation is famously intuitive and highly numerically stable, though it can become computationally costly when evaluated repeatedly. 2. **Bernstein Form:** Rearranging the nested linear interpolations to group them as factors multiplying each original control point yields cubic polynomials known as the Bernstein basis polynomials. Geometrically, this means scaling each point's position vector by a polynomial weighting function and summing them. These functions form a convex combination—the polynomial weights always sum to exactly $1$ for any value of $t$, meaning influence shifts smoothly from $P_0$ having complete dominance at $t = 0$ to $P_3$ having complete dominance at $t = 1$. 3. **Monomial / Power Basis Form:** Factoring by powers of $t$ ($1, t, t^2, t^3$) groups terms into constant coefficient vectors. Geometrically, this represents a base position $P_0$ added to three separate vectors scaled respectively by $t$, $t^2$, and $t^3$. While less visually intuitive, it is ideal for performance: the coefficient vectors can be precomputed and cached whenever control points remain static. 4. **Matrix Form:** Expressing the transformation as a characteristic matrix isolates the underlying constants, revealing symmetries and structural elegance:

$$\begin{bmatrix} 1 & t & t^2 & t^3 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ -3 & 3 & 0 & 0 \\ 3 & -6 & 3 & 0 \\ -1 & 3 & -3 & 1 \end{bmatrix} \begin{bmatrix} P_0 \\ P_1 \\ P_2 \\ P_3 \end{bmatrix}$$

Multiplying the power vector by the characteristic matrix generates the Bernstein polynomials; multiplying the characteristic matrix by the control point matrix yields the monomial coefficients.

[07:41](https://www.youtube.com/watch?v=jvPPXbo87ds&t=461s) Arbitrary Degree Béziers and the Loss of Local Control

De Casteljau's algorithm naturally generalizes to any count of points. Lerping across a chain of thirteen points down to a single terminal point yields a degree-12 (dodecick) Bézier curve. Its basis polynomials likewise shift influence smoothly across the sequence from start to finish.

```mermaid flowchart TD accTitle: De Casteljau Cascade for Cubic Bézier accDescr: Recursive reduction of control points P0 through P3 to a single point using parameter t. subgraph S1["Initial Points"] P0["P₀"] P1["P₁"] P2["P₂"] P3["P₃"] end subgraph S2["First Lerp Step"] L01["P₀₁"] L12["P₁₂"] L23["P₂₃"] end subgraph S3["Second Lerp Step"] L012["P₀₁₂"] L123["P₁₂₃"] end subgraph S4["Final Point"] LFinal["Point(t)"] end P0 --> L01 P1 --> L01 P1 --> L12 P2 --> L12 P2 --> L23 P3 --> L23 L01 --> L012 L12 --> L012 L12 --> L123 L23 --> L123 L012 --> LFinal L123 --> LFinal ```

However, high-degree Béziers suffer from severe practical deficiencies when modeling complex paths, such as routing a road between towns through rugged terrain: - **Zero Local Control:** Every basis polynomial has global support across the interval $(0, 1)$. Moving a single control point shifts the entire curve globally, making fine local adjustments impossible: “In other words, we have no local control. Every movement of every point affects the entire curve.” - **Lack of Interpolation:** The curve fails to pass directly through intermediate control points, making it unintuitive to constrain the path along specific milestones. - **Computational Cost & Instability:** High polynomial degrees trigger severe floating-point numerical instability and require expensive calculations.

High-degree curves are fundamentally unsuited for complex routing tasks. The practical solution is not to escalate the polynomial degree, but to link multiple modest, low-degree curves together end-to-end.

[09:37](https://www.youtube.com/watch?v=jvPPXbo87ds&t=577s) Bézier Splines and Spline Anatomy

Connecting individual cubic Bézier curves end-to-end creates a piecewise construct known as a Bézier spline. Rather than relying on a solitary curve, multiple cubic segments cooperate, sharing interface points.

Operating across a composite spline requires restructuring the parameter space: - **Global Parameter ($u$):** While an individual curve accepts a local percentage $t \in [0, 1]$, the spline defines an extended parameter $u$ spanning the entire path length. - **Index vs. Local Time:** On a uniform spline, each curve segment is allocated a parameter interval of length 1. For any global input $u$, the integer component $\lfloor u \rfloor$ determines the curve index, while the fractional part $u - \lfloor u \rfloor$ serves as the local $t$-parameter inside that specific curve.

The structural vocabulary of splines consists of several core components: - **Parameter Space:** The 1D scalar domain across which the input coordinate $u$ lives. - **Control Points:** The spatial coordinates that determine the geometry of each curve segment. - **Joins / Knots:** The physical locations where consecutive curve segments meet end-to-end. While knots frequently coincide with control points in Bézier splines, this is not an invariant rule across other spline formulations. - **Knot Values and Knot Intervals:** Knot values are the specific coordinates in parameter space where transitions occur; the distance between two adjacent values is the knot interval. - **Uniform vs. Non-Uniform Splines:** In uniform splines, all knot intervals have identical length (typically 1). Non-uniform splines allow variable knot spacing, introducing substantial mathematical complexity.

[12:11](https://www.youtube.com/watch?v=jvPPXbo87ds&t=731s) Local Control and Spline Flexibility

Mapping the basis functions into parameter space demonstrates how a cubic Bézier spline resolves the limitations of a single high-degree Bézier curve. Examining the weight of an interior control point reveals that its influence lies entirely within the span of that specific segment; modifying it affects only that single curve while leaving the rest of the spline completely untouched. Even for shared endpoints where the influence is twice as wide across two adjacent curve segments, it never propagates beyond them. As Freya Holmér puts it, “So with the cubic Bézier spline, we’ve regained local control!”

Because the spline chains together third-degree curves, evaluating points does not grow more computationally expensive as the total path length increases. Rather than calculating an increasingly complex, high-degree polynomial, the engine merely evaluates one standard cubic Bézier at a time. Furthermore, the path directly interpolates every third control point instead of only the very start and end of the entire chain, giving designers predictable anchors for complex shapes. These mechanics explain why cubic Bézier splines serve as the bedrock of modern vector design tools, including font rendering engines and the Photoshop pen tool.

```mermaid flowchart TD accTitle: Tangent Point Configurations accDescr: Three common geometric configurations for tangent handles surrounding a Bézier spline join.

subgraph Tangents["Tangent Handle Configurations at Curve Joins"] direction TB A["Split / Broken Tangents\n(Angles & lengths independent)"] -->|Produces| D["Sharp Corners\n(Discontinuous tangents)"] B["Aligned Tangents\n(Collinear through join point)"] -->|Produces| E["Smooth Heading\n(Shared direction, different speeds)"] C["Mirrored Tangents\n(Collinear & equidistant)"] -->|Produces| F["Continuous Velocity\n(Equal speed & direction)"] end ```

The versatility of the cubic Bézier curve relies heavily on the behavior of the two control points flanking each seam, frequently referred to as tangent handles. These points typically assume three distinct configurations: - **Split / Broken Tangents:** Handled independently to produce sharp, distinct corners. - **Aligned Tangents:** Constrained collinearly through the seam to ensure both curves share an identical directional heading at the join. - **Mirrored Tangents:** Constrained both collinearly and at equal Euclidean distances from the shared seam, keeping tangent lengths strictly symmetric. - **Linear Segments:** Formed deliberately by placing the two intermediate control handles precisely one-third and two-thirds along the straight line connecting the endpoints. - **Approximated Circles:** Constructed to close tolerances using four cubic Bézier arcs, although they remain mathematical approximations rather than true analytical circles.

---

[15:07](https://www.youtube.com/watch?v=jvPPXbo87ds&t=907s) Introduction to Continuity and $C^0$ (Positional Continuity)

When animating an object such as a cube along an aligned-tangent spline, visual hitches become apparent at the curve transitions. The animated object appears to suddenly jump in speed whenever it crosses a join. This phenomenon introduces the formal concept of continuity, which fundamentally measures how smoothly two adjacent curve segments connect across parameter space. When the endpoint of an incoming curve coincides with the starting point of the subsequent curve, the spline exhibits positional continuity, designated as $C^0$.

```mermaid flowchart LR accTitle: Derivatives of Position accDescr: Physical definitions of positional derivatives with respect to the spline parameter t.

P["Position P(t)\n[0th Derivative]"] -->|"d/dt"| V["Velocity P'(t)\n[1st Derivative]"] V -->|"d/dt"| A["Acceleration P''(t)\n[2nd Derivative]"] A -->|"d/dt"| J["Jolt / Jerk P'''(t)\n[3rd Derivative]"] ```

If the curve endpoints are pulled apart, the spline breaks entirely and ceases to be $C^0$. Evaluating the motion requires examining derivatives with respect to the evaluation parameter $t$. Using the matrix formulation of a cubic Bézier, taking the derivative is straightforward: applying the standard power rule directly to the powers-of-$t$ basis vector yields the curve derivatives. In spatial motion, these derivatives map directly to classic kinematic terms: - **0th Derivative (Position):** The spatial location along the path, denoted $P(t)$. - **1st Derivative (Velocity):** The rate and direction of spatial change with respect to parameter progress, denoted $P'(t)$. - **2nd Derivative (Acceleration):** The rate of change of velocity, dictating physical force and turning rates, denoted $P''(t)$. - **3rd Derivative (Jolt / Jerk):** The rate of change of acceleration, denoted $P'''(t)$.

---

[17:32](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1052s) $C^1$ (Velocity Continuity)

Plotting the velocity vector across an aligned-tangent join reveals an immediate mathematical problem: the velocity graph contains an open gap. The vector direction points consistently through the seam because the handles are aligned, but the length of the tangent vector jumps instantaneously, creating a step discontinuity in speed. To eliminate this jump, the tangent handles must be strictly mirrored across the anchor point. Once mirrored, the velocity curve aligns seamlessly across the boundary, elevating the spline to $C^1$ continuity.

```mermaid flowchart LR accTitle: C1 Constraint Geometry accDescr: Algebraic derivation showing how P4 is fixed by reflecting P2 across join point P3.

P2["Handle P₂\n(End of Curve A)"] -->|Reflected across| P3["Join Point P₃\n(Shared Anchor)"] P3 -->|Determines| P4["Handle P₄ = 2P₃ - P₂\n(Start of Curve B)"] ```

Continuity classes build hierarchically: every $C^1$ continuous path must inherently satisfy $C^0$ continuity. Disconnecting the position at a seam removes both $C^0$ and $C^1$ status simultaneously, regardless of whether the incoming and outgoing velocity vectors share the same magnitude and direction. Algebraically, enforcing $C^1$ continuity across a seam between curve $A$ and curve $B$ requires that the terminal velocity of curve $A$ equals the initial velocity of curve $B$:

$$A'(1) = B'(0)$$

Substituting the cubic Bézier polynomial formulations into this equation establishes that point $P_4$ must equal $P_2$ reflected across the anchor point $P_3$:

$$P_4 = P_3 + (P_3 - P_2) = 2P_3 - P_2$$

Constraining $P_4$ to mirror $P_2$ removes its degrees of freedom. As Freya Holmér notes regarding this tradeoff, “Now, I’ve made $P_4$ grayed out, as we’ve actually lost a little bit of control now if we want this join to have $C^1$ continuity, because $P_4$ is now fully determined by $P_2$ and $P_3$, but, it’s a little sacrifice we’re willing to make.”

---

[20:25](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1225s) $C^2$ Continuity and the Cascading Loss of Local Control

Even after establishing $C^1$ velocity continuity, animated objects traversing the seam still display an abrupt, unnatural snap when changing direction. Because turning requires physical acceleration, analyzing the second derivative $P''(t)$ across the seam reveals another severe step discontinuity. To achieve $C^2$ continuity, the spline must equate the terminal acceleration of the incoming curve with the initial acceleration of the outgoing curve:

$$A''(1) = B''(0)$$

Solving this second-derivative boundary condition sets a direct constraint on the placement of control point $P_5$:

$$P_5 = P_1 + 4(P_3 - P_2)$$

Geometrically, this requires taking the vector pointing from $P_2$ to $P_3$, scaling it by a factor of 4, and projecting it forward from $P_1$. While this mathematical condition resolves acceleration spikes at a single seam, applying it across an entire multi-segment spline causes a catastrophic failure of local control.

```mermaid flowchart TD accTitle: C2 Constraint Cascade accDescr: Cascading chain reaction where moving initial control points fully locks all subsequent downstream points.

subgraph CurveA["Curve A Control Points"] P1["P₁"] P2["P₂"] P3["P₃ (Join)"] end

subgraph CurveB["Curve B Constrained Points"] P4["P₄ = 2P₃ - P₂ (C¹)"] P5["P₅ = P₁ + 4(P₃ - P₂) (C²)"] P6["P₆ (Join)"] end

subgraph CurveC["Curve C Cascaded Locks"] P7["P₇ (Locked by C¹)"] P8["P₈ (Locked by C²)"] P9["P₉ (Join)"] end

P1 & P2 & P3 --> P4 P1 & P2 & P3 --> P5 P5 --> P7 P4 & P5 & P6 --> P8 ```

Enforcing $C^1$ and $C^2$ continuity at every seam triggers a domino effect throughout the spline's geometry: - $P_4$ is locked by $P_2$ and $P_3$ to maintain $C^1$ continuity. - $P_5$ is locked by $P_1$, $P_2$, and $P_3$ to satisfy $C^2$ continuity. - Downstream handle $P_7$ is locked by $P_5$ across the subsequent seam for $C^1$. - Control point $P_8$ is locked by $P_4$, $P_5$, and $P_6$ to maintain $C^2$ across the next seam. - Control point $P_{11}$ is locked by $P_7$, $P_8$, and $P_9$.

When these conditions propagate down the line, user manipulation becomes virtually impossible. Nudging an early control point by a fraction of a millimeter causes downstream handles to swing wildly out of bounds. Holmér highlights the absurdity of this behavior, remarking: “As you can see, it yeets off to fucking wherever, making it absolutely useless as a spline.” Yet the motion remains exceptionally fluid: “You can’t make a cubic Bézier $C^2$ continuous, it is, literally impossible, without losing local control. And, having that control is the whole point of using splines in the first place!”

---

[23:46](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1426s) $C^3$ Continuity and $C^\infty$ Extrapolation

Pushing the boundary conditions to match third derivatives yields jolt continuity, defined as $C^3$:

$$A'''(1) = B'''(0)$$

Solving the algebraic requirements for the third derivative binds $P_6$ entirely to the preceding control points: $P_0$, $P_1$, $P_2$, and $P_3$. Geometrically, this requires taking the vector $(P_3 - P_0)$, adding the sum of $(P_3 - P_2)$ and $(P_1 - P_2)$, multiplying that combined vector by 6, and offsetting it from the seam. Under these conditions, the artist loses control over $P_6$, $P_9$, and $P_{12}$.

```mermaid flowchart LR accTitle: Continuity Spectrum accDescr: Spectrum of continuity levels from non-continuous curves to infinitely smooth single-polynomial curves.

C0["C⁰: Positional\n(Curves touch)"] --> C1["C¹: Velocity\n(Mirrored tangents)"] C1 --> C2["C²: Acceleration\n(Local control collapses)"] C2 --> C3["C³: Jolt\n(Degrees of freedom hit 0)"] C3 --> Cinf["C∞: Extrapolation\n(Single unified polynomial)"] ```

At this stage, the spline ceases to act like a spline. When every degree of freedom along the subsequent curve is locked to the third derivative of the preceding segment, curve $B$ becomes mathematically identical to evaluating the single polynomial of curve $A$ beyond $t > 1$. Because there are no longer true piecewise boundaries or distinct transitions between different polynomial functions, every derivative is smooth and continuous. The curve collapses into a single, global $C^\infty$ polynomial.

- **Broken / Disconnected:** The curves do not meet in space; no continuity exists. - **$C^0$ Continuity:** Curves share identical positional endpoints at seams ($A(1) = B(0)$), but velocity vectors may diverge in speed and direction. - **$C^1$ Continuity:** Velocity vectors match across the seam ($A'(1) = B'(0)$), requiring mirrored tangent handles. - **$C^2$ Continuity:** Acceleration vectors match ($A''(1) = B''(0)$), eliminating sudden directional turning snaps at the expense of local control. - **$C^\infty$ Continuity:** Interior points along any smooth polynomial span possess infinite continuity by default; continuity classifications exist specifically to diagnose the mathematical smoothness across the joins between segments.

[25:52](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1552s) The Shift from Parametric to Geometric Continuity

Parametric continuity ($C^n$) requires that two adjacent curve segments, curve $A$ and curve $B$, have identical zeroth through $n^{\text{th}}$ derivatives at their join point. While this concept is central to analyzing splines—serving as the primary motivation for exploring different spline varieties—it measures behavior strictly with respect to the curve’s parameter, $t$. In physical terms, $C^1$ continuity enforces not only that curves share the same heading, but that they pass through the joint at the exact same velocity and speed.

However, in applications like vector graphics or 2D drafting, parameterization speed is irrelevant. If a path is used purely to define a visual contour, sudden changes in velocity along the path do not matter as long as the drawn visual shape remains smooth. This motivates the study of geometric continuity, which is evaluated entirely independent of parameter speed. As Freya Holmér puts it: “Continuity is absolutely central to the discussion of splines, and it’s actually the primary motivator for investigating multiple different types of splines.”

[26:50](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1610s) Tangent Continuity ($G^1$) and Aligned Tangents

When analyzing control points on Bézier curves, mirrored tangent handles yield $C^1$ continuity because their opposing velocity vectors have identical magnitudes and directions. Broken tangent handles yield only $C^0$ continuity because they produce sharp corners. But aligned tangent handles—where the handles point in opposite directions along a shared line but have different lengths—represent a sudden jump in velocity length (speed).

To isolate the shape from the parameter speed, the velocity vector is normalized by dividing it by its magnitude, forcing its length to exactly $1$. Adding the 2D normal vector makes this behavior easy to visualize. Because normalizing removes the jump in speed, the unit tangent and normal vectors glide across an aligned joint without any sudden changes. This baseline shape continuity is called tangent continuity, designated as $G^1$. As Freya observes: “If we’re using these for vector graphics, we don’t really care about ‘speed’—we only care about the shape it creates in the end.”

```mermaid flowchart TD accTitle: Progression of Geometric Continuity accDescr: Flowchart showing positional, tangent, and curvature continuity requirements and visual tools. subgraph GeometricContinuity["Geometric Continuity Progression"] G0["G⁰: Positional Continuity<br>(Curves meet at shared point)"] G1["G¹: Tangent Continuity<br>(Normalized tangents align; speed ignored)"] G2["G²: Curvature Continuity<br>(Osculating circles & curvature comb match)"] G0 --> G1 G1 --> G2 end subgraph Diagnostics["Inspection & Diagnostics"] Comb["Curvature Combs"] Refl["Reflection / Zebra Line Test"] G2 -.-> Comb G2 -.-> Refl end ```

[27:46](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1666s) The Reflection Test and the Need for $G^2$

The step from $G^1$ to $G^2$ continuity is far more than a theoretical exercise; it is an essential requirement in industrial design for reflective consumer goods such as smartphone casings, car bodies, and even the subtle curves of the Apple app icon. To demonstrate why $G^1$ continuity fails on shiny objects, the curve can be extruded into a three-dimensional surface inside a studio environment with sharp overhead lighting and a reflective metallic shader.

Despite having perfectly aligned tangents across the seam, a glaring flaw appears on the surface: the reflection lines crack and display an abrupt kink directly at the joint. Switching the environment reflection to a field of high-contrast dots exposes the disruption even more dramatically. As Freya points out when inspecting the broken reflection across a tangent-aligned seam: “Isn’t it enough to just, align the tangents? Clearly, it’s not.”

- $G^1$ surfaces produce sharp visual seams in specular highlights and environmental reflections. - Aligned tangents ensure directional smoothness, but they do not guarantee smooth visual transitions under studio lighting. - The dot-pattern reflection test reveals discontinuous jumps across seams that appear seamlessly connected in flat 2D wireframes.

[28:56](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1736s) Seams in Circular Arcs and Tangent Angle Analysis

A surprisingly common misconception is that circular arcs represent the ultimate smooth primitive. When a perfect circular arc is joined directly to a flat straight line with matched tangent vectors, an identical reflection crack appears at the seam. Even though the circle is geometrically ideal, the transition possesses only $G^1$ continuity.

Tracking the surface normals and tangent angles along this composite path explains why this tear occurs. On the circular arc, the tangent angle turns at a constant, steady rate. On the flat straight line segment, the angle does not change at all. At the exact seam where the arc hits the line, the angular change stops dead in its tracks instantaneously. Circles are the special case where angle changes at a fixed non-zero rate, while lines are the special case where angular change is zero. Transitioning instantly between the two causes an angular rate shock, creating an unsightly visible seam.

[30:47](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1847s) Curvature and the Osculating Circle

To evaluate and resolve this defect without reintroducing parameter speed, one must measure curvature ($\kappa$). At any given point along a smooth curve, there is a unique matching circle known as the *osculating circle* (from the Latin word for "kissing") that shares the exact same tangent and curvature at that point. The radius of this osculating circle is the reciprocal of the curvature ($r = \frac{1}{\kappa}$).

Mathematically, curvature in two dimensions is defined as the determinant of velocity and acceleration divided by the speed cubed:

$$\kappa = \frac{\det(\mathbf{v}, \mathbf{a})}{\|\mathbf{v}\|^3}$$

Freya notes that this numerator determinant is commonly called the "2D cross product" or perpendicular dot product (or, more formally, the wedge product resulting in a bivector). Plotting the osculating circle along various spline segments demonstrates two key facts: a joint with only positional continuity ($C^0$) can occasionally happen to have continuous curvature, while a joint with velocity continuity ($C^1$) is by no means guaranteed to have continuous curvature.

[32:26](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1946s) Curvature Combs and Algebraic $G^1$ vs. $G^2$

Curvature is routinely visualized in CAD and vector software using a "curvature comb," where normal needles sprout along the curve. The length of each needle represents the magnitude of curvature at that sample, growing tall around tight turns and shrinking to zero along straight sections. When examining a $G^1$ joint with a curvature comb, the comb spikes to two completely different heights on either side of the joint, confirming that curvature is discontinuous.

Enforcing $G^1$ on a cubic Bézier spline algebraically requires placing the first control point of segment $B$ ($P_4$) along the line defined by segment $A$'s final two control points ($P_2 \to P_3$), scaled by an arbitrary positive scalar:

$$P_4 = P_3 + \beta_1 (P_3 - P_2), \quad \beta_1 > 0$$

The parameter $\beta_1$ provides one degree of freedom; setting $\beta_1 = 1$ mirrors the tangent, while any other positive value scales it. Enforcing $G^2$ continuity requires constraining the next control point ($P_5$) as well, which introduces a second degree of freedom, $\beta_2$. When $P_5$ is solved using both $\beta_1$ and $\beta_2$, the needles of the curvature comb instantly snap together across the joint, becoming fully continuous. Placing this $G^2$ surface back beneath studio lights completely eliminates the reflection seam, passing both the stripe and dot reflection tests cleanly. However, this comes at the cost of losing local control over subsequent control points down the spline chain.

- Surfaces meeting $G^2$ continuity or higher are often referred to in automotive and product styling as "Class-A surfaces." - $G^3$ continuity requires the rate of change of curvature to be continuous, causing the curvature comb itself to be tangent-continuous ($G^1$). - Industrial workflows rarely pursue continuity beyond $G^3$ because mathematical complexity increases dramatically while visual benefits yield diminishing returns.

[35:40](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2140s) Formal Definitions and the Continuity Hierarchy

A formal definition of geometric continuity can be framed through parameter remapping: two curves $A$ and $B$ are $G^n$ continuous at a joint if there exists a monotonic reparameterization function $g(t)$ such that curve $A(t)$ and curve $B(g(t))$ achieve full parametric $C^n$ continuity. In simple terms, if a curve's speed can be retroactively rewritten along its length so that all its derivatives match up to order $n$, the geometry itself is already $G^n$ continuous.

The hierarchy of continuity chains upward systematically: - $C^0$ and $G^0$ are identical: positional continuity (the endpoints touch). - $C^1$ is velocity continuity (requires continuous position and continuous first derivative). - $G^1$ is tangent continuity (requires continuous position and aligned normalized tangents). - $C^2$ is acceleration continuity (requires continuous position, velocity, and second derivative). - $G^2$ is curvature continuity (requires continuous osculating circles and continuous curvature magnitude). - $C^3$ is jolt continuity (the third derivative is continuous). - $G^3$ is continuity of the rate of change of curvature (sometimes improperly referred to as "torsion" or "acceleration" continuity).

Because geometric continuity imposes fewer constraints on the curve’s internal speed, parametric continuity is strictly more demanding. Under standard conditions, $C^n$ continuity inherently implies $G^n$ continuity ($C^1 \implies G^1$, $C^2 \implies G^2$), but geometric continuity does not imply parametric continuity.

[38:06](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2286s) The Regular Curve Caveat and Cusps

The rule that parametric continuity ($C^n$) guarantees geometric continuity ($G^n$) carries one critical mathematical caveat: the underlying curves must be *regular*. In differential geometry, a regular curve is strictly defined as a curve where velocity is never zero ($\|\mathbf{v}(t)\| \neq 0$).

When the speed drops to zero, the formulas defining geometric properties collapse. Both normalizing the velocity to compute the unit tangent ($\frac{\mathbf{v}}{\|\mathbf{v}\|}$) and calculating the curvature ($\frac{\det(\mathbf{v}, \mathbf{a})}{\|\mathbf{v}\|^3}$) require dividing by speed, resulting in division by zero whenever velocity reaches zero. In Bézier curves, a pathological configuration can be created where control points force the curve to come to an instantaneous stop. Although the curve retains high parametric continuity mathematically, the normalized tangent flips direction instantaneously at that standstill point. This produces a sharp point known as a cusp, creating an obvious geometric tangent discontinuity despite the curve’s formal $C^n$ parametric smoothness. As Freya warns: “A regular curve is one where the velocity is never 0—in other words, it never stands perfectly still.”

[39:25](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2365s) Beyond Bézier: The Hermite Spline

Equipped with the mathematical framework of continuity, the exploration moves beyond the Bézier spline into the broader universe of curves. Freya Holmér questions the intuitive nature of Bézier control points: “While the Bézier curve is useful, its points are pretty, strange, are they not?” Aside from the start and end anchors, intermediate Bézier control points do not correspond directly to physical landmarks. To design a curve that makes physical sense, one can instead specify boundary conditions in position and velocity—setting a starting position $P_0$, an ending position $P_1$, an initial velocity $v_0$, and a terminal velocity $v_1$—and then solve for the path connecting them. Such a construct is especially valuable when simulating physical systems or interpolating network movement data, as it automatically calculates the requisite acceleration and jolt to satisfy those boundary constraints.

Constructing this curve is straightforward algebra. Setting four constraints allows one to solve for four unknown coefficients ($a, b, c, d$) of a cubic polynomial. Evaluating the polynomial at $t = 0$ immediately forces $d = P_0$, because all higher-order terms vanish; evaluating the first derivative at $t = 0$ forces $c = v_0$. Solving the remaining equations yields the characteristic matrix of the spline, preserving the standard matrix formulation: a row vector of powers of $t$ on the left, a column vector of control values on the right, and a characteristic matrix in the middle that functions as the spline's unique algebraic fingerprint. Multiplying the $t$-vector by this characteristic matrix produces the four basis functions.

This construction is known as the Hermite spline. As Holmér remarks regarding its pronunciation: “Or, I mean, if you’re French you’re probably dying inside right now, technically I think it’s supposed to be pronounced Hermite, but nobody says it like that okay so cut me some slack.” Because each spline join shares an identical velocity on both sides, the Hermite spline is inherently $C^1$ continuous and strictly interpolates every specified point and velocity. However, analyzing its acceleration—the rate of change of velocity—reveals an instantaneous discontinuity across segment joins. Holmér concludes: “In other words, while this spline doesn’t meet the criteria for $C^2$ continuity, it is always $C^1$.” Some implementations also allow separate incoming and outgoing velocity vectors per knot, permitting deliberate $C^0$ corners when desired.

- **Boundary Constraints**: Start point $P_0$, end point $P_1$, start velocity $v_0$, end velocity $v_1$. - **Continuity Rating**: Guaranteed $C^1$ (velocity continuous); fails $C^2$ due to abrupt steps in acceleration. - **Interpolation Property**: Fully interpolating for both positions and specified derivative vectors.

```mermaid flowchart TD accTitle: Hermite and Derivative Spline Hierarchy accDescr: Diagram illustrating how boundary conditions flow into Hermite splines, Cardinal splines, and Catmull-Rom splines.

subgraph Constraints["Boundary Inputs"] P["Positions: P0, P1"] V["Velocities: v0, v1"] end

subgraph Hermite["Hermite Spline"] HS["Explicit Positions & Velocities\n(C1 Continuous, Discontinuous C2)"] end

subgraph Automatic["Neighbor-Derived Velocities"] CS["Cardinal Spline\nVelocity = scale * (P[i+1] - P[i-1])"] CR["Catmull-Rom Spline\nFixed scale = 0.5 ('Just works')"] end

P --> HS V --> HS HS -->|"Automate velocities via neighbors"| CS CS -->|"Fix scale to 0.5"| CR ```

---

[43:35](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2615s) Converting Between Hermite and Bézier

The Hermite spline shares an intimate geometric link with the cubic Bézier curve, and translating between the two representations requires minimal arithmetic. To convert a Hermite join into a cubic Bézier segment, one simply divides the velocity vector at the join by three and adds the result to the origin point. Flipping that same calculated vector across to the adjacent segment yields the corresponding Bézier tangent handle for the opposite curve.

Holmér explains: “If you divide each velocity by three, and add its origin, you get the Bézier tangent point.” Applying this operation reproduces the exact same trajectory as the Hermite spline, proving that cubic Bézier tangent handles represent precisely one-third of the instantaneous velocity vector at the knot.

- **Formula**: $\text{Bézier Handle} = P_0 + \frac{1}{3}v_0$. - **Mathematical Equivalence**: A cubic Hermite segment and a cubic Bézier curve with handles at one-third velocity produce identical geometric paths and velocity profiles.

---

[44:09](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2649s) The Linear Spline and Its Superpowers

Turning to the simplest and most widespread curve construct, Holmér highlights the linear spline—the practice of drawing straight line segments directly between control points. Despite its lack of mathematical sophistication, Holmér points out that it possesses distinct practical advantages: “And we might scoff at this shitty little basic spline but it actually has a few superpowers.”

First, the linear spline is strictly interpolating, passing through every provided point without extraneous oscillations. Second, it is trivially cheap to compute, evaluating via a standard linear interpolation (`lerp`). Third, it effortlessly supports arc-length parameterization, which allows an object to traverse a path at constant speed. As Holmér stresses: “Arc length parameterization is when you want to interpolate a curve with a constant speed, which is actually very complicated for almost all splines out there.” The major compromise is smoothness: a linear spline exhibits hard corners and is strictly limited to $C^0$ continuity.

- **Evaluation Formula**: Piecewise linear interpolation: $\text{lerp}(P_0, P_1, t) = (1 - t)P_0 + tP_1$. - **Continuity**: Strictly $C^0$ (breaks at first derivative). - **Primary Strength**: Trivial arc-length parameterization and negligible computational cost.

---

[45:17](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2717s) The Cardinal Spline: Automatic Tangents and Scale

To retain the interpolating behavior of linear splines while avoiding the need to manually supply derivative vectors like in Hermite splines, one can calculate velocities automatically from neighboring points. By subtracting the preceding control point from the succeeding one ($P_{i+1} - P_{i-1}$), a direction and magnitude vector is established for each knot. Because the first and last control points lack an outer neighbor, an artificial "ghost point" is created by mirroring the second adjacent point around the endpoint, allowing the curve to close cleanly across its full span.

Constructing tangents purely from raw neighbor differences, however, produces an unappealing, bulging trajectory. Analyzing this curve with a curvature comb demonstrates that sections with sharp directional shifts form noticeable bumps, while extended segments flatten out where curvature plummets to zero. To tame these harsh transitions, a uniform scale factor is applied to all generated velocity vectors. As the scale factor decreases toward zero, the spline contracts and approaches the shape of a linear spline; as the scale increases, the curve relaxes before bulging out again when the factor reaches one.

Holmér notes the confusing terminology in existing literature, where this scaling factor is frequently labeled tension: “I’ve found three different methods across the internet, so I’m just giving up, and calling it scale, because I think this is the most computationally efficient way to define it anyway.” A spline that interpolates all points using automatic neighbor-derived tangents modulated by an explicit scale parameter is termed a Cardinal spline.

- **Velocity Calculation**: $v_i = \text{scale} \cdot (P_{i+1} - P_{i-1})$. - **Ghost Points**: Endpoints are computed by reflecting interior adjacent points across boundary anchors ($P_{-1} = 2P_0 - P_1$). - **Curvature Control**: Lower scale values pull the spline closer to linear segments; higher values introduce pronounced curvature swells.

---

[48:20](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2900s) The Catmull-Rom Spline

When the Cardinal spline's scale parameter is dialed to exactly $\frac{1}{2}$, the curve assumes a uniquely balanced and natural trajectory. The flat regions and exaggerated sharp turns balance out into an evenly distributed sweep across the control points. Because of this balance, it has become a staple of interactive software. Holmér remarks: “It’s a very, comfortable spline, where you pass in some points, and it ‘just’ smoothly passes through without too much effort.”

This specific configuration is the Catmull-Rom spline, widely adopted in game development because designers can drop control points into a world and obtain an aesthetically pleasing, smoothly interpolated curve without manually tuning tangent handles. Assessing its continuity reveals that the curvature comb flows across joins without breaks, confirming geometric $G^1$ continuity. When checked parametrically, the first derivative connects seamlessly, while the second derivative graph contains visible gaps. Thus, the Catmull-Rom spline is parametrically $C^1$ continuous.

| Spline Type | Input Data Required | Tangent Generation | Continuity Rating | Primary Use Case | |:--- |:--- |:--- |:--- |:--- | | **Linear** | Points only | None (straight edges) | $C^0$ | Fast, constant-speed movement | | **Hermite** | Points and velocities | User-specified per point | $C^1$ | Physics simulation, networking | | **Cardinal** | Points and scale factor | Scaled neighbor vectors | $C^1$ / $G^1$ | Adjustable-tension curves | | **Catmull-Rom** | Points only | Fixed half-difference ($\text{scale} = 0.5$) | $C^1$ / $G^1$ | Game paths, general interpolation |

---

[49:33](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2973s) Investigating Catmull-Rom Basis Functions and Continuity

The mathematical structure of the Catmull-Rom spline becomes visible when looking at its characteristic matrix and basis functions. Basis functions dictate the exact weight that each control point exerts on the curve at any parameter value $t$. Holmér emphasizes this role: “Remember - the basis functions say how much every control point should influence a given point in the curve.” Rearranging these basis functions reveals how the influence of a single point propagates across four consecutive curve segments.

Plotting this influence reveals an undulating wave composed of distinct regions. Holmér illustrates the mechanical behavior of these regions: “The white section is where the point is pulling on the curve with a positive influence, while the red section is getting pushed away by the point, as it has a negative influence.” Every control point has a localized peak where its influence reaches exactly 100% (value 1.0) while all other points exert 0% influence, guaranteeing that the curve physically passes through that anchor. From that peak, its positive influence gradually drops off until it enters a negative valley—pushing the curve slightly outward—before returning to zero as adjacent points take over.

Because the behavior of a spline is tied to its underlying polynomials, the spline's continuity can be evaluated directly on the basis functions themselves: - **$C^0$ Evaluation**: The basis curves meet each other seamlessly and align with the zero axis at their boundaries, confirming $C^0$ positional continuity. - **$C^1$ Evaluation**: Taking the first derivative of the basis functions produces continuous curves without gaps, confirming that the spline is at least $C^1$ continuous. - **$C^2$ Evaluation**: Taking the second derivative reveals disjoint graphs with clear vertical breaks at the knot boundaries. This confirms that the Catmull-Rom spline fails $C^2$ continuity, retaining an acceleration mismatch across joins.

[51:31](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3091s) In Search of a $C^2$ Spline

After exploring multiple spline formulations, a clear frustration emerges: despite all the mathematical machinery developed so far, every construction remains trapped in the realm of $C^1$ continuity. Freya poses the central question: is there really no way to construct a cubic spline with $C^2$ continuity—guaranteeing continuous acceleration across joins—without running into the issues seen earlier? As she puts it:

> “Well, the best way to test this, is to try doing it yourself. In other words, you know, fuck around and find out.”

Because the characteristic matrix in the algebraic formulation serves as the mathematical fingerprint of any uniform cubic spline, the problem reduces to solving for its 16 unknown entries. Finding 16 independent equations requires systematically cataloging every boundary and continuity constraint across the basis functions:

```mermaid flowchart TD accTitle: System of 16 Equations for a C2 Spline accDescr: Diagram illustrating how 16 equations are gathered to determine the characteristic matrix of a C2 spline. subgraph Boundary["Boundary Conditions (6 eqs)"] B1["First basis function end joins x-axis with C² continuity (3 eqs)"] B2["Last basis function start joins x-axis with C² continuity (3 eqs)"] end subgraph Interior["Interior Segment Joins (9 eqs)"] J1["Join between functions 1 & 2 is C² (3 eqs)"] J2["Join between middle functions is C² (3 eqs)"] J3["Join between functions 3 & 4 is C² (3 eqs)"] end subgraph Partition["Convex Combination (1 eq)"] P1["Basis functions must sum to 1 across the domain (1 eq)"] end Boundary --> Total["16 Equations / 16 Unknowns Matrix System"] Interior --> Total Partition --> Total ```

Setting up $C^2$ continuity (matching position, first derivative, and second derivative) between adjacent pieces yields: - 3 equations requiring the tail end of the first basis function to meet the $x$-axis with $C^2$ continuity. - 3 equations requiring the join between the first and second basis functions to be $C^2$. - 3 equations requiring the join between the middle basis functions to be $C^2$. - 3 equations requiring the join between the third and fourth basis functions to be $C^2$. - 3 equations requiring the start of the final basis function to meet the $x$-axis with $C^2$ continuity.

This produces 15 equations, leaving exactly one degree of freedom unaccounted for. The final missing constraint comes from the requirement that the spline form a convex combination: all basis functions must sum identically to 1 across the domain. With 16 equations for 16 unknowns, the system is fully determined and solvable.

---

[53:15](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3195s) The B-Spline and Continuity Verification

Solving this system yields a set of basis functions that look extraordinarily smooth compared to Catmull-Rom or Bézier bases, alongside the corresponding coefficients of the characteristic matrix. However, plotting the resulting spline curve reveals a striking surprise: the generated curve does not pass through the control points at all. The entire curve and all of its interior joins sit completely detached from and inside the hull of the control polygon. As Freya observes:

> “This is the first time the curves don’t actually meet at control points.”

While losing interpolation might seem like a heavy price, inspecting the curve's continuity proves that the construction accomplished its primary mission:

- **Geometric Continuity ($G^2$):** Curvature combs placed across the joins remain fully connected and aligned regardless of how the control points are dragged. Because the comb itself exhibits kinked corners rather than smooth tangents at the boundaries, the curve is strictly $G^2$, not $G^3$. - **Local Control Preserved:** Crucially, unlike earlier attempts to force $C^2$ continuity onto Bézier splines—which triggered a cascading loss of local control where moving one point altered the entire spline—this construction maintains true local control. Moving a control point only influences its immediate neighborhood while preserving all continuity guarantees. - **Parametric Continuity ($C^2$ via Vector Animation):** Visualizing the parametric derivatives over time confirms the analytical results. First-derivative velocity vectors glide across the joins without instantaneous jumps, verifying $C^1$. Acceleration vectors (visualized attached to the tips of the velocity vectors, showing how acceleration constantly pulls on velocity) likewise deform and translate continuously without sudden hops, proving the curve is genuinely $C^2$. - **$C^3$ Discontinuity:** Plotting jolt vectors (third derivatives pulling on the acceleration vectors) reveals instantaneous snapping and jumping precisely as the parameter crosses segment joins, confirming the spline cannot be $C^3$.

This smooth, non-interpolating formulation is the classic uniform cubic **B-spline** (short for *Basis Spline*). Its existence hinges on a fundamental design trade-off: it sacrifices interpolation entirely in order to achieve effortless, local $C^2$ acceleration continuity.

---

[56:35](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3395s) Quiz Time: What Spline Is This?

Freya presents an isolated, smooth cubic curve segment on screen and challenges the viewer to identify which spline generated it. She jokes about how impossible the challenge is:

> “It requires an unreasonably, actually impossibly keen eye to determine.”

She cycles playfully through candidate explanations: - It looks like a Bézier curve because one can practically envision where the control handles ought to sit. - Perhaps it is a Hermite segment, defined by endpoints and explicit boundary velocity vectors. - It could easily be a Catmull-Rom segment passing neatly through its defining data points. - Or maybe it is obviously a B-spline given how gentle and smooth the curvature appears. - Alternatively, what if it represents physical motion: a projectile trajectory launched with an initial position and velocity, subject to a constant baseline gravity and a steady linear change in gravity over exactly one second? Trajectories can also be written in matrix form.

The punchline is that this is a trick question. Every single one of these formulations can produce the exact same spatial curve segment. Within an isolated segment, all of these splines are uniform (parameterized over the canonical range $t \in [0, 1]$) and all are cubic polynomials governed by identical algebraic polynomial degrees.

---

[57:37](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3457s) Curves vs. Splines and Use Cases

Because any uniform cubic segment can be reparameterized into another, a fundamental conceptual distinction must be drawn: an individual curve is not a spline. Rather, curves are generated by splines. As Freya puts it:

> “What splines really describe, is a transformation of control points.”

A spline acts as a curve generator governed by specific contracts regarding how it interprets input control points and how smoothly it stitches adjacent segments together across joins. Changing the spline type while keeping the control points fixed yields completely different paths:

```mermaid flowchart LR accTitle: Splines as Curve Generators accDescr: Flow diagram showing control points transformed by various spline types into distinct curves with specific continuity promises. CP["Control Points"]

subgraph Generators["Spline Generators (Continuity Promises)"] direction TB B["Bézier: C⁰ / G¹ control (corners)"] H["Hermite: Explicit velocity matching"] CR["Catmull-Rom: C¹ + Interpolation"] BS["B-Spline: C² + Local Control"] L["Linear: Dense sampling / polyline"] end

Curves["Resulting Continuous Paths"]

CP --> Generators Generators --> Curves ```

Each spline type occupies a distinct practical niche based on its unique promises:

| Spline Family | Continuity / Behavior | Primary Applications | |:--- |:--- |:--- | | **Bézier Spline** | Direct handle control; easy to break continuity for deliberate sharp corners ($C^0$) | Vector typography, fonts, 2D graphic design (e.g., drawing shapes like hearts). | | **Hermite Spline** | Explicit derivative specification; guaranteed boundary velocities | Keyframe animation editors (e.g., Unity's Animation Curve editor). | | **Catmull-Rom Spline** | Automatic velocity estimation; guaranteed interpolation through points ($C^1$) | Path smoothing in game cameras, navigation, and trajectory following through waypoint data. | | **B-Spline** | Non-interpolating; guaranteed local $C^2$ acceleration continuity | Industrial CAD/CAM, class-A reflective car surfaces, smooth camera tracks devoid of sudden acceleration jolts. | | **Linear Spline** | $C^0$ continuity (polylines); simple point-to-point connections | Densely sampled paths where raw segment density makes discretization imperceptible (e.g., rendering curve samples in video graphics). |

To illustrate Hermite splines in action, Freya walks through a stylized animation of a jumping square built inside Unity. The vertical bounce height is driven over time by a 1D non-uniform Hermite spline (allowing custom time intervals between keyframes). Layering additional splines allows independent control over rotation (flipping the box mid-air) and scale (giving the box a squishy, goopy squash-and-stretch bounce).

---

[01:01:35](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3695s) The Extended Spline Universe: Non-Uniformity, NURBS, and Color Space

Uniform cubic splines represent only a tiny corner of spline theory. Every spline type has higher-degree polynomial counterparts as well as non-uniform extensions: - **Non-Uniform Hermite Splines:** Allow arbitrary time stamps for keyframes, giving animators full control over both value, arrival velocity, and duration between knots. - **Non-Uniform Catmull-Rom Splines:** Adjust knot spacing based on geometric distances between points (such as centripetal parameterization), preventing loops, self-intersections, and overshoot cusps. - **Non-Uniform B-Splines:** Enable variable knot spacing while preserving all $C^2$ continuity guarantees, allowing custom basis functions per segment that alter how tightly the curve hugs the control polygon. - **NURBS (Non-Uniform Rational B-Splines):** Add an explicit scalar weight or priority to each control point, pulling the curve closer to or pushing it further from specific vertices. This rational formulation allows exact representations of conic sections (like true circles and ellipses) that standard polynomial splines can only approximate.

Finally, Freya circles back to an example shown at the very start of the video: color gradients. Colors exist within a three-dimensional RGB color cube whose axes represent red, green, and blue values. Every color stop in a gradient is literally a control point of a 3D linear spline situated inside color space. When applied as a gradient map to an image, the input parameter is not time, but rather the luminance (brightness) of each grayscale pixel. The spline evaluates that brightness value to output a full RGB color vector, demonstrating how splines silently underpin rendering, mathematics, and digital art far beyond simple geometric motion paths.

[01:03:58](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3838s) Feline Interruptions and Patreon Support

Freya opens the video's closing thoughts with personal acknowledgments, highlighting her cats—Thor, Salad, and Toast—who made frequent, disruptive appearances during the voiceover recording sessions. Salad is shown actively causing trouble by chasing Thor, an activity he is strictly forbidden from doing. Freya playfully scolds him as a "bad boy" while letting viewers see the behind-the-scenes domestic chaos that accompanied the production.

Following the feline shout-out, she expresses deep gratitude to her Patreon community, noting that member contributions made the immense project viable in the first place. She actively encourages viewers who appreciate her educational work to join her Patreon, making an explicit practical case for the platform. She points out that Patreon only takes a 5% cut of creator earnings, contrasting it directly against storefronts and platforms that routinely extract 30% to 50%. As Freya puts it: “Patreon is also the,, it's like the only platform, that only takes 5% of the cut most other platforms take like 30% or 50%, which is absolutely ridiculous, and so patreon is like a really really good place to support work in general, so I would really recommend that!”

- **Cat Cast:** Thor, Salad, and Toast (with Salad caught on camera actively chasing Thor). - **Platform Economics:** Freya emphasizes that Patreon's 5% creator fee is vastly fairer than the 30% to 50% cuts standard across other creator and distribution platforms.

---

[01:04:51](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3891s) Scope Creep, Burnout, and Recovery

Turning to the production history, Freya reflects on the grueling timeline of the project, which took a little over a year from the commencement of research to its final YouTube release. The core issue was an unmanageable scope: splines represent an enormous mathematical domain with countless avenues of exploration. Because Freya instinctively strives to explain every subtopic with exhaustive rigor and visual depth, the video risked ballooning into an unwatchable twelve-hour marathon. Looking ahead, she resolves that future projects must either target tightly bounded concepts or be architecturally planned from the outset as serialized chunks rather than monolithic releases. The original vision had been a comprehensive arc starting at linear interpolation (`lerp`) and culminating in Non-Uniform Rational B-Splines (NURBS); while she touched upon both ends, she was unable to cover the inner mathematical workings of NURBS or non-uniform splines.

The emotional and physical toll of this runaway scope resulted in severe burnout. After completing about three to four months of continuous work, she hit an absolute wall where progress stopped entirely for several months. For someone whose personal identity and self-worth are deeply tied to high productivity, this shutdown was profoundly distressing. As Freya reveals: “I think I got like 3-4 months of work done, and then I burnt out completely, and, I couldn't work on it.” Even while remaining proud of the density and visual polish of the finished one-hour runtime, she expresses lingering regret over the topics she had to cut. However, because the extensive research and code implementations are already complete, she holds open the door to explore non-uniform splines and NURBS in dedicated future videos without having to start from scratch.

---

[01:07:18](https://www.youtube.com/watch?v=jvPPXbo87ds&t=4038s) The YouTube Comment Prediction Game

Acknowledging that only a tiny fraction—perhaps 1%—of viewers ever reach the extreme tail end of a long-form essay, Freya initiates a playful prediction game anticipating the exact debates and criticisms bound to populate the YouTube comment section. Her first prediction revolves around the word "osculating." In her previous Bézier curve video, she had mispronounced the term as "ossu-layding," prompting a torrent of confused viewers to correct her under the mistaken impression she had meant "oscillating." Anticipating the internet's reflexive nature, she predicts the pendulum will swing the other way: “I predict that, someone is gonna correct me, or, incorrectly correct me, about how I pronounced 'osculating'.”

She also expects commenters to argue that the matrix form of the cubic trajectory could be further simplified by reducing its diagonal matrix, as well as semantic debates claiming her definition of a spline is either wrong or insufficiently formal. Another predictable critique is that she "forgot" to show how NURBS can represent exact circular arcs; she clarifies that this was an intentional omission reserved for an upcoming standalone video on circles and splines. Finally, she humorously lists advanced concepts viewers might drop in the comments to flaunt their domain knowledge, emphasizing that these were deliberately set aside to protect her health and prevent further burnout:

- **Anticipated Commenter "Omissions":** - Natural splines - Polar blossoming - De Boor's algorithm / construction of B-splines - The A-frame construction - Knot insertion, knot multiplicity, and degree elevation - $\beta$-splines (Beta-splines) - Kochanek–Bartels splines - Spiro splines - Biarcs - Lagrange interpolation (which, she dryly notes, is not even a spline)

---

[01:10:05](https://www.youtube.com/watch?v=jvPPXbo87ds&t=4205s) Attempting to Invent a Quartic $C^2$ Spline

Freya reveals a secret objective she harbored during production: she wanted to conclude the video by inventing an original spline formulation and contributing something novel to mathematical curve design. Specifically, she sought to combine the most desirable traits of existing popular splines: an interpolating curve that passes directly through every single control point (like a Catmull-Rom spline), but possesses acceleration continuity ($C^2$) at every seam.

```mermaid flowchart TD accTitle: Quartic C2 Spline Design Trade-offs accDescr: Flowchart illustrating Freya Holmer's attempt to design a novel interpolating C2 continuous spline using a quartic degree formulation.

subgraph Goal ["Design Objective"] G1["Interpolation: Passes through all points (like Catmull-Rom)"] G2["Continuity: C² Acceleration Continuity across seams"] end

subgraph Execution ["Implementation Strategy"] E1["Raise polynomial degree from Cubic (degree 3) to Quartic (degree 4)"] end

subgraph Outcome ["Result & Visual Failure"] R1["Mathematically Solved for Uniform Case"] R2["Undesirable Curve Geometry: Nearly linear between points with abrupt corner bends"] end

Goal --> Execution Execution --> Outcome ```

To grant the curve enough degrees of freedom to satisfy both constraints simultaneously, she increased the polynomial degree from cubic (degree 3) to quartic (degree 4). While she successfully solved the linear algebra for the uniform case, the visual result was an aesthetic failure. As Freya bluntly admits: “I did make a spline, but, it had a bad shape.” The curve produced an awkward, unappealing trajectory that ran almost completely flat and linear between control points before making sudden, tight turns at the nodes. Disappointed by its geometric behavior, and unable to generalize it cleanly to non-uniform knot spacing, she ultimately scrapped the discovery from the main presentation.

---

[01:11:12](https://www.youtube.com/watch?v=jvPPXbo87ds&t=4272s) Finding a Voice and Looking Ahead

In an introspective tangent, Freya discusses her continuing struggle to settle on an authentic presentation style for scripted video essays. Having honed her voice primarily through unscripted livestreaming on Twitch, she finds that reading from a strict script often strips out her natural humor, spontaneity, and cadence. As Freya observes about the medium's stiffness: “I always feel like my personality is not shining through, when I make this type of video.” She plans to experiment with presentation formats in future videos so her delivery feels less flat and detached.

She reminds viewers that much of the development, mathematical prototyping, and tool programming for her videos happens live on Twitch, and notes that she also streams live educational lectures on YouTube—including an upcoming week-long masterclass on shader programming. Wrapping up, she reaffirms her commitment to tackling bite-sized math questions rather than massive omnibus projects. Her intended next subject is a focused breakdown of "What are radians?", joking: “That seems like a very bitesize topic that I can then accidentally blow up to 30 minutes, but 30 minutes is a lot more manageable than 1 hour, so, hopefully that's what's gonna happen.” With a final expression of gratitude to the audience for joining her on such an exhausting creative journey, she signs off until the next video.

## Notable quotes > [20:25](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1225s) You can’t make a cubic Bézier C2 continuous, it is, literally impossible, without losing local control. And, having that control is the whole point of using splines in the first place! — Freya Holmér

> [25:52](https://www.youtube.com/watch?v=jvPPXbo87ds&t=1552s) Continuity is absolutely central to the discussion of splines, and it’s actually the primary motivator for investigating multiple different types of splines. — Freya Holmér

> [57:37](https://www.youtube.com/watch?v=jvPPXbo87ds&t=3457s) What splines really describe, is a transformation of control points. — Freya Holmér

> [44:09](https://www.youtube.com/watch?v=jvPPXbo87ds&t=2649s) Arc length parameterization is when you want to interpolate a curve with a constant speed, which is actually very complicated for almost all splines out there. — Freya Holmér

## Mentioned Freya Holmér, Satisfactory, Apple, Adobe Photoshop, De Casteljau's algorithm, Bernstein basis polynomials, Unity, Patreon, YouTube, Twitch, NURBS, De Boor's algorithm, Catmull-Rom spline

## Video description why are splines? well my god I have good news for you, here's why splines!

if you like my work, please consider supporting me 💖 https://www.patreon.com/acegikmo

This project grew much larger in scope than I had originally intended, and burnout made it impossible for me to do more with it. It was already getting incredibly unwieldy, so I apologize in advance for not covering non-uniform splines, and the general jankiness of some parts. There are also quite a lot of places where I just talk about something without *showing* it, but since I couldn't animate it all, I opted to keep that information in rather than remove it altogether

• Lots of love to 💛 Jazz "queenjazz" Mickle for music & sounds ❱ https://queenjazz.bandcamp.com/ 🐈 our children, Thor, Salad & Toast, for helping me out during recording

• How was this video made? 🔨 I made it in Unity, the game engine ⭕ Using Shapes, my vector graphics plugin ❱ https://u3d.as/1W37 📈 Using Mathfs, my math library ❱ https://github.com/FreyaHolmer/Mathfs ...along with a bunch of hacky, partially broken, procedural animation tools I made specifically for this video 💡 Striped studio skybox by ProAssets: https://assetstore.unity.com/packages/2d/textures-materials/sky/studio-lighting-hdri-pack-55154 🎥 Final editing in DaVinci Resolve

• Links 🐦 Twitter ❱ https://twitter.com/FreyaHolmer 📺 Twitch ❱ https://www.twitch.tv/acegikmo 💬 Discord ❱ https://discord.gg/v5VWuga 🌸 Instagram ❱ https://instagram.com/freya_holmer

Timestamps:

00:00:00 Intro 00:01:17 Examples of Paths

00:02:16 CHAPTER 1 - Bézier Curves 00:02:20 Lerp 00:03:16 Quadratic Bézier 00:03:54 Cubic Bézier 00:07:41 n-Degree Bézier

00:09:37 CHAPTER 2 - Bézier Splines 00:10:00 Cubic Bézier Spline 00:10:21 Spline Parameterization 00:11:01 The Anatomy of a Spline 00:11:32 Knot Values & Knot Intervals 00:12:21 Local Control 00:14:03 The flexibility of the Cubic Bézier 00:14:28 Tangent Points

00:15:07 CHAPTER 3 - Continuity 00:15:28 C⁰ (Positional Continuity) 00:16:12 Spline Derivatives 00:17:32 C¹ (Velocity Continuity) 00:20:25 C² (Acceleration Continuity) 00:21:48 Cascading Loss of Local Control 00:23:46 C³ (Jolt Continuity) 00:24:49 C∞ Continuity 00:25:19 Parametric Continuity Summary

00:26:20 CHAPTER 4 - Geometric Continuity 00:26:50 G¹ (Tangent Continuity) 00:27:46 G² (Curvature Continuity) 00:28:05 The Reflection Test 00:28:56 Seams in Circular Arcs 00:29:43 Angle Analysis 00:30:47 Curvature & The Osculating Circle 00:32:26 Curvature Combs 00:32:48 G¹ (Algebraically) 00:33:27 G² (Algebraically) 00:34:52 Geometric Continuity Summary 00:36:30 Continuity Summarized 00:38:06 Cusps

00:39:25 CHAPTER 5: The Extended Universe 00:39:40 Hermite Spline 00:43:35 Hermite ⇔ Bézier Conversion 00:44:09 Linear Spline 00:45:17 Cardinal Spline 00:48:20 Catmull-Rom Spline 00:49:33 Investigating Basis Functions 00:51:02 Basis Function Continuity Analysis 00:51:31 In Search of a C² Spline 00:53:15 B-Spline 00:56:35 Quiz Time! 00:57:12 Cubic Trajectory 00:57:37 Uniform Cubic Splines 00:59:09 Splines & Their Use Cases 01:01:37 Outro 01:02:16 NURBS 01:02:56 Color Spline 01:03:52 Credits & Freya Rambles 01:13:26 Cats helping me w. recording

[Source](https://www.youtube.com/watch?v=jvPPXbo87ds)

Reading summary

Freya Holmér argues that defining a smooth digital path is fundamentally a mathematical tradeoff between local user control, interpolation, and continuity across curve seams. While splines power digital applications from font rendering to physics simulations, no single curve formulation simultaneously satisfies every design requirement. Bézier Chains and the Tradeoff of Local Control Starting from linear interpolation (lerp), quadratic and cubic Bézier curves generate smooth trajectories through recursive evaluation, such as De Casteljau’s algorithm, or weighted sums using Bernstein basis polynomials. Although high-degree Bézier curves can span many points, every control point exerts global influence across the entire parameter interval, eliminating local control and making intuitive intermediate interpolation impossible. To restore local control, designers assemble piecewise cubic Bézier splines by chaining segments end-to-end. This confines the geometric influence of individual control points to immediate neighboring segments and prevents evaluation costs from ballooning as path length increases. However, chaining introduces the core engineering challenge of maintaining continuity across segment joins. The Mechanics and Collapse of Parametric Continuity (15:07) Parametric continuity ($C^n$) measures smoothness relative to the curve parameter $t$, mapping directly to kinematics: $C^0$ ensures positional contact, $C^1$ matches velocity, $C^2$ matches acceleration, and $C^3$ matches jolt. A spline with aligned tangents can maintain continuous direction while suffering an abrupt jump in speed, requiring tangent handles to be strictly mirrored across knots to achieve $C^1$ continuity. Attempting to push cubic Bézier splines to higher continuity levels triggers an algebraic cascade. Enforcing $C^2$ acceleration continuity across adjacent cubic segments locks downstream control point placements, systematically stripping degrees of freedom and destroying local control. Pushing the boundary conditions to $C^3$ locks every subsequent point entirely, collapsing the piecewise spline into a single global polynomial with infinite ($C^\infty$) continuity. Geometric Continuity and Reflection Diagnostics (25:52) When paths define visual shapes rather than motion over time—such as in 2D vector graphic design or industrial CAD—parameterization speed is irrelevant. Geometric continuity ($G^n$) evaluates curve shape independently of internal speed by normalizing tangent vectors. While $G^1$ requires only aligned tangents, it proves insufficient for highly reflective surfaces: extruding a $G^1$ curve reveals visible cracks and kinks in specular highlights and reflection tests. Achieving seamless visual transitions requires $G^2$ curvature continuity, ensuring that the osculating circle and the magnitude of curvature match across the seam. While $C^n$ continuity generally implies $G^n$ continuity, this relationship breaks down at non-regular points where velocity drops to zero, producing sharp cusps despite formal parametric smoothness. Specialized Spline Families and Their Functional Guarantees (39:25) Because individual cubic segments can be mathematically converted between different representations—such as Hermite, Bézier, or Catmull-Rom—a spline is best understood as a transformation contract that interprets control points to fulfill distinct operational needs. Hermite splines derive paths from explicit endpoint positions and velocity vectors, linear splines provide cheap evaluation and trivial arc-length parameterization, and Catmull-Rom splines yield balanced, interpolating curves with $C^1$ and $G^1$ continuity from points alone. To achieve true $C^2$ and $G^2$ continuity while preserving local control, the uniform cubic B-spline relaxes point interpolation entirely, allowing the curve to float inside the convex hull of its control points. Broader extensions—such as non-uniform knot spacing and Non-Uniform Rational B-Splines (NURBS)—further expand these capabilities by enabling exact conic representations like circular arcs and weighted point attraction. Holmér concludes that splines are defined by their structural compromises; attempting to combine all desirable attributes into a single curve highlights these limits. Her own attempt to engineer an interpolating quartic $C^2$ spline produced mathematically sound equations but resulted in an unappealing geometric profile, underscoring that curve design remains constrained by inherent mathematical tensions.

Source quotes

[20:25] Freya Holmér: You can’t make a cubic Bézier C2 continuous, it is, literally impossible, without losing local control. And, having that control is the whole point of using splines in the first place! [25:52] Freya Holmér: Continuity is absolutely central to the discussion of splines, and it’s actually the primary motivator for investigating multiple different types of splines. [57:37] Freya Holmér: What splines really describe, is a transformation of control points. [44:09] Freya Holmér: Arc length parameterization is when you want to interpolate a curve with a constant speed, which is actually very complicated for almost all splines out there.

Original transcript

[0:00] For the past year, I’ve been asking myself [0:02] How do you define a smooth path? [0:04] It’s an innocent question that  seems straightforward at first [0:07] After all, we’ve used paths throughout history [0:10] both in the real world and in  my field of game development [0:13] But it turns out, this goes much  deeper than one might expect. [0:17] What do we mean by path? [0:19] And for that matter, what do we mean by smooth? [0:23] I was propelled into a year long journey [0:25] filled with twists and turns [0:27] unexpected realizations and discoveries [0:30] making connections to things  I hadn’t thought of before [0:32] I was knee-deep in research and math papers. [0:35] I wrote pages and pages of notes, eventually I [0:38] got to the point of finding errors in  numerous resources online, and then, [0:43] I got burnt out [0:49] But, I have finally reached  the destination of my journey [0:52] and this is where yours will begin. [0:55] I’m so happy to finally share with you [0:57] the culmination of that year long deep  dive, into the continuity of splines [1:17] In the virtual worlds we create,  there’s often a need to define paths. [1:22] These can take many different forms, such  as this conveyor belt in satisfactory, [1:26] or this more complex type of path  that you see in this rollercoaster, [1:30] using a path for not only  position, but for rotation as well [1:35] We also use paths in 2D games, to animate  things like this in a smooth manner [1:40] In fact, almost all animations in  games have a type of path defined [1:43] for every single joint in a character’s body [1:48] Your browser has paths defined for  every letter in every word you read [1:54] Even in art tools, we sometimes use  something called a gradient map. This too, [1:58] is a type of path, where the input is luminosity  instead of time, and the output is in color space [2:06] Now, these might seem pretty unrelated [2:08] These are wildly different concepts  from all over the digital world, [2:11] but there is something they all have in common [2:13] All of them, are splines [2:16] And this journey starts, with Bézier curves [2:20] The most basic way to create  a path between two points, [2:23] is to simply draw a straight line between them [2:26] We can then blend between these two  points, to find any point in between [2:30] The input to this function, is a percentage,  or, a t-value, a value from 0 to 1 [2:36] that determines how far we want to  go from the first point to the second [2:44] This is the most common type of blending  function, known as lerp, or, linear interpolation. [2:50] Mathematically, we can define lerp as  a function that takes a single value, [2:54] our t-value from 0 to 1, [2:56] and uses that to blend between the two points [2:59] where 0 gives you the first point  and 1 gives you the endpoint. [3:02] But, usually, when we create a path, [3:05] we want to be able to create smooth  curves, not just straight lines [3:10] So what if we add another point? [3:11] Instead of just two points, we now  have three, and between them, two lines [3:16] We can then use the exact same lerp function,  to blend between these points on each line. [3:22] But what if we then connect these two points? [3:24] We now have a third line,  between the interpolated points, [3:28] and let’s try using lerp on that line as well [3:31] Now watch what happens to this  point, as we change t from 0 to 1 [3:38] This, is the magic of Bézier curves.  Using only linear interpolation, [3:43] we end up with a smooth curve. [3:46] This one in particular, is  a quadratic Bézier curve [3:50] Of course, we don’t have to stop here [3:54] We can add another point, lerp on those lines, [3:58] connect those points, lerp on those lines [4:01] connect those two points, and  finally, lerp on the last line [4:06] And again, this will trace out  this beautifully smooth path [4:12] This one has one more point, and is of one degree  higher, meaning this is the cubic bézier curve. [4:18] The cubic Bézier is by far, the most common curve [4:23] Almost every font and vector graphics  tool, is using the cubic bézier [4:27] And so it’s worth digging deeper into how it works [4:31] So let’s write all this down! [4:33] We have 4 points, P₀ through P₃ [4:36] We then get these intermediate points, before  the final point that we get out of the function [4:41] This method of, recursively lerping between  our points, is called DeCasteljau’s algorithm [4:47] It’s very popular, and incredibly easy to remember [4:50] you just lerp until you run out of things to lerp! [4:54] It’s also very numerically stable, but it can  sometimes be a little expensive to calculate [4:59] Let’s look at the same math,  but from a different perspective [5:03] If we write all these lerps out as a math  function, we can shuffle things around, [5:07] and express them as a factor of each point! [5:11] This is called the Bernstein  form of Bézier curves. [5:14] A geometric interpretation of this, is  taking the vectors that represent each point, [5:18] scaling each of them by their own cubic  polynomial, and adding them all up. [5:24] These polynomials might seem like they  came out of nowhere, but this is just [5:28] what you get when rearranging the lerp math  to be expressed as a factor of each point [5:34] These polynomials act as  influences of each control point [5:38] So in the beginning, the first point has all  influence, this is then slowly shifted over, [5:43] until the last point has all the influence [5:47] This is a special type of weighted  sum, called a convex combination, [5:51] as these polynomials add  up to 1 for all values of t [5:56] A third interpretation I’d like to  show, is particularly interesting, [6:00] because it allows us to write more optimized code [6:03] Instead of writing them as factors of points, what  if we rearrange them as factors of powers of t? [6:10] As you can see, we have a constant  factor, t, t squared, t cubed [6:15] The reason this is computationally efficient, [6:17] is that we can cache these coefficients,  for each arrangement of the control points. [6:22] Now, a geometric interpretation of this one is, [6:27] a little harder to wrap your head around.  It’s, definitely not as intuitive as the others [6:32] But we can think of it as 4 vectors that  are each scaled by specific powers of t. [6:38] We have a constant P₀, plus a vector scaled by t, [6:42] plus a vector scaled by t squared,  plus a vector scaled by t cubed [6:50] And so, even though all three of these  are describing the exact same curve [6:54] mathematically, they have different geometric  interpretations and performance characteristics [7:00] There’s one last way we can rearrange this math,  that is by far, my favorite - the matrix form [7:07] One thing I particularly like about it, is  that it separates out all the magic numbers, [7:12] it lets us see patterns and symmetries  that were otherwise hard to spot [7:16] This is called the characteristic  matrix, of the cubic bézier curve [7:21] Now, this matrix form actually encapsulates both  the bernstein and the polynomial interpretation [7:27] If we multiply the powers of t  by the characteristic matrix, [7:31] we get the bernstein polynomials [7:34] If we instead multiply the characteristic matrix [7:37] by the point matrix, we get  the polynomial coefficients [7:42] But, a cubic bézier curve doesn’t get us very far. [7:45] What if we want to create a  longer, more complicated path? [7:50] Luckily, béziers generalize  to any number of points [7:53] For this set of control points, we are doing  the exact same thing as before. Lerp until [7:59] there are no more things to lerp, and we’re  left with one point, tracing out the path [8:04] Not that, anyone would call it this, but,  technically this would be a dodecic bézier curve [8:10] Just like the cubic bézier, we can  describe the influence of each point, [8:15] with its bernstein basis polynomials [8:17] As you can see, the same principle applies, [8:20] it starts out with the first  point having full influence, [8:23] and then it will ride the waves through the  middle, until the last point gets full influence. [8:28] But, if we want to use this for paths  in games, we now have a problem. [8:34] Let’s say we want to use this path to  define a road, from one town to another. [8:39] If we focus on a single control point - you  can see, its influence is, actually across [8:45] the entire curve. Which in practice means that if  we move this point around, the entire curve will [8:51] actually change shape. And this is a huge problem  if we want to create precise and intricate shapes, [8:56] snaking around mountain ranges, or whatever  else might be in the way of our road. [9:02] In other words, we have no local control. Every  movement of every point affects the entire curve [9:09] In addition, it doesn’t actually  pass through most points, [9:13] making it very difficult to make a  specific paths of the shape you want. [9:18] And finally, given the sheer  number of control points, [9:21] it’ll either be numerically unstable  or very expensive to calculate. [9:25] Clearly, higher degree bézier  curves are not the answer [9:30] we need to dive deeper, to find a better way [9:32] A way to control shapes without affecting  every single other point in the curve [9:37] And perhaps, we left our cubic  bézier curve a little too early [9:43] Maybe, they were just, feeling a little lonely [9:46] Perhaps they just needed some friends  to realize their full potential, [9:51] to work as a team and achieve  what they couldn’t do on their own [9:55] And together, they form the bézier spline [10:01] Instead of having just one segment, [10:02] we now have multiple bézier curves  joined together, sharing endpoints [10:08] Traversing this path requires  some extra work though [10:11] The input t-value was traditionally from 0 to 1,  acting as a kind of percentage along the curve [10:21] But in this case, our parameter  range has to extend across all curves [10:27] If you look at the full input range, we can  easily map each curve to each whole number [10:32] So let’s define a u-value, the  input parameter for the whole spline [10:37] The integer part can then  represent the curve index [10:40] and the fractional part, the local  t-value for each individual curve [10:47] And so now, we’ve defined  a simple method to create, [10:50] shape, and move along a set of cubic bézier curves [10:54] This is now getting a little more complex, [10:57] so let’s make sure we’re on the same page  about what all of these elements are called [11:01] The input u-value, is in a one-dimensional  space called parameter space [11:08] The points we define, are called control points [11:11] A spline then generates individual  curves based on those control points, [11:16] where each curve is effectively  using its own math function [11:21] These curves meet end to end  at points called joins or knots [11:25] Note that in this case, the joins  happen to also lie on control points [11:30] but this is not always the case [11:33] Each curve is then assigned an  interval in the input parameter space, [11:36] that helps us associate any  given input u value to a curve [11:41] The values here are called knot values [11:43] and the distance between them, knot intervals [11:46] In this video, we’ll be  focusing on uniform splines, [11:49] where all of our knot intervals have the  same length, in this case a length of 1, [11:55] making it very easy to map each  curve to the unit interval of 0 to 1 [11:59] Non-uniform splines, where  the knot interval varies, [12:03] are significantly more complicated,  so let’s save that for a future video [12:08] Now, we wanted to use this to create  a road from one town to another [12:11] but, we struggled to get it  to work with a single curve, [12:15] because we didn’t have local  control, among other things [12:18] So, has our spline fixed these problems? [12:22] Well, if we map the basis  functions into our parameter space, [12:25] we can analyze the weights, to  see if we now have local control [12:29] If you look at the influence  of this control point, [12:32] it lies entirely within  the span of the third curve [12:37] What this means, is that if  we move this control point, [12:40] only that span will be affected, leaving  the rest of the spline completely unchanged [12:47] If we look at this point, you can see  that its influence is twice as large, [12:53] which makes sense as two curves share this point, [12:56] but it still doesn’t span further  than those two curve segments, [13:00] and so we still have local control, again  leaving the rest of the spline unchanged [13:07] So with the cubic bézier spline,  we’ve regained local control! [13:12] Not only that - but because  we’re using cubic béziers, [13:15] it doesn’t actually get any more  expensive by adding more points [13:20] We’re effectively just sampling one cubic bézier, [13:23] even though the path is  much longer and more complex [13:37] So compared to the higher-degree  bézier curve, it’s cheap! [13:42] Finally - if we look back at our  original set of control points, [13:45] we don’t just pass through  the start and the end anymore [13:47] We now pass through every third point, [13:50] which means its significantly easier  to create whatever shape you want [13:57] In other words, it’s now  interpolating every third point [14:04] It’s, really no wonder why the cubic  bézier spline has become so loved [14:08] It really gives you a huge amount of control [14:10] You can make, pretty accurate circles  with it (though not actual circles) [14:15] You can be a little cheeky  and place the middle two [14:18] points exactly thirdway to make linear segments [14:21] It’s the spline used when doing vector graphics, [14:24] especially in font rendering,  or Photoshop’s pen tool [14:28] The key to the undeniable flexibility of  the bézier spline, lies in the arrangement [14:33] of the two control points next to the curve  joins, sometimes called the tangent points [14:38] They have three common configurations,  all with different properties [14:42] One is the split tangents, that you can use to  make sharp corners, also known as broken tangents [14:50] The second one is where you align the  three points around the curve join [14:53] This ensures the two curves are  tangent with each other at that join [14:58] Finally, you can also mirror the  tangent points around the join, [15:01] making them not only aligned, but also the  same distance from their shared control point [15:07] With all these tools in mind, we can now easily  create paths, and animate objects on it, right? [15:16] Although, something seems wrong. Look at how they  move across the curve joins, especially this one. [15:23] It seems to suddenly change velocity. [15:28] And so this, is where we need to talk  about a concept, called Continuity [15:34] Continuity is a measure of  how “connected” the curves are [15:37] As you can see, these curves are connected! [15:40] The curves meet at the joins,  and so we can give this a name [15:44] This spline is C⁰ continuous [15:48] If we separate these curves,  it’s no longer continuous at all, [15:51] and so it’s no longer C⁰ continuous either [15:55] So what continuity means is that  position changes continuously, [15:59] there’s no sudden jump, or  discontinuity, in this path [16:04] But, we noticed something was wrong with  the way our cubes were moving across joins [16:08] They appeared to make little “jumps” in speed [16:12] And any time you want to analyze change,  it’s worth looking into derivatives [16:17] Remember the matrix form of the cubic bézier? [16:21] One very nice feature of this form, is that  calculating the derivative is trivially easy [16:26] All we need to do is to differentiate the  powers-of-t matrix, using the power rule [16:32] Now, this might seem a little abstract, what  is the derivative of a curve in 2D space? [16:36] Well, a more common name for the first derivative  of position with respect to time, is, velocity! [16:43] The second derivative is called acceleration [16:45] The third derivative is  called the lesser known, jolt [16:49] Now that we know how to calculate the  velocity, let’s see how it behaves in this path [17:00] Did you notice how it “jumps” at every join? [17:04] The length changes, in other words [17:07] There’s a discontinuity in speed [17:11] We can make this even more explicit  by drawing the graph of the velocity [17:14] Notice what happens at every join [17:25] The [17:26] velocity graph is discontinuous! [17:31] It’s disconnected at every join [17:37] So even though we aligned our tangents,  there’s a sudden change in speed [17:43] Now watch what happens to the  velocity graph if we make these [17:46] tangent points mirrored, instead of just aligned [18:07] The velocity around the curve is now continuous! [18:12] There’s no sudden jump anywhere anymore [18:15] This curve is now, C¹ continuous,  because both its position, [18:19] and it’s first derivative, velocity, is continuous [18:24] Now, for continuity to be valid, all previous  derivatives have to be continuous too [18:29] Every C¹ continuous path is also C⁰ continuous [18:34] If we disconnect these curves in position,  it’s neither C⁰ or C¹ continuous anymore, [18:39] even though the velocity is  still continuous in and of itself [18:43] The discontinuity in position prevents it from  being classified under any continuity class [18:49] But why does mirroring the tangent  points make it C¹ continuous? [18:55] This is where looking at the algebra is helpful [18:59] First, let’s label our points. [19:01] Now, C⁰ continuity is trivial [19:04] these two curves share the  point P₃ so that’s already done. [19:09] C¹ continuity seems to happen when  the tangent points are mirrored [19:13] Notice how when we move them, the  velocity becomes discontinuous [19:17] So, to write this algebraically, this  is the condition that has to be met [19:22] The velocity at the end of curve A, where  the input t-value is 1, has to be equal to [19:28] the velocity at the start of curve  B, where the input t-value is 0 [19:32] You can plug in the equation here for  the bézier curve, and solve for P₄ [19:37] I’ll spare you all the algebra,  but, this is what you end up with [19:41] which is what we would expect! [19:42] P₄ is now equal to P₂ reflected around P₃ [19:47] In other words, it’s mirrored [19:50] Now, I’ve made P₄ grayed out,  as we’ve actually lost a little [19:54] bit of control now if we want  this join to have C¹ continuity [19:58] because P₄ is now fully determined by P₂ and P₃ [20:02] but, it’s a little sacrifice we’re willing to make [20:05] Notice how the velocity stays  continuous no matter where we move P₂ [20:11] One would hope that C¹ continuity could  fix all of our issues with animation [20:15] we’ve clearly improved it by  removing that velocity discontinuity [20:20] but there’s still a more subtle thing going on [20:23] Let’s take a closer look [20:29] Can you see how the boxes suddenly and harshly  starts turning in the other direction here? [20:34] The only way for something to change  direction, is through acceleration [20:38] so let’s investigate how it  changes across this spline [20:47] We can already see that we  have another discontinuity [20:49] it makes a huge jump at the join [20:52] As you can see in the graph, it’s discontinuous [20:55] So, again, let’s write our acceleration  continuity constraint explicitly [21:00] For C² continuity, the acceleration  at the end of curve A, has to equal [21:05] the acceleration at the start of curve B [21:08] Skipping all the intermediate  steps, this is what we end up with! [21:13] Geometrically, we can interpret this as, P₅  should be placed at the vector from P₂ to P₃ [21:19] originating from P₁ [21:21] multiplied by 4 [21:24] P₅ is now fully constrained by P₁ P₂ and P₃ [21:29] If you’re familiar with constraints,  you might have already spotted a problem [21:33] But, this works! [21:35] If we change the shape of the  first curve, the position, [21:38] velocity and acceleration are all continuous, so  we successfully joined béziers with C² continuity [21:46] or, did we? [21:49] Something very bad is about to happen [21:52] Here’s what’s up: [21:53] We’ve been talking about ensuring  continuity around the join at P₃ [21:58] But in order for us to make  the entire spline C² continuous [22:02] we need to also apply these continuity  constraints around the other joins [22:07] P5 will now determine the position of P₇  because again, mirrored tangents for C¹ [22:11] The same applies to P₁₀ [22:15] For C² continuity, P₄ P₅ and P₆  now control the position of P₈ [22:24] And P₈ P₉ and P₇ controls the position of P₁₁ [22:32] We… don’t seem to have a  lot left to control, do we? [22:37] Now watch what happens if we move a  single point, even just a tiny bit [22:48] As you can see, it yeets off to fucking wherever,  making it absolutely useless as a spline [22:56] But!! it’s very very smooth! [22:58] Look at how smooth this movement is! [23:01] At least personally, as someone who has  been staring at these things for a year [23:05] there’s something mesmerizing about C² continuity [23:15] Let’s also look at the acceleration [23:19] Now this actually has grave  implications for cubic béziers [23:23] You can’t make a cubic bézier C² continuous, [23:27] it is, literally impossible,  without losing local control [23:31] And, having that control is the whole  point of using splines in the first place! [23:36] Our beloved cubic bézier has betrayed us :( [23:40] it was so useful for creating shapes, [23:42] but now we’ve discovered this  huge flaw in its construction [23:46] But, because we’re all curious  cats, we have to ask ourselves, [23:50] what happens if we go to C³ continuity? [23:53] And so, same thing here, the third  derivative at the end of curve A [23:57] has to match the third derivative  at the start of curve B [23:59] This is now getting significantly more messy [24:03] The geometric interpretation is  almost useless at this point but [24:08] we’re basically taking the vector from P₀ to P₃ [24:10] adding it to P₃ [24:11] then we take the vector from  P₂ to P₃ and from P₂ to P₁ [24:15] add those two together [24:16] add it to the first vector [24:17] and multiply it [deep breath] [24:20] by 6 [24:20] Long story short, the position of P₆  is now determined by P₀ P₁ P₂ and P₃ [24:28] Our problem of losing local control  has now reached its worst case [24:32] We don’t have control over P₉  anymore, and the same goes for P₁₂ 😔 [24:38] The curve is now even more  sensitive to the initial conditions [24:41] a tiny movement of a control  point in the first curve, [24:45] will massively throw the rest of the spline around [24:49] In fact, we’ve lost so much control, that  this can’t even be called a spline anymore [24:54] it’s actually equivalent to simply  extrapolating the first curve, [24:59] by increasing our t-value beyond 1 [25:03] And since this is now just, one  curve, not only is it C³ continuous [25:08] it’s actually C∞ because there are no joins  anymore, all derivatives are connected [25:17] To summarize - in a cubic bézier, when the  tangent points are mirrored, we have C¹ continuity [25:25] When we have a broken join, the velocity is no  longer continuous, so it’s only C⁰ continuous [25:31] When the curve is entirely disconnected,  there’s no continuity at all [25:36] An important thing to remember, [25:38] what we’ve been focusing on is the  continuity at the join between curves [25:42] because every other point on the curve,  is C∞, as they use the same function [25:48] For a more formal definition, two functions A, [25:52] and B, are Cⁿ continuous, if the 0ᵗʰ through  the nᵗʰ derivative are all equal at the join [26:00] This, is called, Parametric Continuity [26:04] Continuity is absolutely central  to the discussion of splines, [26:07] and it’s actually the primary motivator for  investigating multiple different types of splines [26:12] But, we’re not quite done yet with continuity, [26:15] because there’s a different type of  continuity lurking in the shadows [26:21] So we now know, mirrored  tangent points are C¹, alright [26:25] broken tangent points are C⁰ [26:27] but, what about aligned tangent points? [26:31] Clearly, there’s some kind of  continuity we care about here [26:35] Even if it has a sudden speed change [26:38] If we’re using these for vector graphics,  we don’t really care about “speed” [26:42] we only care about the shape it creates in the end [26:45] This is exactly what Geometric  Continuity is all about [26:51] When we look at the velocity, sure, it  might have this sudden jump in length, [26:55] which, in this case is a change in speed [26:58] but again, what if we don’t care about speed? [27:01] What if we only care about the shape? [27:04] To analyze this, we can get the tangent vector  by simply normalizing the velocity vector [27:09] in other words, forcing it to have a length of 1 [27:13] Let’s also throw in the normal vector [27:15] because it’s trivial to calculate in 2D, and  it helps us visualize this a little better [27:24] Now, this is, perfectly continuous, right? [27:28] the change in speed has literally  no effect on our tangent and normal [27:34] This is called Tangent Continuity,  and we’re going to call this G¹ [27:39] At this point, you probably  know where this is going right? [27:42] That 1 next to the G is practically  begging us to investigate [27:46] what is G²? [27:47] This is not just a mathematical curiosity, [27:51] G² continuity is actually  crucial in industrial design [27:54] especially for shiny things  like car bodies or phones [27:58] and perhaps a little sneakily,  the shape of the apple app icon [28:03] In order for us to analyze this, [28:05] we’re gonna have to enter the third  dimension, and turn on the lights [28:11] What we’ve got here, is a perfectly reflective  surface, which will help us analyze the geometry [28:18] If we look closely, we can see  that, something is, wrong here [28:24] Our tangents are perfectly aligned [28:27] and yet, somehow, there’s  a seam in our reflection! [28:30] Isn’t it enough to just, align the tangents? [28:34] Clearly, it’s not [28:35] And if we change the background to these dots, [28:38] it’s made even more clear  just how discontinuous this is [28:51] This doesn’t just apply to bézier curves [28:56] A perhaps unexpected place  where this problem occurs [28:59] is when you join circular arcs to flat segments [29:03] Here too, we see this extremely  sharp discontinuity at the seam [29:10] And again, the dots will  make an even stronger case [29:17] And there’s no trick [29:22] here! These are perfect, circular arcs [29:30] But they too, only join with G¹ continuity [29:33] which might be a little unexpected, since we  often think of circles as this ideal smooth shape [29:39] So what is going on here? [29:40] First, let’s look at the tangent directions [29:46] Now, they have quite a bit of overlap, so,  for clarity let’s use the normals instead [29:52] Now watch how they change as  we move them across this path [29:57] You might notice they suddenly start  and stop rotating at the joins, [30:01] right where the circular  arcs meet the flat segment [30:09] The angle of the tangent vector can  illuminate this problem even more clearly [30:14] Notice how the angle is  changing at a constant rate, [30:17] then comes to a complete stop, and then  it suddenly and immediately starts again. [30:22] In fact, this is inherent to the nature of circles [30:26] Circles are the special case where the  angle is changing at a constant rate [30:31] and flat lines is the special case  where the angle doesn’t change at all [30:37] So how do we even begin to analyze this,  to find out more about G² continuity? [30:42] We need a parameter-independent, or,  speed-independent way to measure this [30:47] This, is where we need to talk about curvature [30:51] Given a point on a curve, there’s a circle  that describes the curvature at that point [30:57] This is called the osculating circle [30:59] You can think of it as, the circle that has  the same curvature as the curve, at that point [31:14] The radius of this circle, is  1 divided by the curvature! [31:19] Curvature can be calculated using  the determinant between the velocity [31:23] and the acceleration, divided by the speed cubed [31:27] The determinant up there  is a little confusing, but, [31:30] it’s equivalent to what is commonly  known as the “2D cross product” [31:34] or the perpendicular dot product [31:36] or, more accurately, it’s the  wedge product returning a bivector [31:40] but, that’s a topic for another day [31:44] So what does the curvature  look like across this spline? [31:47] Let’s travel along and see [31:56] There are a few interesting  observations we can make [32:04] The first is that, even though  a point is only C⁰ continuous [32:08] it’s possible to make the  curvature continuous at that point [32:13] The second is that, even if a join is C¹, that  doesn’t guarantee us curvature continuity either [32:19] And of course, it’s especially bad in the  middle, where there’s a huge jump in curvature [32:24] A very popular way to analyze curvature, is  using this handy tool, known as a curvature comb [32:33] Let’s again focus on a single  join, between curve A and B [32:38] The curvature comb grows larger,  the tighter the curve turns [32:43] and the more flat the curve  is, curvature approaches 0 [32:48] Now, we know that in order for us to have G¹  continuity, we have to align the tangent points [32:54] In mathematical terms, this means  P4, has to be a vector starting [32:59] from P₃ in the same direction as  P₂ to P₃ scaled by some value! [33:06] This means we have one degree of freedom, [33:08] because this variable β₁ can be any positive value [33:12] If it’s 1, the tangents are mirrored,  while any other value scales it [33:19] You might notice that the curvature comb isn’t  lining up - so this is still only G¹ continuous [33:26] Now, deriving the math for this next step is, [33:30] significantly more complicated than  for the parametric continuity, but [33:34] long story short, we now constrain P₅, but we also  end up with another degree of freedom, called β₂ [33:41] Now watch what happens to the curvature  comb as we apply this constraint [33:47] It’s aligned! [33:49] And we actually have two degrees  of freedom to control this shape [33:53] No matter what values we set β₁ or β₂ to,  we’ve successfully made this join G² continuous [34:03] And of course, we can also move the control  points, and the constraint still holds [34:08] Now, the problem is again that, even though  we have a few more degrees of freedom, [34:12] we have the same cascading problem of  losing control over the entire spline [34:18] But, did it solve our problem  with shiny reflections? [34:22] well, yeah, looks like does! [34:25] It wasn’t enough to have a continuous  tangent direction across this join, [34:29] we also needed curvature continuity to  get rid of the seam in the reflection [34:34] It will even pass the harder, dot pattern test [34:39] This is why G² continuity is very  important in industrial design [34:43] as anything shiny will respond very  strongly to the shape of the curves [34:57] G¹ is when tangents are continuous [35:00] The curvature comb will also be aligned  with itself across the normal of the curve [35:04] G² is when curvature is continuous [35:07] The curvature comb is now continuous in  and of itself, as you can see, it connects [35:12] Surfaces that are G² or higher, are  sometimes called Class-A surfaces [35:17] G³ is when the rate of change  of curvature is continuous [35:21] The curvature comb will be, in  and of itself, tangent continuous [35:26] Usually, you don’t go higher than G³, as  you get very diminishing returns in outcome, [35:31] and the math becomes significantly  more unwieldy for each step [35:36] So this, is called Geometric Continuity [35:40] A more formal definition of geometric continuity  is actually pretty tricky to come up with [35:46] but one that I like, is that  if you have two curves A and B [35:50] they are Gⁿ continuous, if a function g(t)  exists, so that A(t) and B(g(t)) are Cⁿ continuous [36:01] It’s kinda hard to wrap your head around, but, [36:03] it basically means that if  we have full control over the [36:05] parameter/speed at which we change  the t-value of one of the curves, [36:10] if it’s possible to make them line up into Cⁿ  continuity, the original curves are Gⁿ continuous [36:18] It might seem like a lot to take in, but I  can’t stress enough just how important this is, [36:23] continuity is what justifies the  existence of a whole host of splines [36:28] Let’s summarize it all [36:30] C⁰ and G⁰ are equivalent, and they  are both positional continuity [36:35] It basically means your curves  are simply connected in position [36:39] C¹ is velocity continuity [36:41] as in, the first derivative is continuous,  and, the position is also continuous [36:46] In other words, it’s not enough for the  velocity to be continuous on its own [36:50] the previous derivatives  have to be continuous as well [36:53] G¹ is tangent continuity, which also  requires that it has positional continuity [36:58] And, this same pattern continues [37:01] C² is acceleration continuity, which  also implies velocity continuity, [37:05] which also implies positional  continuity. You get the idea [37:08] C³ is jolt continuity [37:10] G² is curvature continuity, which  again, implies the previous ones [37:14] Finally, we have G³, which, in my opinion,  is incorrectly called “torsion” continuity, [37:20] it’s also sometimes incorrectly  called acceleration continuity [37:23] I don’t know of a good name  for this unfortunately, [37:26] but it’s effectively referring to  the rate of change of curvature [37:29] And so on! We can go on forever, until C∞ and G∞ [37:36] Now, just like all the parametric  continuities include all previous levels, [37:41] and geometric continuity includes  all their previous levels, [37:45] there’s another connection here [37:47] C¹ continuity is also necessarily G¹ continuous [37:51] If you remember, mirrored  tangent points are also aligned [37:55] Effectively, G-continuity is  less strict than C-continuity [37:58] so the C continuities actually imply their  corresponding geometric continuity as well, [38:04] but, not the other way around [38:05] …generally [38:08] before someone comments going “well  actually”, I have to throw in a little caveat. [38:12] This implication only applies  if the curves are regular [38:18] Now this is a bit of a, math moment, because of  course “regular” has a particular meaning here, [38:23] that isn’t the regular meaning of the word [38:26] A regular curve is one where  the velocity is never 0 [38:30] In other words, it never stands perfectly still [38:33] In fact, if we let this happen, a lot of our math  we’ve been talking about breaks down completely [38:39] Both getting the tangent direction,  and calculating the curvature, [38:43] divides by 0 if there is a point with 0 speed [38:47] It’s relatively hard to create a curve with  this pathological behavior, but, not impossible [38:52] For example, take this bézier curve [38:55] If we place the tangent points at this exact  location, we’ve created a point with 0 speed [39:02] The curve is fully continuous, but  watch what happens to the tangent [39:08] It instantaneously flips, which  means it has a tangent discontinuity [39:16] This is called a cusp, and it’s one  of those rare exceptions where the [39:20] curve is C∞ but only G⁰ continuous, at this point [39:25] We’ve only been talking  about Bézier splines so far [39:29] but now that we’re equipped with this  extremely powerful tool to analyze continuity [39:33] I think it’s time to visit the other  splines in the extended universe [39:41] While the bézier curve is useful, its  points are pretty, strange, are they not? [39:47] They don’t really refer to anything  specific, except the start and the end point [39:52] What if, we can come up with another type  of spline, that makes more physical sense? [39:57] What if instead of supplying 4 points,  we set the start and end point, as usual [40:01] but then, we also set the start and end velocities [40:06] Another way of looking at it - we’re  supplying the boundary in position and [40:10] the boundary in velocity, and then  solving for the connection between [40:14] This could be really useful when  simulating physical objects, [40:19] or even when interpolating  movement data across a network [40:22] This means we’ll have a spline that  automatically satisfies these constraints [40:27] It effectively auto-calculates the  acceleration and jolt, to make this curve [40:32] Coming up with this spline is  actually pretty straightforward! [40:36] As with any other math problem,  let’s list our known values, [40:39] and our constraints, and solve from there [40:41] The start of the curve should be at P₀ [40:44] The end of the curve should be at P₁ [40:47] The velocity at the start should be v₀ [40:50] The velocity at the end should be v₁ [40:53] 4 equations means 4 unknown  variables to solve for, [40:57] which means we can use a cubic  polynomial, solving for a, b, c and d [41:02] For example, one of them we can figure  out immediately just by looking at it [41:06] If the equation should give us P₀ when t = 0, [41:10] then a, b and c are all multiplied  by 0, this means that d has to be P₀ [41:16] The same goes for the derivative  when t = 0, c has to be v₀ [41:22] And so on! [41:23] I’ll spare you all the intermediate steps, [41:26] here’s what we end up with,  the matrix form of this spline [41:31] Now you might see the power of the matrix form [41:34] We now have the exact same setup where, [41:37] we have a powers of t matrix on the  left, and a point matrix on the right [41:41] and then the characteristic matrix in the middle, [41:43] giving us a kind of unique  fingerprint for this spline [41:47] Just like before, multiplying the  t-matrix by the characteristic matrix, [41:52] gives us the basis function for each control point [41:56] This is what our new spline segment looks like! [42:00] The cool thing about this one is that  there’s no more arbitrary tangent points [42:05] it’s a spline that guarantees  being at a specific place, [42:08] with a certain velocity, at every control point, [42:11] giving us a lot of control over  the animation across the spline [42:14] If we analyze the first derivative, the velocity, [42:17] you can see it matches at every point along  this spline, and it’s fully continuous [42:24] Though you might’ve noticed that the velocity  itself looks like it changes pretty harshly [42:29] so, let’s look at the rate of change  of the rate of change - acceleration [42:35] Here, you can see that we have  our first proper discontinuity [42:38] There’s an instantaneous change  of acceleration at each join [42:42] In other words, while this spline doesn’t meet  the criteria for C² continuity, it is always C¹ [42:49] This type of spline where you supply explicit  velocities at each point, actually has a name! [42:53] This is called a Hermite spline. [42:56] Or, I mean, if you’re French you’re  probably dying inside right now [43:00] technically I think it’s supposed to be  pronounced [bad french voice] Hermite [43:03] but nobody says it like that  okay so cut me some slack [43:06] Anyway, as you can see, the hermite  spline has explicit derivatives [43:10] And since both sides of each curve  join share the same velocity, [43:15] it is also by necessity C¹ continuous [43:18] It’s also worth noting - many hermite splines  out there allow for two velocities per join [43:23] one for the incoming curve,  and one for the outgoing curve, [43:26] allowing you to make C⁰ joins as well if you like [43:29] It’s also interpolating, it’s passing  through every point and every velocity. [43:35] Now, the hermite spline is actually very  closely related to the bézier spline [43:39] Converting between the two is trivially easy [43:43] If you divide each velocity by three, and add  its origin, you get the bezier tangent point [43:49] Flip that to the other side, and you now have  the bézier control point for the other side [43:54] This creates the exact same curve as the hermite  spline, but defined using béziers instead [44:01] This also tells us that the bézier tangent points, [44:04] correspond to exactly a third  of the velocity at the join [44:10] Next up is a spline we’ve been  neglecting this whole time, [44:13] which might be the most popular one out there [44:16] People just rarely call it a spline [44:18] The linear spline! [44:20] Simply, drawing straight lines between each point [44:23] And we might scoff at this shitty little basic  spline but it actually has a few superpowers [44:29] First, it’s passing through every control point! [44:32] No unnecessary bells and whistles,  just straight to the point [44:35] (no pun intended) [44:37] Second, it’s one of the few splines where  arc-length parameterization is easy! [44:42] Arc length parameterization is when you want  to interpolate a curve with a constant speed [44:46] which is actually very complicated  for almost all splines out there [44:52] Third, it’s very cheap to evaluate!  Here’s the formula, it’s just a lerp [44:58] But, unfortunately, it’s only ever C⁰ continuous [45:03] This property of passing through every  point you supply is very useful though [45:09] so we might ask, is it possible  to make a smoother spline, [45:12] that will pass through them all,  without having to specify derivatives? [45:17] One method, is to use a similar  strategy as the hermite spline [45:21] but instead of supplying the velocities ourselves, [45:24] what if we calculate them  based on neighboring points? [45:27] We simply draw a vector between the neighboring  points, and use that as our velocity [45:33] And we repeat this process for every point [45:35] Look at the neighbors, form a vector,  use that as our velocity, and so on. [45:45] This is the curve we get [45:50] Now, it’s not, perfect, there are a few problems [45:54] First, it doesn’t actually  pass through the endpoints, [45:57] because they’re missing one of their  neighbors to calculate a velocity from :( [46:02] But, we can sort of, pretend  we have an extra point, [46:05] that’s just the second adjacent point mirrored [46:08] This lets us extend the curve to the endpoints [46:11] And we do the same for the last point [46:13] mirror the second last point around the  last one, to create this, ghost point [46:17] The second thing we might  notice, is that the shape is, [46:21] kinda weird isn’t it? No offense to this  spline of course but it’s rather, lumpy [46:28] For example, this part right here is very flat [46:32] And this part, has a pretty  sharp turn around flat sections [46:38] A good tool for analyzing  this is the curvature comb [46:42] We can now clearly see the radical  change in curvature across this spline [46:47] this sharp turn now has a very clear bump [46:50] and this flat section very clearly has curvature  drop to almost 0, meaning it’s linear, or, flat [46:57] Maybe it’s a good idea to find some way to  mitigate these sharp turns and flat sections [47:03] What if we apply a scale  factor to all these velocities? [47:07] Just, scale them all down by some value [47:10] You can see the curve becomes much more relaxed [47:13] And as we continue, it actually  approaches the linear spline [47:19] So with this scale parameter, we have a lot  more control over the sharpness of the curve [47:24] Bringing back the curvature comb,  you can see that with a low scale, [47:27] the curvature is extreme at the joins, and  quickly flattens along most of the segments [47:32] Increase the scale, and the  curve becomes much more relaxed, [47:36] before getting a little  bumpy again at a scale of 1 [47:42] This type of spline with automatic tangents, [47:45] a scale parameter, and interpolating  all points, is called a cardinal spline [47:51] Here’s what its matrix form looks like! [47:54] As a side note, when you read  up on cardinal splines online, [47:58] usually they call this scale “tension” [48:00] but there’s no consensus on  how to apply this tension value [48:04] I’ve found three different  methods across the internet [48:07] so I’m just giving up, and calling it scale [48:09] because I think this is the most computationally  efficient way to define it anyway [48:15] The cardinal spline however, is usually  overshadowed by a closely related spline [48:21] When we set the scale to exactly ½, the  spline looks, unusually relaxed, doesn’t it? [48:29] There’s no super flat sections, and no super  sharp turns where it doesn’t feel justified [48:35] It’s a very, comfortable spline,  where you pass in some points, [48:39] and it “just” smoothly passes  through without too much effort [48:43] This is one of the most popular splines  in game development for this reason, [48:47] and it’s called the catmull-rom spline [48:50] It passes through every point (except the  endpoints that kind of need special handling) [48:56] As for continuity, the curvature  comb tells us it is G¹ continuous [49:02] Let’s also look at the parametric continuity [49:05] The first derivative is fully continuous [49:07] The second derivative however, is not connected,  you can see there’s discontinuities here, [49:14] so in the end, the catmull-rom  spline is C¹ continuous [49:19] And there’s no need to specify  tangents, it “just works” [49:24] Of course, we can work out the  matrix form of the catmull-rom [49:27] as well, letting us see its unique  fingerprint, and its basis functions [49:33] Let’s actually take a closer  look at these basis functions, [49:36] because they very clearly illustrate  their relationship with these points [49:41] Remember - the basis functions  say how much every control point [49:45] should influence a given point in the curve [49:48] and so if we arrange them a little  differently, it’s now easier to tell [49:51] how this represents the influence of a  single point, across 4 curve segments [49:57] To highlight this, let’s focus  on one point, and its influence [50:02] The white section is where the point is  pulling on the curve with a positive influence [50:07] while the red section is getting pushed away  by the point, as it has a negative influence [50:16] And this is how every control point behaves [50:19] Every point has its own wave like this, [50:21] telling us how much it should  influence each part of the spline [50:30] This is what the full spectrum looks like [50:34] These influences then work together,  to carry a point across the spline [50:40] Each point has a peak, where it  has 100% influence, guaranteeing [50:45] that the point on the curve will be at  the same location as the control point [50:48] and then its influence will drop  off, letting the next point take over [50:55] A really neat thing is that we can analyze these  basis functions on their continuity directly [51:02] We can tell that this one is  continuous, because all curves meet, [51:05] and the ends are meeting with the x  axis line, and so C⁰ continuity is met [51:11] And what about the derivative  of these basis functions? [51:16] They are also continuous [51:18] so we’re at least C¹, which we would expect [51:22] The second derivative,  however, has discontinuities, [51:25] you can see how there are gaps in the  graph, so we’re still not C² continuous [51:31] And isn’t this a little frustrating?  we’ve explored all these new splines, [51:36] and yet we’re still stuck in C¹ continuity land [51:39] Is there really no way to make a C²,  an acceleration continuous, spline? [51:46] Well, the best way to test this, is to  try doing it yourself. In other words, [51:50] you know, fuck around and find out [51:53] Remember, the fingerprint of a cubic spline,  is the characteristic matrix in the middle. [51:57] The challenge now is to find the 16 unknown  values, to make a C² continuous spline. [52:05] This means, we need 16 equations to solve  this, and let’s see if we can make it work! [52:11] The end of the first basis function  has to be C² continuous with the x axis [52:16] That’s 3 equations [52:18] The join between the first two  basis functions, also has to be C² [52:21] So 6 equations [52:24] We want a C² join between  the middle basis functions [52:27] Nine equations [52:29] C² join between last two basis functions [52:32] 12 equations [52:34] The start of the last basis function  has to be C² with the x axis [52:38] 15 equations [52:41] We, did it, right? kinda? sort of? [52:44] We’ve actually fit all of  our constraints in, right? [52:48] But, we need one more constraint, right  now we have one degree of freedom. [52:54] Luckily, we are actually missing one more thing [52:57] The basis functions all have to add up to 1,  because they are used as a convex combination [53:04] 16 equations, 16 unknowns, this is now solvable! [53:08] I’ll be skipping the steps involved in  solving this system of 16 equations, [53:13] but, just trust me that it’s possible~ [53:16] And so now, instead of the  catmull-rom basis functions, [53:19] this is what our new basis functions look like! [53:24] This, looks, really really  smooth, I think we’ve done it [53:29] This should be a cubic C² continuous spline, [53:32] where these are the values we end  up with in our characteristic matrix [53:37] And now, the big question -  what does this spline look like? [53:41] Well, it looks like this [53:45] This might be, a little surprising [53:48] This is the first time the curves  don’t actually meet at control points [53:53] The curves and their joins are  completely outside of the control points. [53:59] But what about continuity? This was, after all,  our goal (to make a ridiculously smooth spline) [54:07] If we look at the curvature  comb, it seems G² continuous! [54:12] The comb is aligned and connected across  the joins, no matter what shape we use, [54:16] so our geometric continuity is looking really good [54:20] We can also tell it isn’t G³ continuous, since  the curvature comb itself isn’t tangent continuous [54:27] Remember, when we tried to force the bézier spline  to be more continuous, we lost local control? [54:33] Moving any one control point, affected the  rest of the spline under those constraints. [54:38] But for this spline? We’ve still got local control [54:41] over all the control points,  and, keeping continuity intact! [54:46] So, the geometric continuity of this spline, is G² [54:51] How about parametric continuity? [54:53] Well, we know it’s at least C⁰, but did we  manage to make it C² continuous as well? [54:59] Let’s analyze it using animation this time! [55:02] If we notice any sudden  jumps, we have a discontinuity [55:06] The first derivative, in other words, the  velocity vectors, are all looking very smooth! [55:11] There are no sudden jumps as they pass the joins [55:14] So, this spline is at least C¹ continuous [55:18] Next up is acceleration! [55:20] I like to think of the acceleration vectors  as “pulling” on the velocity vectors [55:25] and so I will draw them at the  tip of each velocity vector [55:28] And let’s see if we notice any sudden jumps. [55:32] Again, the arrows never make  any instantaneous change! [55:37] This means we succeeded - we  finally have a C² continuous spline! [55:44] possible it’s C³ continuous too? [55:45] Well, that would be impossible, since the  geometric continuity would have to be at least G³ [55:52] but if you’re curious, this is  what the jolt vectors look like, [55:56] pulling on the acceleration vectors [55:59] As expected, this is where we have our first [56:03] discontinuity - the jolt vectors  jump as we pass across the joins [56:11] So this soft little spline, while  it’s not interpolating, like, at all [56:16] it is actually C² continuous [56:19] The reason this is possible is because  we sacrificed the interpolating property, [56:24] in favor of acceleration continuity [56:27] Of course, this spline has a name! [56:30] it’s called a B-spline, short for Basis Spline [56:34] Now that we’ve been looking at these  for a while, it’s time for a quiz [56:40] What spline is this? [56:44] It might be hard to tell [56:46] It requires an unreasonably, actually  impossibly keen eye to determine [56:52] But clearly it’s a bézier right? [56:53] You can practically see the control  points just by looking at it [56:57] or hm wait maybe it’s a hermite spline? [57:00] like you got the velocities and all [57:02] or I guess it could be a catmull-rom [57:04] passing through the points like that [57:07] no wait it’s obviously a B-spline,  look at how smooth this shape is! [57:12] or, what if it’s, a trajectory! [57:14] with a starting point, initial velocity,  initial gravity, and a change of gravity! [57:20] It’s the path in space with a changing  gravitational pull, traversing for one second [57:26] That’s what this is [57:28] Look we can even do the  matrix form for trajectories! [57:31] which, personally I think is super cool in  and of itself, but, that’s a bit of a tangent [57:37] So, what’s happening here, trick question aside, [57:41] is that, all of them can  generate this specific curve [57:44] Because all of these individual spline segments [57:47] we’ve been talking about,  are actually very similar [57:50] First, they are all uniform! They presume  you want to interpolate in a 0 to 1 range [57:57] Second, they are all cubic  polynomials. They all fit this formula [58:03] So, if they can generate the same curve,  what’s even the point of different splines? [58:09] So what I want you to keep in mind, is that, [58:11] curves themselves are not splines!  they are generated by splines [58:16] it’s all about how multiple curves, connect,  and how smoothly they are able to do so [58:23] What splines really describe, is  a transformation of control points [58:28] Given some control points, you  use a spline, to generate curves [58:34] If you swap out the spline, but keep the  control points, you get different curves [58:40] I want you to think of splines as curve  generators, that make certain promises [58:45] about continuity in the curve joins, and  how it treats the input control points [58:50] So it’s not just about the end result,  but the process you used to get there [58:55] You know as they say, “it’s about  the journey, not the destination” [59:00] except it’s still a little bit  about the destination too, but, [59:03] you know what I mean I’m trying to  make some sort of circular compos- [59:05] To summarize the family of  splines we talked about today [59:08] The Bézier spline gives us  a huge amount of control [59:11] It lets us create sharp corners, in other  words, intentional tangent discontinuities [59:17] Which is very useful when defining shapes like  fonts or vector graphics, such as this heart [59:25] Hermite splines let us  define explicit derivatives, [59:28] guaranteeing it will pass through  its points with specific velocities [59:33] This is the most common spline for animation, [59:35] and its the basis for the animation  curve editor in Unity, the game engine [59:40] For example, let’s say we want  to animate a jumping square [59:44] We can model its vertical position over  time using a non-uniform 1D hermite spline [59:50] Remember, non-uniform means the time  interval between joins can vary, [59:54] which is a little bit more complex than  the uniform hermite we talked about today [60:00] Anyhow, this lets us animate it! [60:02] We can use another spline to make it do a  little flip, by changing its angle over time [60:12] Let’s also animate its scale to  make it all squishy and goopy~ [60:25] The Catmull-Rom is the easiest way  to “just” smooth a set of points [60:29] when you want it to automatically  calculate the velocity, which is very [60:33] useful for path smoothing, where passing  through exact points can be important [60:39] The B-Spline guarantees C² continuity, and so  it’s the most popular spline in industrial design [60:46] as it allows you to design curvature sensitive  reflective surfaces without losing local control [60:51] In addition, some animations  are also acceleration sensitive [60:55] such as the movement of a camera, [60:57] where instantaneous changes in  acceleration look pretty jarring [61:11] The linear spline is not very smooth, but  in some cases it either doesn’t matter, [61:16] or, you have so many control points  that it appears smooth in context [61:21] For example, if you need to draw a curve  in a youtube video about about splines [61:25] the easiest and most practical solution  is to simply sample the curve densely [61:30] enough so that it looks smooth,  when drawing it as a set of lines [61:35] Now, we’ve only really scratched  the surface of this enormous topic [61:41] In this video, we’ve mostly been talking about  a specific subset - uniform cubic splines [61:46] All of these have counterparts of higher degrees [61:50] All of them also have non-uniform variants,  like the non-uniform hermite spline we just [61:54] used for the jumping box animation, where  you have full control over not only the [61:58] position and velocity at the control points,  but also the time at which it should reach it [62:03] Or the non-uniform catmull-rom which has  some interesting geometric properties [62:07] when you set the knot intervals based  on the distance between the points. [62:11] And while the uniform B-spline we looked  at earlier was useful in its own right, [62:15] if we allow changing the time or knot  values, we get the non-uniform B-spline [62:22] All the continuity promises of  the B-spline are still intact, [62:25] but each curve in the spline will now use  unique basis functions, based on the knot values [62:31] This, in turn, affects the shape of the spline too [62:35] There’s an even more advanced variant,  called the non-uniform rational B-spline, [62:39] that lets you control the priority,  or, weight, of each control point [62:43] making the curves gravitate toward  or away from specific control points [62:49] You might even have heard of this one before [62:52] it’s more commonly known by its short name [62:54] NURBS [62:56] And, remember the color gradient  in the beginning of the video? [62:59] Well, every color lives in the space of the RGB  cube, where the dimensions are red, green and blue [63:09] So every color key in a gradient, is a control  point of a linear spline, in color space [63:15] Then, if we want to use this  as a gradient map on an image, [63:17] instead of using time as our input, we use the  brightness of its pixels to sample the gradient [63:24] The output is then in full  color, based on our color spline [63:28] If we then move the control  points, in other words, [63:31] change the colors and time of our  keys, the output changes along with it [63:38] As you can see, splines show up in  many, perhaps, unexpected places [63:42] The whole field goes much deeper  than what we had time for today [63:46] but I hope you found this  little exploration of math [63:48] noodles interesting - and thank  you all so much for watching ❤ [63:54] I wanna give a huge shoutout to Jazz Mickle, for  the audio & music that she made for this video [63:58] I also wanna thank Thor and  Salad and Toast, our cats, [64:02] that, did a good job interrupting  me recording the voiceover for this [64:05] This here is salad [64:07] He's currently chasing Thor  which he's not allowed to do [64:11] He's being a bad boy [64:13] yeah [64:16] And then finally, I wanna thank all of you! All of [64:18] the patreon supporters that have  made this entire video possible [64:22] So thank you so much for supporting me. [64:25] I also wanna say that if you're not a supporter  on patreon, I think you should me! If you like the [64:29] work that I do. Patreon is also the,, it's like  the only platform, that only takes 5% of the cut [64:37] most other platforms take like 30% or 50%, which  is absolutely ridiculous, and so patreon is like [64:45] a really really good place to support work  in general, so I would really recommend that! [64:51] So, this video took, about a year to make.  A little bit over a year, I think, from, [64:58] starting research, to releasing it on youtube [65:01] I think the scope of this video was  way too big. I kinda realized that, [65:07] splines is a very big topic. Like there are so  many different avenues you can go, there's so [65:12] many different things you can talk about, and, I  kept like adding more and more stuff to the video, [65:17] and I always wanna go like into, in-depth about  every topic I talk about. And, it's impossible, [65:24] for this. I can't go too in-depth about splines,  because then the video is gonna be like, [65:29] 12 hours long, if I wanna cover everything that  I researched. And so, I think going forward, [65:35] I realized that, I should pick smaller topics!  Or, kinda plan from the beginning to make them [65:43] in chunks, instead of planning for making a very  long video. The initial goal for this video was [65:49] to make a video that starts with lerp, and ends  at NURBS, which, I guess I kind of did? Except [65:55] I didn't go into detail, how NURBS work. Because  we didn't really talk about non-uniform splines. [66:01] This project was, incredibly big. I think I got  like 3-4 months of work done, and then I burnt out [66:08] completely, and, I couldn't work on it. I just  couldn't. I started shutting down. I couldn't, [66:15] like, focus a single moment on, working on  this, for several months. Which was really [66:21] really frustrating, because, I'm someone who  really like, gets a lot of value out of being [66:26] productive and getting things done. And so it  was, very hard to deal with, and I think I'm [66:32] still recovering from it. I wish I'd picked  a smaller scope for this video, because now, [66:37] even though I'm happy it's the length  it is, and it has a lot of information, [66:42] at every corner of the video, I know that there  are things I'm leaving out that I really wanted to [66:47] talk about. But I just couldn't make all of those  animations and all of those ideas. I couldn't just [66:53] cram it all into this video, and so unfortunately,  it is "just" one hour long, and it only covers the [67:01] most popular uniform splines. But, I mean, I've  done all of that research, I've implemented all of [67:06] that in code, and so if I want to make a future  video about non-uniform splines, or NURBS, or, [67:12] specific other types of splines, I can do that.  And so I have the option in the future at least [67:18] Okay, so, I wanted to do a bit  of a, prediction game, this time! [67:23] As usual, youtube comments are the way they are,  and so I thought I'd, you know, now that we're at [67:30] the tail end of the video, where, statistically,  none of you are here. Like you who are watching [67:34] this, you are the exception. There's like a-  extremely- everybody's trailing off at this [67:40] point. And so you are like 1% or something.  And so I'd like to share with you, a little [67:47] bit of a thing we can see, if the chat (youtube  comments) is gonna get started talking about. [67:52] Here are my predictions [67:53] I predict that, someone is gonna correct me, or, [67:56] incorrectly correct me, about  how I pronounced "osculating". [68:01] In the bézier video, I said [ossu-layding]  for the osculating circle, I mispronounced it. [68:07] But people thought I said "oscillating", like,  the, O-S-C-I-L-L and so people kept correcting [68:13] me about that, and it was a nightmare for like,  several days, I just had notifications about that [68:18] forever and ever. And so I think now I'm gonna  get the opposite, now I pronounced it correctly, [68:24] and now people are gonna incorrect me, in  the comments. And so that's gonna be fun! [68:27] I think someone is gonna be like "oh your  should reduce the matrix form of the trajectory, [68:32] because you can simplify that diagonal  matrix". Someone is gonna do that [68:36] People are gonna think that my definition  of splines is either wrong, or, they're [68:40] gonna complain that I never accurately defined  what a spline is. I think this might happen, [68:45] I think a lot of people use the word  spline to mean different things, but, [68:50] hopefully I made my case for my definition. [68:52] Someone is gonna say, "you forgot to mention that  NURBS can make circles", which, I didn't forget, [68:59] I left it out, because I think it's an interesting  topic on its own, and so in the spirit of trying [69:06] to make shorter videos, this is a perfect,  bitesize topic to talk about in a single video, [69:11] and so I think I'm gonna talk about circular  arcs and splines in a video in the future. [69:15] And then there's a bunch of topics where, I  think people are gonna be like "you forgot [69:21] to talk about [this]" because they wanna  like, flaunt their knowledge about splines. [69:26] So I think we're gonna get people saying I forgot  to talk about natural splines, polar blossoming, [69:31] the DeBoor construction of the B-spline,  the A-frame construction, knot insertion, [69:36] degree elevation, knot multiplicity, the  β-spline, the kochanek-bartels spline (idk [69:43] how to pronounce it, it's something like  that), spiro splines, biarcs, and lagrange [69:47] interpolation, which, is not even a spline, but.. I think those are the things that people are gonna [69:52] think that I forgot to mention, but, I actually  just left them out, because I need to have, [69:59] a life, and not continue burning out. Let's say  we're just saving all of those for a future video. [70:05] Oh yeah another thing I also left out was that, I  spent quite a lot of time trying to invent my own [70:13] spline. I really wanted to end the video inventing  something new. And kind of, contribute to the [70:19] field, I suppose. That ended up almost happening.  I did make a spline, but, it had a bad shape. [70:29] It looked ugly. The point was that I wanted to  make a spline, that would pass through every [70:34] point, kinda like the catmull-rom, but it would  do that with C² continuity. The tradeoff was that, [70:40] I made it one degree higher, it was quartic  instead of cubic. And it, actually works? I [70:48] managed to make it pass through points with  C² continuity, but, it was just a bad shape, [70:54] it was like almost linear between the points,  and then it did a quick curve, and then it was [70:57] linear again between the other points, and so,  it ended up not being a very useful spline, [71:02] which, I was a little bit disappointed once I  finally solved it. And I could only work out [71:07] the uniform variant, not the non-uniform  variant. And so that's not in the video. [71:12] One thing that I noticed when making this is that,  I feel like I struggle to kind of find my voice. I [71:20] don't know what my cadence is supposed to be, or  how I should sound in a video essay. I do most of [71:27] my work livestreaming, and so, there, I sound much  more natural than I do reading a script. I think [71:36] I might be experimenting a little bit more with  that in the future, like changing the style of my [71:42] presentations or youtube videos I guess. I always  feel like my personality is not shining through, [71:48] when I make this type of video. Because the  script is so straight, I really think it's [71:53] missing so much of, me. And so I might change it  up a little bit, or I'll just learn as I go along [72:00] I guess. I just feel like my delivery is not,  interesting. I feel like it's very flat and, [72:07] objective, and lacking personality.  But we'll see, hopefully it's fine! [72:13] Oh, I also wanted to mention, a lot of  the work that I've done making this video, [72:17] I've been streaming it on twitch. I also do my  live lectures on youtube, and so if you wanna [72:28] watch a series on shader programming, if you're  watching this live, there's gonna be a series [72:33] on that next week, that I'm gonna stream  on youtube, so, be sure to check that out. [72:37] But otherwise, again, thank you so much for  watching this video. This was such a long journey. [72:44] I'm, again, I have ideas for shorter video in the  future. I have, I think I'm gonna make a video [72:51] about like a tiny topic, a topic like, "what  are radians?". That seems like a very bitesize [72:58] topic that I can then accidentally blow up to 30  minutes, but 30 minutes is a lot more manageable [73:04] than 1 hour, so, hopefully that's what's gonna  happen. Hopefully I'm not just gonna release one [73:09] video per year, I think I'm gonna try and increase  that frequency a little bit more by picking [73:13] smaller topics, but, again, thank you so much  for joining, and I will see you all next time!