# Area of a polygon- using numerical integration

1. Jun 2, 2014

### atee

Hi,

I need to calculate area of an irregular polygon which can be of any complex shape numerically i.e. using numerical integration techniques.

Akash

2. Jun 2, 2014

### willem2

The most accurate method will be to divide the polygon into triangles.

You can choose any corner, and try to eliminate it by drawing a line between the adjacent corners.
Since the polygon isn't convex, you need to check.
-that the line drawn is on the inside of the polygon
-that the line doesn't intersect any of the edges.

It gets harder if the border of the polygon consists of more than one loop.

Another idea is to look at polygon filling using scanlines, for example here:

http://ezekiel.vancouver.wsu.edu/~cs442/lectures/raster/polyfill/poly.pdf

3. Jun 2, 2014

### SteamKing

Staff Emeritus
Decomposing a general polygon into triangles is intuitive, but it can be problematic in practice.

If you know the coordinates of the vertices of a general polygon, this article has formulas for calculating the area and centroid:

http://en.wikipedia.org/wiki/Polygon