A very useful procedure to find the area of any irregular polygon is through the Gauss determinant.
It involves drawing the figure on a Cartesian plane, setting the coordinates of each of the vertices of the polygon.
Drawing of the choice and enumeration of the irregular pentagon points for the Gauss determinant.
Any of them is chosen at random and the pairs are placed in the following formula. The polygon must be traversed counterclockwise, taking into account that the first pair of coordinates corresponds to the chosen vertex and, after traveling all the vertices counterclockwise, the last pair must be the initial torque
Let the vertices of the polygon be: (x1, y1), (x2, y2), ..., (xN, yN). The formula is as follows:
Formula of the irregular polygon area using the Gauss Determinant
Solving it by the known procedure, we will have quickly found the area of the irregular polygon.
This method is applicable to any polygon with any number of sides, both in the case of concave and convex polygons.
My question is how can I create a script that asks me a) Number of Vertices (n) b) Ask me to enter the n points between those n vertices that is $$(x_1, y_1)$$ $$(x_2, y_2)$$ ........................ $$(x_n, y_n)$$ c) Can calculate the area given the formula stated
n = Input["Number of Vertices", n] (Input (x1,y1) ,(x2,y2).....(xn,yn)) ?? ?? A=(1/2)det[x1,y1) ,(x2,y2).....(xn,yn] ???
can you help me ? , I searched the forum but I can't find any example that I can adapt