delaunay

Computes the 2D or 3D Delaunay triangulation.

Syntax

T = delaunay(x,y)

T = delaunay(x,y,z)

T = delaunay(pts)

T = delaunay(...,options)

Inputs

x
The x coordinates.
Type: double
Dimension: vector
y
The y coordinates.
Type: double
Dimension: vector
z
The z coordinates.
Type: double
Dimension: vector
pts
The (x,y) or (x,y,z) coordinate matrix, with each row containing 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.
Default: 'Qt Qbb Qc Qz'

Outputs

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

Example with plot

Triangulate a square with three interior points.

x = [10, 20, 10, 20, 13, 14, 18]';
y = [20, 20, 30, 30, 22, 27, 23]';
T = delaunay(x, y);
T = [Matrix] 8 x 3
6  4  3
5  3  1
5  6  3
5  2  1
7  5  2
7  5  6
7  4  2
7  6  4


Figure 1. delaunay figure 1

Comments

delaunayn uses the Qhull package. For details, see:

http://www.qhull.org/html/qh-quick.htm http://www.qhull.org/html/qh-optq.htm

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