Area of an Irregular Polygon
Date: 03/10/97 at 16:09:13 From: Ron Smith Subject: Area of irregular polygon I guess I've been out of school way too long. I have searched your database and I see where you have explained to several people that you can't find the area of an irregular polygon with only the perimeter values. However, you did not give a formula for finding the area if you do have the angles. I have the lengths of all the sides and some of the angles (I know I am going to need to know all of the angles) for a patio I am going to build. They are (clockwise): 22'(90deg), 4'(90deg), 10'(90deg), 25'(?deg), 25'(?deg), 21'(90deg), 4'(90deg), 4'(90deg), 14'(?deg), 25'(?deg), 12'(90deg). I would really like some software that I could plug these values into to get the area of the polygon. Since I am a software engineer, I could write the program if you give me the formula. Thanks.
Date: 03/11/97 at 12:03:13 From: Doctor Ken Subject: Re: Area of irregular polygon Hi Ron- What I'm going to tell you about is more of an algorithm and not really a formula. Let's say you're given a bunch of side lengths and angles, in order. Call the side lengths S1, .., Sn, and call the angles A1, .., An. For the angles, let's not think about the interior angles, but rather the exterior angles (each of which is 180 minus the interior angle at that corner). So these side lengths and angles are sort of a set of directions for tracing out the polygon: "Walk S1 meters forward, then turn A1 degrees to the left, then walk S2 meters forward, then turn A2 degrees to the left, ...." Note that to specify an n-gon, we only need n-1 sides and n-2 angles, since the last step is to just go back to the starting point. I've drawn a diagram that may be helpful here: Here I'm using S1, .., Sn to be both labels of segments, and also the length of those segments. The same goes for A1, .., An. The way we'll find the area is to add up the areas of a bunch of triangles. If it's an n-gon, it can be divided into n-2 triangles and these are the triangles whose areas we'll sum. The general rule we'll use to find all the areas is this: the area of a triangle whose sides are the vectors (a,b) and (c,d) is 1/2 (ad-bc). This is just 1/2 the determinant of the matrix whose rows are (a,b) and (c,d). First we'll find the area of the first triangle (triangle 1). The two vectors we'll use are the sides labeled S1 and S2. If you're not familiar with vector notation, here's what it means: if you put the origin of a coordinate system at one end of the line segment, then the vector is the coordinates of the other point. You can see that the vector of the side S1 is (S1,0). The vector of the side S2 is a little trickier. To find it, we remember a little polar coordinate math, and we get the vector to be (S2 * Cos(A1), S2 * Sin(A1) ). So the area of triangle 1 is 1/2 (S1*S2*Sin(A1) - 0*S2*Cos(A1)), i.e., 1/2*S1*S2*Sin(A1). Now we'll find the area of the second triangle, and in doing so, we'll see the general pattern for how to iteratively find the area of the entire polygonal region. To find the area of triangle 2, we again need to know a couple of vectors that are its sides. The vectors we'll use are the segment shared between triangle 1 and 2 (let's call that the current_base), and the segment S3. So let's find the vector notation for the base. Actually, we've already done most of the work in the previous section of the problem. If we add together the vectors S1 and S2, we'll get the current_base. So the current_base is (S1 + S2*Cos(A1), S2*Sin(A1)). Now let's find the vector notation for segment S3. Using polar coordinate geometry again, we see that it's: (S3*Cos(A1+A2), S3*Sin(A1+A2)) So the area is 1/2 the determinant of the matrix of these two vectors: (S1 + S2*Cos(A1)) * (S3*Sin(A1+A2)) - (S2*Sin(A1)) * (S3*Cos(A1+A2)) --------------------------------------------------------------------- 2 Let's review the general procedure. For an n-gon, we want to sum the areas of n-2 triangles. To find the area of each triangle, we pick two sides and write them in vector notation, then take 1/2 the determinant of the matrix formed by these two vectors. In general, one vector will be the vector sum of the two vectors from the previous triangle. This will look something like this: current_base = (current_base + prev_side, current_base + prev_side) The other vector will be the "vectorization" of one of the sides, which will look something like this: partial_angle_total += A[i] current_side = (S[i] * Cos(partial_angle_total), S[i] * Sin(partial_angle_total) area = Absolute_value(.5 * (current_side * current_base - current_side * current_base) ); prev_side = current_side I hope this is relatively clear. For a brush-up on (or first-time experience with) polar coordinates or determinants, you might want to check out some problems in our archives. -Doctor Ken, The Math Forum Check out our web site! http://mathforum.org/dr.math/
Search the Dr. Math Library:
Ask Dr. MathTM
© 1994-2013 The Math Forum