Voronoi & Delaunay Playground
Click to place points and watch the Voronoi diagram, Delaunay triangulation, convex hull and circumcircles update live, with cell areas, edge lengths and Lloyd relaxation.
About this tool
Explore nearest-site regions and their Delaunay triangulation. Layout and Count update the point cloud immediately. Reset points restores the configured layout from its seed after manual edits or relaxation. Parameters contains the seed, visible layers, Lloyd, Clear all, precise point editing and Data. Click empty domain space to add a point, drag a point to move it, or right/Alt-click to remove it. Empty-space touch dragging scrolls the page.
The domain is a 600 × 400 rectangle with origin at top left and y downwards. The view uses one scale on both axes; blank margins are outside the editable domain. Blue outlines are Voronoi cells, green lines are Delaunay edges. Selecting a point highlights its cell and incident edges. Select its index in Parameters for keyboard editing; enter x/y and press Enter to commit. Exact duplicate positions are rejected. Invalid generator input preserves the current point cloud; uncommitted point-coordinate edits are not part of the saved cloud.
All five layouts produce exactly 1…250 sites; a manually cleared cloud may be empty. Circle/spiral ignore the seed. Random/grid/cluster layouts are deterministic for the same seed and count. Lloyd moves each site to the centroid of its clipped cell, reducing nearest-site squared-distance energy; cell-area variation need not decrease. Data contains all rows and optional topology/area/energy measures. Collinear sites form a neighboring chain without triangles. Cocircular points may admit multiple valid triangulations.
Triangulation starts from the true convex hull and uses Lawson flips with filtered/exact dyadic predicates. Thin triangles do not disappear into a fixed supertriangle. Constructed Voronoi vertices, centroids and areas use floating-point arithmetic; tiny features may be unresolved numerically or visually. With circumcircles enabled, selection limits them to incident triangles and radii above 1200 are omitted visually.
On the focused canvas, arrows move the selected site by 10 units, Shift+arrows by 1. Escape clears selection; arrows then move the insertion cursor and Enter/Space adds it. Delete/Backspace removes selection. Pointer cancellation restores the site; leaving during an uncommitted drag preserves the saved cloud. Raw Count/Seed and the editable source sites persist, while cells, triangulation, energies, selection and edit history do not. The diagram recalculates on reload.
PNG exports the current view without the insertion cursor, with numeric source/geometry metadata. SVG is a standalone scalable domain diagram; CSV/Copy exports indices, exact point coordinates and cell areas. An input/option change discards an outdated pending PNG. Clipboard errors are reported. Everything stays in your browser.