delaunayTriangulation

Creates a Delaunay triangulation object from 2-D or 3-D points.

Category: Mathematics > Computational Geometry

Syntax

DT = delaunayTriangulation(x, y)

Triangulates 2-D points.

DT = delaunayTriangulation(x, y, z)

Triangulates 3-D points into tetrahedra.

DT = delaunayTriangulation(P)

Points as the rows of a matrix with two or three columns.

Description

The object stores the points and the Delaunay connectivity and offers queries on them: pointLocation, nearestNeighbor, edges, circumcenter, incenter, freeBoundary, convexHull and the barycentric conversions. ConnectivityList has one row per triangle (or tetrahedron) with indices into Points.

Duplicate points are not kept as separate vertices.

Input arguments

x, y, z
Coordinates of the points as column vectors.
P
Matrix with one point per row.

Output arguments

DT
A delaunayTriangulation with properties Points, ConnectivityList and Constraints.

Example

Triangulation of five points

x = [0 1 1 0 0.5]';
y = [0 0 1 1 0.5]';
DT = delaunayTriangulation(x, y);
DT.ConnectivityList
size(DT.Points)
Output
ans = 4×3

     5     2     3
     1     2     5
     5     4     1
     3     4     5
ans = 1×2

     5     2

Notes

Constrained triangulations (the edge-constraint input) are not supported in MatLivre, so isInterior cannot be used.

See also

delaunay triangulation pointLocation convexHull voronoiDiagram