| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
Convex hull
K = convexHull(DT)
[K AV] = convexHull(DT)
K = convexHull(DT) returns the indices into the array of points DT.X that correspond to the vertices of the convex hull.
[K AV] = convexHull(DT) returns the convex hull and the area or volume bounded by the convex hull.
| DT | Delaunay triangulation. |
| K | If the points lie in 2-D space, K is a column vector of length numf. Otherwise K is a matrix of size numf-by-ndim, numf being the number of facets in the convex hull, and ndim the dimension of the space where the points reside. |
| AV | The area or volume of the convex hull. |
The convex hull of a set of points X is the smallest convex polygon (or polyhedron in higher dimensions) containing all of the points of X.
Compute the convex hull of a set of random points located within a unit square in 2-D space.
x = rand(10,1); y = rand(10,1); dt = DelaunayTri(x,y); k = convexHull(dt); plot(x,y, '.', 'markersize',10); hold on; plot(x(k), y(k), 'r'); hold off;

Compute the convex hull of a set of random points located within a unit cube in 3-D space and the volume bounded by the convex hull.
X = rand(25,3); dt = DelaunayTri(X); [ch v] = convexHull(dt); trisurf(ch, X(:,1),X(:,2),X(:,3), 'FaceColor', 'cyan')

| DelaunayTri.voronoiDiagram |
| TriRep |
| convhull |
| convhulln |
![]() | cd | cd (ftp) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |