# 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.
`y`- The y coordinates.
`z`- The z coordinates.
`pts`- The (x,y) or (x,y,z) coordinate matrix, with each row containing a point.
`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.

## Outputs

- T
- Each row contains the indices of a simplex of the triangulation.

## 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
```

## Comments

delaunayn uses the Qhull package. For details, see:

http://www.qhull.org/html/qh-quick.htm http://www.qhull.org/html/qh-optq.htmUsing `options` overwrites the default, so the defaults must be repeated
if they are to be included.