18. Strange Attractors
Chaos made visible — millions of iterations tracing beauty from simple equations
Take a simple equation. Feed the output back as input. Repeat a million times. Plot every point. What emerges is a strange attractor — a shape that the system is drawn toward but never settles on, tracing infinitely complex, never-repeating paths through space.
Strange attractors are the visual fingerprints of chaotic systems. They arise in weather models, fluid dynamics, electronic circuits, and population biology. But they're also stunningly beautiful — and trivially easy to render.
What Makes an Attractor "Strange"
A regular attractor is a state that a system settles into: a pendulum coming to rest (point attractor) or a planet in orbit (periodic attractor). A strange attractor is different:
- The trajectory never repeats — it winds around forever without closing on itself
- It has fractal structure — zoom in and you find the same layered detail at every scale
- It exhibits sensitive dependence on initial conditions — two points starting infinitesimally close will diverge exponentially (the "butterfly effect")
Despite this chaos, the trajectory stays bounded in a finite region of space. It's trapped in an intricate shape that it explores forever without revisiting the same point twice.
The Lorenz Attractor
In 1963, meteorologist Edward Lorenz discovered the first strange attractor while modeling atmospheric convection. His system of three coupled differential equations:
With the classic parameters σ = 10, ρ = 28, β = 8/3, the system traces out the iconic butterfly-shaped attractor. We approximate the continuous system with discrete time steps:
dt = 0.005
x += σ * (y - x) * dt
y += (x * (ρ - z) - y) * dt
z += (x * y - β * z) * dt
Each step produces a new (x, y, z) point. Plot millions of these and the butterfly emerges.
Why iterate, not solve?
Chaotic systems can't be solved analytically — there's no closed-form formula for the trajectory. The only way to see where the system goes is to simulate it step by step. This makes strange attractors a perfect fit for computer rendering: the algorithm is just a loop with a few multiplications.
2D Attractors: Clifford and De Jong
While the Lorenz system lives in 3D, some of the most visually striking attractors are 2D maps. These are even simpler — no differential equations, just direct iteration:
Clifford Attractor
Four parameters (a, b, c, d) control the shape. Small changes produce dramatically different attractors — swirling galaxies, organic filaments, symmetric mandalas.
De Jong Attractor
Similar structure, different character. De Jong attractors tend to produce tighter, more crystalline patterns.
Rendering by Density
Unlike L-systems or fractals where you draw lines, attractors are rendered by accumulating point density. You iterate the equations millions of times, and for each (x, y) point you increment a counter in the corresponding pixel. Then you map the density to brightness:
for i in 0..10_000_000:
(x, y) = iterate(x, y)
px = map x to pixel column
py = map y to pixel row
density[py][px] += 1
for each pixel:
brightness = log(density + 1) / log(maxDensity + 1)
The logarithmic mapping is important — without it, the densest regions would blow out to white and the delicate outer structure would be invisible. Some renderers use histogram equalization or gamma curves for even richer results.
Try It: Strange Attractor Explorer
Choose an attractor type and adjust parameters. The canvas accumulates millions of points in real time.
Strange Attractor Explorer
The Butterfly Effect, Visualized
Strange attractors are the geometric face of chaos. Two trajectories starting 0.000001 apart will follow nearly identical paths for a while, then suddenly diverge — one lobe of the Lorenz butterfly instead of the other. Yet both stay on the attractor. The shape is deterministic; the path through it is unpredictable.
This is what makes chaotic systems so profound: they're fully governed by deterministic equations with no randomness at all, yet their long-term behavior is effectively unpredictable because immeasurably tiny differences in starting conditions get amplified exponentially.
Coloring Techniques
Beyond density mapping, there are several ways to add color to attractors:
Velocity coloring
Map the distance between successive points to a hue. Fast-moving regions (near the attractor's outer edges) get one color; slow regions (near the dense core) get another. This reveals the dynamics of the system.
Angle coloring
Map the trajectory's turning angle at each point to hue. This highlights the rotational structure and distinguishes the two lobes of the Lorenz attractor or the spiral arms of a Clifford attractor.
Orbit trap coloring
Check each point's distance to a reference shape (line, circle, point). Use that distance to select a color. This technique, borrowed from fractal rendering, can produce striking artistic effects.
Other Notable Attractors
- Rössler attractor — a simpler 3D system with a single spiral band that folds back on itself
- Hénon map — a 2D map producing a curved, fractal banana shape; one of the simplest chaotic maps
- Ikeda map — models a laser cavity; produces nested ring-like structures
- Tinkerbell map — a 2D system with complex, asymmetric basins of attraction
- Aizawa attractor — a beautiful 3D torus-like shape with chaotic surface detail
Each of these follows the same rendering approach: iterate, plot, accumulate density.
What's Next
Strange attractors emerge from deterministic chaos. In the final article of this section, we'll explore reaction-diffusion — systems where two chemicals interact and diffuse to produce spots, stripes, and labyrinthine patterns inspired by Alan Turing's theory of morphogenesis.