Finding the area of an irregular shape

2.3k Views Asked by At

This is probably a stupid question but if I have the number of sides of an irregular shape and the length of each side is there a way to find out the area the shape without knowing what the shape is? i.e. I cannot use the method of breaking the shape into small regular shapes such as rectangles, triangles, etc. to calculate the total area.

The only information I have is the number of sides and the length of each side. Many thanks for any help!

2

There are 2 best solutions below

1
On

Draw a picture and you will be convinced.

enter image description here

0
On

I developed an iterative method. Like many things in math, it may not be original/novel, but I didn't see this referenced anywhere. It's an algorithm rather than a formula. It works for irregular polygons with any number of vertices and arbitrary vertex locations. However, it has a limitation, discussed below.

Definition:
Polygon center of gravity (CG): A single (x,y) point that's the mean or average of all vertices (independently average all x coordinates, & average all the y coordinates).

Limitations: The core method only works on polygons where every vertex has a line of sight visibility of the CG point. i.e. you must be able to draw a line from every vertex to the CG without crossing the polygon boundary. Many polygons meet this criteria. A polygon shaped like a horseshoe does not. Those that don't meet the criteria may be sectioned into multiple adjacent polygons that do meet the criteria. A divide & conquer approach expands this to every 2D polygon I can think of.

Core Method: Start with polygon P with N vertices & N sides. Assume all vertices have line-of-sight visibility of the CG. The algorithm is easily described visually. Draw a line from every vertex to the CG. This divides an N-vertex polygon into N adjacent triangles. We compute the area of all triangles, then add them up. Each triangle includes the CG and two adjacent vertices of the polygon. Heron's formula is used to compute the area of each triangle, and it's a breeze to use.

ALGORITHM BY EXAMPLE: 8-sided/8-vertex polygon Implementing this as an algorithm is very easy. Compute the CG (x,y) point. Loop through a list of all vertices, dupliating the first vertex at the end of the list: {v1, v2, v3, v4, v5, v6, v7, v8, v1}.
At each iteration, we use 2 adjacent vertices and the CG to build a triangle. The 1st triangle vertices are v1, v2, CG The 2nd triangle vertices are v2, v3, CG The 3rd triangle vertices are v3, v4, CG The Nth triangle vertices are v8, v1, CG

For triangle 1, length of all 3 sides of the triangle are: a = distance(v1, v2) b = distance(v1, CG) c = distance(v2, CG) perimeter p = a + b + c

"distance" is a function that computes the cartesian distance between two (x,y) points

Using Heron's formula to compute triangle area: Compute semi-perimeter: s = p/2 = (a+b+c)/2 Compute triangle area: Area = sqrt( s*(s-a)(s-b)(s-c) )

Compute the area of all 8 triangles in this example 8-sided polygon and sum all 8 areas. Done.

MORE COMPLEX POLYGONS WITHOUT LINE-OF_SIGHT BETWEEN ALL VERTICES AND CG If required, you can segment a very irregular polygon into multple polygons. You must identify those separate polygons first, and use this method to compute the area of each sub-polygon.

REFERENCES: Heron's Formula (https://en.wikipedia.org/wiki/Heron%27s_formula). This formula is extraordinarily simple.