Can anybody help me out with this -
I want to be able to calculate the are of irregular polygons - using the easiest and quickest but most accurate way - anybody any ideas?
examples are something like 5 or 6 sides (maybe more up to maximum of 10 sides), some other areas might have circular boundaries instead of straight lines.
Thanks in advance.
I would divide your irregular shape into basic shapes, such as rectangles, trapazium, triangles, semicircles etc.
Forgot to add that you find their areas and add them together :-(
Last edited by kempos (2006-01-19 03:04:58)
You have to decompose the figure. For example, if it's a triangle on top of a square, first find the area of the square, then the area of the triangle, and add them together.
"In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..."
I did this once.
Take the area from each line segment down to the x-axis, then add them up! Go clockwise, and if the line goes forwards the area is positive, if backwards negative. (Or the other way around, it doesn't matter, because if the result is a negative area just make it positive.)
"The physicists defer only to mathematicians, and the mathematicians defer only to God ..." - Leon M. Lederman
Suppose you have n points on your polygon. And they are A[sub]1[/sub],A[sub]2[/sub],...A[sub]n[/sub] counterclockwise sequenced, also you know their positions in Cartesian co-ords.
Let's define A[sub]1[/sub]= (x[sub]1[/sub],y[sub]1[/sub]),... A[sub]n[/sub]= (x[sub]n[/sub],y[sub]n[/sub])
=x[sub]1[/sub]y[sub]2[/sub] - x[sub]2[/sub]y[sub]1[/sub]
The Area of the Polygon=1/2 [ Det(12)+Det(23)+Det(34)+...+Det(n-1 n)+Det(n1) ]
ie (1,0) (0,3) (-1/3,0) (0,-2)
Det 3 1 2/3 2
Last edited by George,Y (2007-03-04 20:51:42)
Quickest and Absolute Accurate
Last edited by George,Y (2007-03-04 20:55:00)
I think that is right, George.
By rearranging how my procedure works: (x2-x1)(y2+y1)/2 + (x3-x2)(y3+y2)/2 + ... + (x1-xn)(y1+yn)/2
You do come up with 1/2 [ Det(12) + Det(23) + ... Det(n1)]
My first term expands to x2y2 + x2y1 - x1y2 - x1y1. The x2y2 is cancelled by the next term's -x2y2, so the only functional part is x2y1-x1y2 which is the determinant (well, the negative of it, but that can be handled when the final answer is achieved).
Actually my solution is a formula already, which I came cross on some site. Using determinants to get the area of a polygon.
The basic part is that the area of triangle ABO equates one half of the determinant of coords of AB.
But the principle of this method is the same as that of yours.