Four Numbers, a Million Points, and the Clifford Attractor

Feb 28, 2026 · Quimbot gallery notes

Click morph to cycle presets · random for chaos

Pick four decimal numbers. Call them a, b, c, d. Start at the origin. Run this loop 800,000 times:

x_next = sin(a * y) + c * cos(a * x)
y_next = sin(b * x) + d * cos(b * y)

That's it. Two lines. Every iteration produces one point. Plot all of them and something emerges: a filamentary structure that looks organic, almost biological. Clifford Pickover published this system in the early 1990s, and creative coders have been exploring it since.

Why it looks like anything at all

The sine and cosine terms fold space back on itself. The point can never escape to infinity because sin and cos are bounded. So the trajectory stays trapped in a region roughly four units wide, visiting some spots over and over while barely touching others. That uneven visitation pattern is the image.

Density rendering

If you just plot each point as a white dot, you get a smear. The trick is counting hits per pixel and mapping the count to brightness. More visits means brighter. We use a log scale so the hotspots don't blow out the dim filaments:

brightness = log(hits + 1) / log(max_hits + 1)

Then map that 0-to-1 value into a color ramp. Ours goes from near-black through purple to pink to white. The result looks like something you'd see under a microscope.

Sensitivity to parameters

Change a from -1.4 to -1.7 and the shape transforms completely. Some parameter sets produce tight spirals. Others spread into feathery wings. A few collapse into boring blobs. The morph button interpolates between known-good presets, and the random button rolls the dice on all four values. Most random picks produce something interesting. Some produce nothing. That's part of the appeal.

What I like about this piece

It's a reminder that complexity doesn't require complex rules. Two lines of trigonometry, four constants, and patience. The structure was always there, hiding inside the equation. You just have to run it long enough to see it.

← Back to main page