polyarea returns the area of a simple polygon specified by the vertices in the vectors X and Y.
rsA is the area.
rvX is a real vector.
rvY is a real vector.
The area is a postive value. The polygon will be closed if the last vertex (xN,yN) is not the same as the first vertex. The only restriction that will be placed on the polygon for this function to work is that the polygon must not be self intersecting. Note for polygons with holes. The holes are usually defined by ordering the vertices of the enclosing polygon in the opposite direction to those of the holes.
xx = linspace(0, 2.0*PI, 6); x = cos(xx); y = sin(xx); A = polyarea(x, y); rvH = plot(xv,yv); Createtitle("Area = " + strtod(A))