Lab
The drawing on the front page is a simulation, not an illustration. Change its seed or its physics and draw your own.
How it works
Seven steps from a seed to a drawing. Every number in the picture comes from them; nothing is placed by hand.
A lattice of oscillators
The plate holds 12,500 oscillators on a grid, one every ten design pixels. Each has a phase θ, an angle that would turn at its own natural frequency ω if left alone. Neighbours pull on each other:
The first sum runs over the eight neighbours, weighted 1 for the four beside and ½ for the four on the diagonals. K is the coupling. The last term is an optional weak pull toward the population’s mean phase ψ; it is off on the front page. This is the Kuramoto model, the standard model of synchronisation, laid out on a grid. With equal frequencies it becomes the gradient flow of the XY model of magnetism.
Different tempos
The natural frequencies are not independent. They come from a smooth random landscape with correlation length ℓ, plus a little individual jitter, scaled by σ and centred on zero. Neighbouring regions want slightly different tempos, which is what keeps the system from simply agreeing.
Measuring agreement
Agreement is the length of the average phase vector:
For the front page’s seed, r = 0.38 over the whole plate: the population as a whole does not agree. Measured locally, over a neighbourhood of about six cells, the same quantity R lies near 1 where neighbours have settled on a shared rhythm and drops where they have not.
Defects
Walk around any square of four oscillators and add up the phase differences, each wrapped into (−π, π]:
Almost everywhere q is 0. Where it is +1 the square encloses a vortex, marked on the plate with a small blue ring; where it is −1, a saddle. Defects are topological: one can only disappear by meeting a partner of the opposite charge, which is why a system that is nearly in agreement can stay unresolved for a long time.
Integration without trigonometry
Each oscillator is stored as a unit vector (cos θ, sin θ), so the coupling term becomes a cross product of neighbouring vectors. A step rotates each vector by a small angle and normalises it again. Only addition, subtraction, multiplication, division and square roots are involved, and IEEE 754 defines all of them exactly, so the same seed produces the same picture in every browser and in the build. The few angles needed at the start and for the defects, and the curves that set line spacing and ink, come from fixed polynomial approximations, not from the engine’s own functions.
Drawing
The direction field is the phase vector, rotated by the reading angle α. Streamlines are traced through it with Jobard and Lefer’s method for evenly spaced streamlines: each new line starts a fixed distance beside an existing one and stops when it comes too close to another. The distance depends on local agreement:
Here s is the smootherstep curve, R₀ = 0.45 and γ = 0.8. Lines open up where neighbours agree and crowd where they do not, and their weight and darkness follow the same measure. The dotted blue lines are isophases, lines of equal phase found with marching squares; they all converge on the vortices.
Seeds
A seed fixes every random decision: the starting phases, the frequency landscape, the jitter and the order in which streamlines are started. The generator is SFC32, seeded through SplitMix32. The front page uses seed18, chosen by eye from contact sheets of many seeds; the 404 page uses seed 404.
How it was made
Phase Portrait was made in November 2026, together with this website, for which I had asked for generative art as part of the design.
The implementation was written with Claude, an AI model made by Anthropic, working in this site’s code repository: the oscillator simulation, the streamline drawing, the motion layer and this Lab. I reviewed the iterations, decided how the artwork sits on each page, and asked for changes until it did.
The algorithm is deterministic. Every plate on this site is rendered when the site is built, from the same source code this page runs in your browser. The source of the generator:
Sources
- Yoshiki Kuramoto, Chemical Oscillations, Waves, and Turbulence. Springer, 1984.
- Steven H. Strogatz, “From Kuramoto to Crawford: exploring the onset of synchronization in populations of coupled oscillators.” Physica D 143, 2000.
- Bruno Jobard and Wilfrid Lefer, “Creating evenly-spaced streamlines of arbitrary density.” Visualization in Scientific Computing ’97, Springer, 1997.
- J. M. Kosterlitz and D. J. Thouless, “Ordering, metastability and phase transitions in two-dimensional systems.”Journal of Physics C 6, 1973.