PHP Classes


Recommend this page to a friend!
  Classes of Samuel Adeshina   Greens PHP Polygon Area   Download  
Role: Auxiliary data
Content type: text/markdown
Description: Read Me
Class: Greens PHP Polygon Area
Calculate the area and perimeter of a polygon
Author: By
Last change:
Date: 8 years ago
Size: 671 bytes


Class file image Download


This is an implementation of greens theorem to calculate the area of an irregular polygonal shape in pure php. The class can also be used to calculate the perimeter of an irregular polygon.

Possible Applications

  1. It can be used to calculate the area of any place (a city, school and so on) provided their coordinates are known
  2. It can be useful in situations where the distance around a place needs to be calculated

The class accepts an array of Points (x, y coordinates) as parameter. This points are then summed up into the vertices of an irregular polygon which can be used to calculate the area and distance along the polygonal shape