The Lab
Original — built for the Lab

Stained Glass

Two hundred and forty seeds, each claiming every point nearer to it than to any other, make a window of jewel glass. Watch it relax from shattered chaos into honeycomb in a dozen steps, the energy falling on the chart and the panes gathering onto six sides. Tap to add a pane, drag to reshape them, throw a stone through it, or open John Snow's 1854 cholera map and see one pump's pane hold most of the dead.

GeometryVoronoi diagramDelaunay triangulationLloyd's algorithmCanvas
After Georgy Voronoy's 1908 paper on dividing space by nearest points, and John Snow's map of Soho, 1854
Loading demo…

Scatter some seeds on a plane and give each one every point that is closer to it than to any other seed. The plane falls apart into convex panes, one per seed, with straight edges exactly halfway between neighbours. That is a Voronoi diagram, named for Georgy Voronoy, who studied it in general in 1908 — though Descartes sketched the idea for the stars and Dirichlet used it for number theory before him. Connect each pair of seeds whose panes share an edge and you get its twin, the Delaunay triangulation, named for Boris Delaunay in 1934: the one way to triangulate the seeds in which no triangle's circumscribed circle holds another seed.

The surprise is how much order hides in a random scatter. Count the sides of every pane in a large diagram and the average is six, always, however the seeds were thrown, because Euler's formula for networks on a plane leaves no other answer. Then move every seed to the centre of mass of its own pane and repeat — Stuart Lloyd's 1957 algorithm, written at Bell Labs for compressing signals. The panes even out, the energy (how far the glass lies from its seeds) falls at every step and never rises, and the window turns from crazy paving into honeycomb: not just an average of six, but nearly every pane a hexagon. Bees, basalt columns and the cells of a fly's eye find the same answer for the same reason.

The most famous Voronoi diagram was drawn before the name existed. In September 1854 cholera killed hundreds of people in a few streets of Soho, and the physician John Snow marked each death on a map with the thirteen water pumps of the district. The deaths crowded round the pump on Broad Street; Snow reported that only ten were in houses decidedly nearer another pump, and on a later version of his map he drew a line around the area closer to Broad Street than to any other pump — one cell of a Voronoi diagram, measured in walking distance. The parish removed the pump's handle on 8 September. It became a founding story of epidemiology.

The same construction runs through the modern world. Mobile networks use it to decide which mast serves your phone, ecologists to map each tree's share of light, astronomers to find voids between galaxies, game designers to cut terrain into regions, and mesh generators to prepare shapes for engineering simulation. Lloyd's relaxation spaces out the dots of stippled images and the sample points of computer graphics so that the eye sees no pattern at all.

Next in the Lab
One at a TimeOpen

Fire electrons through two slits one by one. Each lands as a single dot — and the dots still draw stripes that only make sense if every one went through both.