Voronoi diagrams with different distance metrics
A Voronoi cell is the set of places closest to one site — but "closest" depends on how distance is measured. With ordinary straight-line (Euclidean) distance, borders are straight lines halfway between sites. Change the metric and the borders change shape, even though the sites stay put.
- Euclidean — √(dx² + dy²). Straight-line distance; its "circle" is a circle.
- Manhattan (taxicab, L1) — |dx| + |dy|. Distance along a street grid; its circle is a diamond.
- Chebyshev (L∞) — max(|dx|, |dy|). King moves on a chessboard; its circle is a square.
- Minkowski (Lp) — (|dx|ᵖ + |dy|ᵖ)^(1/p). One slider that moves between all of the above.
Hover over the canvas: the shape drawn around the pointer is the "circle" of the current metric, grown until it touches the nearest site. Its outline shows why the borders bend the way they do.
Ties and wide borders
With Manhattan and Chebyshev distance, two sites can be exactly equally far from a whole region, not just a line. That happens when the sites line up diagonally (Manhattan) or horizontally/vertically (Chebyshev). This tool assigns tied pixels to the first site, so such regions show up as sudden jumps in the border.
To change how far each site reaches instead of how distance is measured, use weighted Voronoi. For straight-line catchments on a real map, use the Voronoi map generator.
Frequently asked questions
What is a Manhattan Voronoi diagram?
It uses taxicab distance — the distance along a grid of streets, |dx| + |dy| — instead of straight-line distance. Borders are made of horizontal, vertical and 45-degree segments, and some borders can widen into whole regions where two sites are tied.
What is Chebyshev distance?
Chebyshev distance is the larger of |dx| and |dy|, the number of moves a king needs on a chessboard. Its circles are squares, so Chebyshev Voronoi borders run at 0, 45 and 90 degrees with a different pattern from Manhattan.
What does the Minkowski p value do?
Minkowski distance generalizes the others: p = 1 is Manhattan, p = 2 is Euclidean, and as p grows it approaches Chebyshev. Values between 1 and 2 give rounded diamonds; values below 1 are not a true metric but make striking star-shaped cells.
Which metric fits a city?
In a city with a street grid, Manhattan distance often predicts walking or driving distance better than a straight line. For real travel times, a road-network isochrone is better still.