%% Simple Quadrilateral
% Create and plot a polygon made up of four points, and compute its area, perimeter, and centroid coordinates.

pgon = polyshape([0 0 1 3], [0 3 3 0]);
plot(pgon)
A = area(pgon)
P = perimeter(pgon)
[Cx Cy] = centroid(pgon)

% Copyright 2012 The MathWorks, Inc.