%% 2-D Convex Hull
% Create a matrix of 2-D points. Compute the convex hull and its area.

P = [0 0; 1 1; 1.5 0.5; 1.5 -0.5; 1.25 0.3; 1 0; 1.25 -0.3; 1 -1];
[k,av] = convhull(P);

% Plot the original points and the convex hull.

plot(P(:,1),P(:,2),'*')
hold on
plot(P(k,1),P(k,2))

% Display the area.

av

% Copyright 2019 The MathWorks, Inc.