Shapes & spaces

Voronoi diagram calculator from points with Delaunay dual

Construct nearest-site Voronoi cells in a clipping rectangle and inspect their global Delaunay-subdivision dual without invented cocircular diagonals.

Your numbers

One x,y pair per row, in a common Cartesian length unit. Coordinates are finite and within ±10⁹. Use 2–20 distinct sites.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A Voronoi cell contains locations at least as close to one site as to any other. Squared-distance comparisons cancel their common quadratic terms, leaving perpendicular-bisector half-planes. This page clips those cells to a user-defined rectangle and reports their areas. Its alternate view shows the Delaunay-subdivision dual: sites are connected when their unbounded Voronoi cells share a positive-length edge. This dual is kept on the same page because it represents the same nearest-site geometry.

THE FORMULACell i = rectangle ∩ {x: |x−p_i|²≤|x−p_j|² for every j}; each comparison is a linear half-plane.

A worked example

For sites (0,0), (2,0), (2,2), (0,2) and clipping rectangle [−1,3]×[−1,3], the cell boundaries meet at (1,1). Four clipped square cells each have area four, totaling sixteen. The dual has four boundary edges. All four sites are cocircular, so the central Voronoi vertex does not select a unique diagonal; this page leaves that Delaunay face untriangulated rather than choosing a diagonal without disclosure.

Good to know

Supports 2–20 distinct planar sites and finite rectangle bounds within ±10⁹. Near-duplicate sites less than 10⁻⁹ of the overall extent apart are rejected. Numerical half-plane and zero-length tolerances are used. The dual is a Delaunay subdivision, not a promise of a unique triangulation in cocircular cases. Sites outside the clipping window may have empty displayed cells. No spherical, weighted-power or geographic geodesic Voronoi model is supplied.

The clipping window bounds the drawing, not the global neighbor relation

An unbounded cell can extend far beyond the chosen rectangle. Clipping makes its displayed area finite, but a small window can hide a genuine shared Voronoi edge. The dual adjacency is therefore checked along the original unbounded bisector subject to all other nearest-site inequalities. It is not inferred only from the clipped cells, which could incorrectly erase neighbors outside the window.

Every location in the rectangle belongs to a nearest-site cell, with shared boundaries allowed under ties. The sum of clipped cell areas should agree with the rectangle area within numerical precision. This area conservation is a useful construction check, but it does not prove every topological choice is exact. A cell can be empty in the window without its site being invalid or absent from the global diagram.

Four cocircular square sites give four cells and an untriangulated dual squareFour clipped cellsDual: no diagonal
The square sites split the default clipping rectangle into four equal-area cells. Their dual contains the four square sides, while opposite cells meet only at the central vertex. Neither diagonal is selected.

The Closest pair of points calculator from coordinates returns the minimum site-to-site separation, a different task from constructing all nearest-site cells.

Cocircular sites do not specify one unique triangulation

Four cocircular sites may share one Voronoi vertex where opposite cells touch only at that point. Connecting every pair at such a meeting would invent crossing diagonals and overstate edge adjacency. The dual here retains positive-length shared-edge relations and leaves the corresponding nontriangular Delaunay face intact. For generic nondegenerate sites, the familiar triangulated dual appears without needing an arbitrary cocircular tie-break.

These are Euclidean Cartesian distances. Treating longitude and latitude as flat coordinates would build a different nearest-site geometry from a geodesic map. Nearly coincident sites and very small features also need care because finite precision limits separation and clipping. The convex-hull calculator returns the outer boundary of a point set; it cannot substitute for the interior partition of the plane into nearest-site regions.

A few questions, answered

Why is the square dual missing a diagonal?

The four sites are cocircular, so neither diagonal is uniquely selected by their nearest-site geometry. The page displays the untriangulated Delaunay subdivision.

Must every site lie inside the rectangle?

No. Outside sites can influence the cells inside the window. A particular site’s clipped cell may be empty, while the global dual still includes its neighbors.

Find your calculator

Start typing to explore the library.