← 📐 Mathematics

📐 Voronoi & Lloyd's Relaxation

Show centroids
Show cell edges
Iteration: 0
Cell area σ:
FPS:
Drag a point to move it · Drag empty space — rotate · Scroll — zoom

📐 Voronoi Diagrams and Lloyd's Relaxation

A field of draggable seed points tessellates a 3D slab into colored Voronoi cells; running Lloyd's relaxation repeatedly moves each seed to its own cell's centroid, smoothing the pattern into an even, honeycomb-like tessellation.

🔬 What It Demonstrates

A Voronoi cell is the set of points closer to one seed than to any other; its boundary is where two seeds are equidistant. Lloyd's algorithm iteratively relocates each seed to its cell's centroid, converging toward a centroidal Voronoi tessellation.

🎮 How to Use

Set the seed count, then drag any glowing pillar to reshape the diagram by hand. Press "Relax 1 step" or "Auto-relax" to watch the cells even out, and toggle centroid markers and cell edges to inspect the geometry.

💡 Did You Know?

Lloyd's relaxation, invented in 1957 for signal quantization, is the same core idea behind k-means clustering, finite-element mesh generation, and evenly-spaced stippling patterns in generative art.