# nycholas/polygon-area

Calculate the area of the polygon.
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
 Failed to load latest commit information. polygon_area resources/widgets/qt4 .gitignore AUTHORS CONTRIBUTORS COPYING ChangeLog FAQ INSTALL README.rst THANKS TODO polygon_area.py setup.py

# Polygon Area

Calculate the area of the polygon.

## Method

You need to know the coordinates of the vertices (corners) of the polygon. For a state, you could determine those with a GPS device or through surveying. Each vertex will have coordinates with respect to some coordinate system, like (x1,y1), (x2,y2),...,(xn,yn), where 'n' is the last vertex. With that information, there is a formula for calculating the area. I can give you a reference to a web site that explains the formula:

Polygon Area:

If, for example, you have a plot of land with five vertices (x1,y1), (x2,y2),(x3,y3),(x4,y4) and (x5,y5), the area would be

A = (1/2)(x1*y2 - x2*y1 + x2*y3 - x3*y2 + x3y4 - x4y3 + x4*y5 - x5*y4 + x5*y1 - x1*y5)

## Installation

```\$ python setup.py install
```

## Usage

```\$ polygon_area.py --command
Number of vertices: 3
Vertice (X, Y): 30,28
Vertice (X, Y): 30,33
Vertice (X, Y): 50,30
--------------------
Polygon area: 50.00 u.a.
```

## Project Information

Author: Nycholas de Oliveira e Olivera New BSD License