[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

29.3 Convex Hull

The convex hull of a set of points is the minimum convex envelope containing all of the points. Octave has the functions convhull and convhulln to calculate the convex hull of 2-dimensional and N-dimensional sets of points.

Function File: H = convhull (x, y)
Function File: H = convhull (x, y, opt)

Returns the index vector to the points of the enclosing convex hull. The data points are defined by the x and y vectors.

A third optional argument, which must be a string, contains extra options passed to the underlying qhull command. See the documentation for the Qhull library for details.


See also: delaunay, convhulln.

Loadable Function: H = convhulln (p)
Loadable Function: H = convhulln (p, opt)

Returns an index vector to the points of the enclosing convex hull. The input matrix of size [n, dim] contains n points of dimension dim.

If a second optional argument is given, it must be a string or cell array of strings containing options for the underlying qhull command. (See the Qhull documentation for the available options.) The default options are "s Qci Tcv".


See also: convhull, delaunayn.

An example of the use of convhull is

 
x = -3:0.05:3;
y = abs (sin (x));
k = convhull (x, y);
plot (x(k), y(k), "r-", x, y, "b+");
axis ([-3.05, 3.05, -0.05, 1.05]);

The output of the above can be seen in fig:convhull.

convhull

Figure 29.5: The convex hull of a simple set of points


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on December, 26 2007 using texi2html 1.76.