Math to calculate area of polygon
This discussion is a note after reading the page:
The most wonderful thing in that page is the idea that the calculated area of a triangle can be "signed". Positive means clockwise and Negative means counterClockwise. So, the equation to calculate the area of polygon is very very simple.
To calculate the area of a polygon composed by pt0,pt1,pt2,pt3,pt34,pt5 the equation is like this:
It is just a function sum of sequential points. Of-course, we are talking about a closed polygon.
At the last few lines of that page, the professor did not try to explain the details to convince me that equation is valid. He gave only two examples which is not enough for me.
So, I try to convice myself. Here is my notes.
First lets try to calculate the area of an arbituray triangle.
You see, if we make C to be (0,0), then for a vector A->B, the triangle area will be just
Lets try another way to calculate the area of an arbituray triangle by that equation:
Lets add a corner to the side of A->B, so the triangle will be quandrangle.
If we pick a side and change it to a corner, then the same calculation works. The area about old side vector is eliminated and the area of two new side vectors are added. It remains the form of dequential sum. And now this is a polygon of 5 points.
For any polygon, it is derived from adding corner points. So, the equation works.