Area of Irregular Polygon

Jim Hurley jhurley0305 at sbcglobal.net
Wed Nov 11 17:35:52 EST 2015


Very interesting discussion. 

However, I was puzzled by the following term in the sum used to calculate the area of a polygon--labeled the centroid method.

x(i)*y(i+1) - x(i+1)y(i)   

Where does this come from? If one were using the traditional method of calculating the area under a curve (perhaps a polygon) the i'th  term in the sum would be:

[x(i+1) - x(i)] * [y(i+1) + y(i)] / 2

That is, the base times the average height. This was the original method employed by many--the non-centroid method

Multiplying this out you get:

x(i)*y(i+1) - x(i+1)y(i) +      [x(i+1)* y(i+1) - x(i)* y(i)]

So THE SAME EXPRESSION as in the centroid method EXCEPT for the added term in square brackets. So, WHY THE  DIFFERENCE?

In calculating this sum all of the intermediate terms in the sum cancel out, leaving just the end terms:  x(n)y(n) - x(1)* y(1)
But if the figure is closed, they too cancel each other. 
For example:  (x3 * y3 - x2*y2) + (x4*y4 - x3*y3)... Notice that the x3 * y3 terms cancel.

Curiously, if one were attempting to calculate the area under a curve (non-polygon) using this method, the principle contribution could come from just these end point terms. As an extreme example, if the curve began at the origin (x(0) = y(0) = 0),. there would be a substantial contribution from the end point x(n) * y(n), where n is the last point. If it were a straight line, ALL the contribution would come from the end point: x(n) y(n) . Divided  by 2 of course.

Jim

P.S. the centroid of a closed curve might be liken eo the center of gravity in physics.
Two closed curves could have the same centroid but very different areas (masses) 
The center of mass bears no relation to the mass, and the centroid of a closed curved bears no relation to the area.



More information about the use-livecode mailing list