Bezier / Catmull-Rom Splines

First appeared 1962 · Pierre Bézier, Paul de Casteljau — Bézier curves — Pierre Bézier (1962); de Casteljau (1959). · timeline ↗

community / folk Name — Descriptive: "spline" is borrowed from draughtsmen's flexible splines; the eponymous families are Bézier and de Casteljau (1962) / B-splines. The general term is descriptive.

In one line Classic methods for building smooth curves from a few control points — Bézier (control points pull the curve) and Catmull-Rom (the curve passes through the points). Used for ribbons, plant stems and flowing abstract line work.

Bezier / Catmull-Rom Splines · Open in new tab ↗ · Motion begins only when you press Run.

The code

The actual sketch behind the demo above — sandboxed and reproducible. This is the whole thing.

spline-curves/index.html
const SEED = Math.floor(Math.random()*1e9);

function setup() {
  randomSeed(SEED); noiseSeed(SEED);
  const s = Math.min(windowWidth, windowHeight);
  createCanvas(s, s);
  background('#f5f1e8');
  noFill();
  strokeWeight(s * 0.0035);
  strokeJoin(ROUND);

  // Catmull-Rom splines over noise-perturbed control points.
  // p5's curveVertex() implements Catmull-Rom; we feed N noisy nodes
  // for each ribbon.
  const RIBBONS = 14;
  const NODES = 12;
  const palette = ['#1a1a2e', '#16213e', '#c63d2f', '#e1a624', '#3b7a57'];

  for (let r = 0; r < RIBBONS; r++) {
    stroke(palette[r % palette.length]);
    const baseY = lerp(s * 0.18, s * 0.82, r / (RIBBONS - 1));
    const amp = s * 0.06 + noise(r * 0.7) * s * 0.08;
    const phase = noise(r * 0.9 + 17) * TWO_PI;
    beginShape();
    // duplicate first vertex so the curve starts at the first node
    curveVertex(-s * 0.1, baseY);
    for (let i = 0; i < NODES; i++) {
      const t = i / (NODES - 1);
      const x = lerp(-s * 0.05, s * 1.05, t);
      const y =
        baseY +
        Math.sin(t * TWO_PI * 1.5 + phase) * amp +
        (noise(r * 1.3, i * 0.5) - 0.5) * amp * 1.5;
      curveVertex(x, y);
    }
    curveVertex(s * 1.1, baseY);
    endShape();
  }
}

Open the demo source ↗

How it works

A cubic Bézier is defined by 4 control points; evaluate it at parameter t∈[0,1] by the de Casteljau algorithm — repeatedly linearly interpolate between adjacent points (lerp the 4 to 3, the 3 to 2, the 2 to 1); the final point is the curve at t. Sweeping t from 0→1 traces the curve, which stays inside the control polygon's convex hull but generally does not pass through the interior points. A Catmull-Rom spline instead interpolates — it passes through every point, and each segment's tangent is derived from the neighbouring points — so it is ideal for drawing a smooth curve through a sequence of sampled positions. Chaining segments with shared endpoints (and matched tangents for C¹ continuity) builds longer paths.

Parameters

Lineage

Related
Tangent Arcs / String Art

Frequently combined with

Works using this algorithm (102)

100 PRINT
ben-kovach
8
bard-ionson
a heart and a soul
roman-janajev
Aithérios
jorge-ledezma
Alan Ki Aankhen
fahad-karim
Alien Clock
shvembldr
Alien DNA
shvembldr
Alien Insects
shvembldr
Amoeba
last-even
Antennas
gcrll
Axo
jiwa
Beauty of Skateboarding
jeanvascript
Blind Spots
shaderism
Blooms
cory-haber
CatBlocks
kristy-glas
Cattleya
ben-snell
CENTURY
casey-reas
Ceramics
charlotte-dann
Coalition
generative-artworks
Cushions
devi-parikh
Cytographia
golan-levin
Diggly Collects All
dca
dino pals
hideo
(Dis)connected
tibout-shaik
[Dis]entanglement
onlygenerated
Dopamine Machines
steve-pikelny
Dragons
william-mapan
Dustfold
lunarean
Eccentrics 2: Orbits
radix
Eccentrics
radix
Ego Death
electralina
Empyrean
generative-artworks
Ensō
matto
entretiempos
marcelo-soria-rodriguez
Event Horizon Sunset (Series C)
jake-brukhman
Faceless
greatjones
FAKE IT TILL YOU MAKE IT
maya-man
Flourish
sterling-crispin
Flowers
rvig
FOCUS
matto
Fluiroso
sebastian-brocher-cryptoarte
Fragments of an Infinite Field
monica-rizzolli
Genesis
dca
Glasshouse INAT
aleksandra-jovanic
Good Vibrations
aluan-wang
Hachure
matt-deslauriers
Human Unreadable
operator
Ieva
shvembldr
ilumz
wolffia-inc-motus-art
InC
hex6c
Intersections
rafael-rozendaal
Kubikino
carolina-melis
Labyrometry
eliya-stein
Letters to My Future Self
ryan-struhl
Libertad Parametrizada
zjorge
Liquid Ruminations
eliya-stein
little boxes on the hillsides, child
lia
Mazinaw
eric-de-giuli
Metropolis
mpkoz
Muttenz
wuwa

Last updated 2026-07-16