Area of Irregular Polygon

Roger Guay irog at mac.com
Sat Nov 14 21:37:13 EST 2015


Jim,

I'm just now trying to catch up on this discussion and I see that no one has answered your question. I can’t answer either and wonder what’s going on???

BTW, I believe you should have a negative sign in front of the square bracket . . .  not that that helps at all!

Cheers,

Roger




> On Nov 11, 2015, at 2:35 PM, Jim Hurley <jhurley0305 at sbcglobal.net> wrote:
> 
> 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.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list