Skip to Main Content Skip to Search
Product Documentation

delaunay - Delaunay triangulation

Syntax

TRI = delaunay(X,Y)
TRI = delaunay(X,Y,Z)
TRI = delaunay(X)

Definitions

delaunay creates a Delaunay triangulation of a set of points in 2-D or 3-D space. A 2-D Delaunay triangulation ensures that the circumcircle associated with each triangle contains no other point in its interior. This definition extends naturally to higher dimensions.

Description

TRI = delaunay(X,Y)creates a 2-D Delaunay triangulation of the points (X,Y), where X and Y are column-vectors. TRI is a matrix representing the set of triangles that make up the triangulation. The matrix is of size mtri-by-3, where mtri is the number of triangles. Each row of TRI specifies a triangle defined by indices with respect to the points.

TRI = delaunay(X,Y,Z) creates a 3-D Delaunay triangulation of the points (X,Y,Z), where X, Y, and Z are column-vectors. TRI is a matrix representing the set of tetrahedra that make up the triangulation. The matrix is of size mtri-by-4, where mtri is the number of tetrahedra. Each row of TRI specifies a tetrahedron defined by indices with respect to the points.

TRI = delaunay(X) creates a 2-D or 3-D Delaunay triangulation from the point coordinates X. This variant supports the definition of points in matrix format. X is of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 ≦ ndim ≦ 3. The output triangulation is equivalent to that of the dedicated functions supporting the 2-input or 3-input calling syntax.

delaunay produces an isolated triangulation, useful for applications like plotting surfaces via the trisurf function. If you wish to query the triangulation; for example, to perform nearest neighbor, point location, or topology queries, use DelaunayTri instead.

Visualization

Use one of these functions to plot the output of delaunay:

triplot

Displays the triangles defined in the m-by-3 matrix TRI.

trisurf

Displays each triangle defined in the m-by-3 matrix TRI as a surface in 3-D space. To see a 2-D surface, you can supply a vector of some constant value for the third dimension. For example

trisurf(TRI,x,y,zeros(size(x)))

trimesh

Displays each triangle defined in the m-by-3 matrix TRI as a mesh in 3-D space. To see a 2-D surface, you can supply a vector of some constant value for the third dimension. For example,

trimesh(TRI,x,y,zeros(size(x)))

produces almost the same result as triplot, except in 3-D space.

tetrameshPlots a triangulation composed of tetrahedra.

Examples

Example

Plot the Delaunay triangulation of a large dataset:

load seamount
tri = delaunay(x,y);
trisurf(tri,x,y,z);

See Also

DelaunayTri | plot | trimesh | triplot | TriScatteredInterp | trisurf

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS