Navigation

Operators and Keywords

Function List:

C++ API

: H = convhull (x, y)
: H = convhull (x, y, options)

Compute the convex hull of the set of points defined by the arrays x and y. The hull H is an index vector into the set of points and specifies which points form the enclosing hull.

An optional third argument, which must be a string or cell array of strings, contains options passed to the underlying qhull command. See the documentation for the Qhull library for details http://www.qhull.org/html/qh-quick.htm#options. The default option is {"Qt"}.

If options is not present or [] then the default arguments are used. Otherwise, options replaces the default argument list. To append user options to the defaults it is necessary to repeat the default arguments in options. Use a null string to pass no arguments.

See also: convhulln, delaunay, voronoi.

Demonstration 1

The following code

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

Produces the following figure

Figure 1

Package: octave