Volume 5
Algorithmic
life.
Beyond CSS. Particles that flock. Fields that flow. Springs that bounce. Waves that breathe. All governed by mathematics, running on Canvas 2D at 60fps. The tools: requestAnimationFrame, trigonometry, noise functions, and physics formulas. No libraries.
Flow Fields
Noise-driven particle currents. Each particle follows an invisible field.
Canvas 2D + noise function
angle = noise(x * 0.003, y * 0.003, time) * TAUSpring Physics
Objects connected by springs. Drag one, the rest follow.
Hooke's Law: F = -kx - dv
Drag the red node
force = -stiffness * displacement - damping * velocity. This is exactly what Framer Motion and Apple's UIKit use internally — but here it's 15 lines of code.Flocking (Boids)
Emergent collective behaviour from three simple rules.
Reynolds' Boids algorithm (1986)
Move cursor to attract the flock
Lissajous Curves
Sine waves on X and Y create infinite patterns.
x = sin(at + δ), y = sin(bt)
Try 3:2, 5:4, 7:6 — each ratio is a different shape family
Wave Interference
Multiple wave sources create patterns through superposition.
Σ sin(distance × freq − time)
Click to add wave sources (3 active)
Strange Attractor
Deterministic chaos. Order within apparent randomness.
Clifford attractor: x' = sin(ay) + c·cos(ax)
The Toolkit
What powers all of this. No libraries required.
Canvas 2D
The workhorse. Draw pixels, shapes, gradients. Hardware-accelerated compositing. Works everywhere since IE9.
Use: Backgrounds, particle effects, data viz, generative art
requestAnimationFrame
The heartbeat. Synced to display refresh rate. Battery-friendly — pauses when tab is hidden.
Use: Every animation loop on this page
OffscreenCanvas
Canvas rendering on a Web Worker thread. Main thread stays completely free for UI.
Use: Heavy particle systems, generative art that won't jank scrolling
Web Animations API
The browser's native animation engine. More control than CSS animations, less overhead than libraries.
Use: Complex sequenced animations, programmatic keyframes
Noise functions
Pseudo-random but smooth. Creates organic, natural-looking variation. The secret behind every 'living' generative artwork.
Use: Flow fields, terrain, organic movement, texture
Spring physics
F = -kx - dv. Mass, stiffness, damping. The foundation of every satisfying interaction in iOS and Android.
Use: Following cursors, scroll momentum, draggable elements
Trigonometry
sin, cos, atan2 — the geometry of circles, waves, and rotation. If it curves or oscillates, trig is involved.
Use: Waves, orbits, Lissajous curves, pointing, distance
SVG + SMIL
Vector animations that scale to any resolution. SMIL is NOT deprecated — Chrome reversed its 2015 decision. Native, no JS.
Use: Animated logos, icons, diagrams, line drawing
End of Volume 5
The formula is
the design.
No image files. No animation timelines. No keyframes. Just mathematics, a canvas, and a loop. The algorithms don't repeat — they evolve. That's what makes them feel alive.