Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

convexHull

Class: delaunayTriangulation

Syntax

K = convexHull(DT)
[K,v] = convexHull(DT)

Description

K = convexHull(DT) returns the vertices of the convex hull.

[K,v] = convexHull(DT) also returns the area or volume bounded by the convex hull.

Input Arguments

DT

A Delaunay triangulation, see delaunayTriangulation.

Output Arguments

K

Convex hull vertices, returned as a matrix of vertex IDs. The shape of K depends on whether your triangulation is 2-D or 3-D:

  • When DT is 2-D, K is a column vector containing the sequence of vertex IDs around the convex hull.

  • When DT is 3-D, K is a triangulation connectivity list containing the triangles on the convex hull.

v

Area or volume bounded by the convex hull, returned as a scalar value.

Definitions

Vertex ID

A row number of the matrix, DT.Points. Use this ID to refer a specific vertex in the triangulation.

Examples

expand all

Create a Delaunay triangulation from a set of random points.

x = gallery('uniformdata',[10,1],0);
y = gallery('uniformdata',[10,1],1);
DT = delaunayTriangulation(x,y);

Calculate the convex hull.

k = convexHull(DT)
k =

     1
     3
     2
     8
     9
     1

Plot the points and highlight the convex hull in red.

figure
plot(DT.Points(:,1),DT.Points(:,2), '.','markersize',10);
hold on
plot(DT.Points(k,1),DT.Points(k,2),'r')
hold off

Use convexHull to calculate the convex hull of a set of random points within a unit cube.

Create a Delaunay triangulation from a set of random points.

P = gallery('uniformdata',[25,3],1);
DT = delaunayTriangulation(P);

Calculate the convex hull and the volume bounded by the convex hull.

[K,v] = convexHull(DT);

Examine the volume.

v
v =

    0.3561

Plot the convex hull.

trisurf(K,DT.Points(:,1),DT.Points(:,2),DT.Points(:,3),...
       'FaceColor','cyan')

Was this topic helpful?