MATLAB Function Reference
convhulln

n-D convex hull

Syntax

• ```K = convhulln(X)
[K,v] = convhulln(X)
```

Description

```K = convhulln(X) ``` returns the indices `K` of the points in `X` that comprise the facets of the convex hull of `X`. `X` is an `m`-by-`n` array representing `m` points in `n`-D space. If the convex hull has `p` facets then `K` is `p`-by-`n`.

```[K,v] = convhulln(X) ``` also returns the volume `v` of the convex hull.

Visualization

Plotting the output of `convhulln` depends on the value of `n`:

• For `n = 2`, use `plot` as you would for `convhull`.
• For `n = 3`, you can use `trisurf` to plot the output. The calling sequence is
• ```K = convhulln(X);
trisurf(K,(X(:,1),X(:,2),X(:,3))
```
• You cannot plot `convhulln` output for `n > 3`.

Algorithm

`convhulln` is based on Qhull [2]. It uses the Qhull joggle option (`'QJ'`). For information about `qhull`, see http://www.geom.umn.edu/software/qhull/. For copyright information, see http://www.geom.umn.edu/software/download/COPYING.html.

`convhull`, `delaunayn`, `dsearchn`, `tsearchn`, `voronoin`

Reference

[1]  Barber, C. B., D.P. Dobkin, and H.T. Huhdanpaa, "The Quickhull Algorithm for Convex Hulls," ACM Transactions on Mathematical Software, Vol. 22, No. 4, Dec. 1996, p. 469-483. Available in HTML format at http://www.acm.org/ pubs/citations/journals/toms/1996-22-4/p469-barber/ and in PostScript format at ftp://geom.umn.edu/pub/software/qhull-96.ps.

[2]  National Science and Technology Research Center for Computation and Visualization of Geometric Structures (The Geometry Center), University of Minnesota. 1993.

 convhull convn