convhulln - N-D convex hull

Syntax

K = convhulln(X)
K = convulln(X, options)
[K, v] = convhulln(...)

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-dimensional space. If the convex hull has p facets then K is p-by-n.

convhulln uses Qhull.

K = convulln(X, options) specifies a cell array of strings options to be used as options in Qhull. The default options are:

If options is [], the default options are used. If options is {''}, no options are used, not even the default. For more information on Qhull and its options, see http://www.qhull.org/.

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

Visualization

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

Example

The following example illustrates the options input for convhulln. The following commands

X = [0 0; 0 1e-10; 0 0; 1 1];
K = convhulln(X)

return a warning.

Warning: qhull precision warning: 
The initial hull is narrow 
(cosine of min. angle is 0.9999999999999998).
A coplanar point may lead to a wide facet. 
Options 'QbB' (scale to unit box) or 'Qbb' 
(scale last coordinate) may remove this warning. 
Use 'Pp' to skip this warning.

To suppress the warning, use the option 'Pp'. The following command passes the option 'Pp', along with the default 'Qt', to convhulln.

K = convhulln(X,{'Qt','Pp'})

K =

     1     4
     1     2
     4     2

Algorithm

convhulln is based on Qhull [1]. For information about Qhull, see http://www.qhull.org/. For copyright information, see http://www.qhull.org/COPYING.txt.

See Also

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.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS