Main Content

voronoiDiagram

Voronoi diagram of Delaunay triangulation

Description

example

[V,r] = voronoiDiagram(DT)returns the Voronoi verticesVand the Voronoi regionsrof the points in a Delaunay triangulation. Each region inrrepresents the points surrounding a triangulation vertex that are closer to that vertex than any other vertex in the triangulation. The collection of Voronoi regions make up a Voronoi diagram.

Examples

collapse all

Compute the Voronoi vertices and regions of a 2-D Delaunay triangulation.

Create a Delaunay triangulation from a set of 2-D points.

P = [ 0.5 0 0 0.5 -0.5 -0.5 -0.2 -0.1 -0.1 0.1 0.1 -0.1 0.1 0.1 ]; DT = delaunayTriangulation(P);

Compute the Voronoi vertices and regions.

[V,r] = voronoiDiagram(DT);

Display the connectivity of the Voronoi region associated with the 3rd point in the triangulation.

r{3}
ans =1×41 10 7 4

Display the coordinates of the Voronoi vertices bounding the 3rd region. TheInfvalues indicate that the region contains points on the convex hull.

V(r{3},:)
ans =4×2Inf Inf 0.7000 -1.6500 -0.0500 -0.5250 -1.7500 0.7500

Input Arguments

collapse all

Delaunay triangulation, specified as a scalardelaunayTriangulationobject.

Data Types:delaunayTriangulation

Output Arguments

collapse all

Voronoi vertices, returned as a 2-column matrix (2-D) or a 3-column matrix (3-D). Each row ofVcontains the coordinates of a Voronoi vertex.

The Voronoi regions associated with points that lie on the convex hull of the triangulation vertices are unbounded. Bounding edges of these regions radiate to infinity. The first vertex inVrepresents the vertex at infinity and is designated withInf.

Data Types:double

Voronoi regions, returned as a cell array whose elements contain the connectivity of the Voronoi vertices inV. The points in each row ofrform the bounding region associated with the corresponding row in thePointsproperty.

Data Types:double

版本历史

Introduced in R2013a