Skip to Main Content Skip to Search
Product Documentation

delaunayn - N-D Delaunay triangulation

Syntax

T = delaunayn(X)
T = delaunayn(X, options)

Description

T = delaunayn(X) computes a set of simplices such that no data points of X are contained in any circumspheres of the simplices. The set of simplices forms the Delaunay triangulation. X is an m-by-n array representing m points in n-dimensional space. T is a numt-by-(n+1) array where each row contains the indices into X of the vertices of the corresponding simplex.

T = delaunayn(X, options) specifies a cell array of strings options. The default options are:

If options is [], the default options used. If options is {''}, no options are used, not even the default.

Visualization

Plotting the output of delaunayn depends of the value of n:

Examples

Example 1

This example generates an n-dimensional Delaunay triangulation, where n = 3.

d = [-1 1];
[x,y,z] = meshgrid(d,d,d);  % A cube
x = [x(:);0];
y = [y(:);0];
z = [z(:);0];
% [x,y,z] are corners of a cube plus the center.
X = [x(:) y(:) z(:)];
Tes = delaunayn(X)

Tes =
   9  1  5  6
   3  9  1  5
   2  9  1  6
   2  3  9  4
   2  3  9  1
   7  9  5  6
   7  3  9  5
   8  7  9  6
   8  2  9  6
   8  2  9  4
   8  3  9  4
   8  7  3  9

You can use tetramesh to visualize the tetrahedrons that form the corresponding simplex. camorbit rotates the camera position to provide a meaningful view of the figure.

tetramesh(Tes,X);camorbit(20,0)

See Also

convhulln | delaunay3 | DelaunayTri | tetramesh | voronoin

  


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