delaunayn

Computes the ND Delaunay triangulation.

Syntax

h = delaunayn(pts)

h = delaunayn(pts,options)

Inputs

pts
The coordinate matrix.
Each row contains the coordinates of a point.
Type: double
Dimension: matrix
options
The Qhull options. A string with options separated by spaces, or a cell of strings. Omit or use [] for the default. For no options, use an empty string.
Defaults:
'Qt Qbb Qc Qz'
For less than four dimensions.
'Qt Qbb Qc Qx'
For four or more dimensions. See Comments.

Outputs

T
Each row contains the indices of a simplex of the triangulation.
Dimension: matrix

Example

Triangulate the unit cube with the center point.

x = [0.5 0 1 0 1 0 1 0 1]';
y = [0.5 0 0 1 1 0 0 1 1]';
z = [0.5 0 0 0 0 1 1 1 1]';
T = delaunayn([x, y, z])
T = [Matrix] 12 x 4
1  6  4  2
1  8  6  4
1  7  9  3
1  5  9  3
1  5  9  4
1  8  9  4
1  7  9  6
1  8  9  6
1  6  3  2
1  7  6  3
1  4  3  2
1  5  4  3

Comments

delaunayn uses the Qhull package. For details, see http://www.qhull.org/html/qh-quick.htm or http://www.qhull.org/html/qh-optq.htm

Using options overwrites the defaults, so the defaults must be repeated if they are to be included.