r/creativecoding • u/websajt • 18d ago
Clifford attractor, about 4 million points in plain JavaScript - made a page where you can move the parameters live
The whole image is two lines:
x' = sin(a*y) + c*cos(a*x)
y' = sin(b*x) + d*cos(b*y)
Start at any point, apply the map millions of times, and count how often each pixel gets hit. The picture is that histogram drawn with a log tone curve, (log(1 + hits) / log(1 + max))^0.8 into a navy to ice blue palette, so the faint outer threads stay visible next to the dense core. 250k iterations per frame on outer threads stay visible next to the dense core. 250k iterations per frame on a plain canvas, no libraries.
This one is a = b = 1.7, c = 0.6, d = 1.2. Most settings collapse into a few dots or a single loop, only some are chaotic.
I made a page where you can drag a, b, c, d and watch it redraw: https://rezonanca.art/play/