voronoiDiagram
Returns vertices and cells of the Voronoi diagram of a delaunayTriangulation.
Category: Mathematics > Computational Geometry
Syntax
[V, R] = voronoiDiagram(DT)
Returns the Voronoi vertices V and the cells R of the triangulation DT.
Description
The function is the object-oriented way to get the Voronoi diagram. Cell R{k} belongs to the point k of DT.Points. Points on the convex hull have unbounded cells, which is why the index 1 (the point at infinity) appears in their lists.
Input arguments
DT- A
delaunayTriangulationobject.
Output arguments
V- Matrix of Voronoi vertices. The first row is
[Inf Inf]and stands for the point at infinity. R- Cell array, one entry per input point, listing the row indices into
Vthat bound its cell. A cell containing1is unbounded.
Example
Cells of a square with a center point
P = [0 0; 1 0; 1 1; 0 1; 0.5 0.5];
DT = delaunayTriangulation(P);
[V, R] = voronoiDiagram(DT);
disp(size(V))
disp(numel(R))
Output
5 2
5