POLYAREA

a = POLYAREA (poly)

Returns the area of the polyline poly. The algebraic sign of the area is positive for counterclockwise ordering of vertices in x-y plane; otherwise negative.

See DRAWPOLY for more information on how to define the polyline.

Example

polygon = [ [50,50], [100,50], [100,100], [50,100], [50,50]]
drawpoly polygon color 12

Area = abs(polyarea(polygon))     ' absolute value of the area, because
                                  ' we are not interested in the
                                  ' ordering of the vertices.

print "Polyarea() returns: "; Area
print "Exact area is 50x50 = 2500"
Math
If there is insufficient information on this page and you wish learn more about POLYAREA, please send an email to smallbasic@gmail.com. You can help to improve information about POLYAREA by submitting a pull request, click View Source for details. Note, an offline language reference text file is also available - see the Download section.