Owning Class: geometry
Requires: MathScript RT Module
polygonarea(x, y)
a = polygonarea(x, y)
Legacy Name: polyarea
Calculates the area of a polygon.
| Name | Description |
|---|---|
| x | Specifies the x-coordinates of the polygon. length(x) must be greater than 2. If x is a matrix, each column of x specifies the x-coordinates of a polygon. |
| y | Specifies the y-coordinates of the polygon. If y is a matrix, each column of y specifies the y-coordinates of a polygon. size(y) must equal size(x). |
| Name | Description |
|---|---|
| a | Returns the area of the polygon. |
z = 0:pi / 4:2*pi;
x = cos(z);
y = sin(z);
plot(x, y)
polygonarea(x, y)