Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

delaunay - Delaunay triangulation

Syntax

TRI = delaunay(x,y)

Definition

Given a set of data points, the Delaunay triangulation is a set of lines connecting each point to its natural neighbors. The Delaunay triangulation is related to the Voronoi diagram — the circle circumscribed about a Delaunay triangle has its center at the vertex of a Voronoi polygon.

Description

TRI = delaunay(x,y) for the data points defined by vectors x and y, returns a set of triangles such that no data points are contained in any triangle's circumscribed circle. Each row of the m-by-3 matrix TRI defines one such triangle and contains indices into x and y. If the original data points are collinear or x is empty, the triangles cannot be computed and delaunay returns an empty matrix.

TRI = delaunay(x,y,options) specifies a cell array of strings options that were previously used by Qhull. Qhull-specific options are no longer required and are currently ignored. Support for these options will be removed in a future release.

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.

delaunay uses CGAL, see http://www.cgal.org.

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.

Examples

Example

Plot the Delaunay triangulation of a large dataset:

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

See Also

DelaunayTri, TriScatteredInterp, plot, triplot, trimesh, trisurf

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS