Area of a 2D polygon

Function to find the area of a 2D polygon

This script takes any number of points to find the area of a closed polygon.

Function:
• PolygonArea 2D – One input argument:
– array of points individually selected by the user, which define the closed polygon.

Function returns the ‘absolute’ area of the polygon and prints this value to the dialogue area.

In this example, the user is prompted to select any number of points via a pop-up messsgae box with the geometrical requirement that they form an enclosed polygon shape.  The script computes the area of the closed polygon and prints this value to the dialogue area.