PHP Class Polygon, AlgorithmsNYC

Inheritance: extends Shape
Afficher le fichier Open project: AlgorithmsNYC/AlgorithmsNYC Class Usage Examples

Protected Properties

Свойство Type Description
$points

Méthodes publiques

Méthode Description
__construct ( )
addPoint ( Point $point )
contains ( Point $point )
count ( ) Interface Countable
current ( )
find_polygons_in_graph ( Graph $graph )
getArea ( ) Calculates the area of any given non-crossing polygon
getCentroid ( ) Gets the coordinates of the centroid of the polygon
getPerimeter ( )
includes ( Point $point ) Checks the presence of a point in the polygon Returns : 0 : Point not in polygon 1 : Point in polygon 2 : Point is a node of the polygon
key ( )
next ( )
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value ) Interface ArrayAccess
offsetUnset ( $offset )
polygon_finder_recursive ( Graph $graph, $currentPolygon, $currentVertex, $lastVertex )
rewind ( )
valid ( )

Method Details

__construct() public méthode

public __construct ( )

addPoint() public méthode

public addPoint ( Point $point )
$point Point

contains() public méthode

public contains ( Point $point )
$point Point

count() public méthode

Interface Countable
public count ( )

current() public méthode

public current ( )

find_polygons_in_graph() public static méthode

public static find_polygons_in_graph ( Graph $graph )
$graph Graph

getArea() public méthode

Calculates the area of any given non-crossing polygon
See also: http://www.mathopenref.com/coordpolygonarea2.html
public getArea ( )

getCentroid() public méthode

Gets the coordinates of the centroid of the polygon
See also: http://stackoverflow.com/questions/2792443/finding-the-centroid-of-a-polygon
public getCentroid ( )

getPerimeter() public méthode

public getPerimeter ( )

includes() public méthode

Checks the presence of a point in the polygon Returns : 0 : Point not in polygon 1 : Point in polygon 2 : Point is a node of the polygon
See also: http://stackoverflow.com/questions/217578/point-in-polygon-aka-hit-test
public includes ( Point $point )
$point Point

key() public méthode

public key ( )

next() public méthode

public next ( )

offsetExists() public méthode

public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset )

offsetSet() public méthode

Interface ArrayAccess
public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

polygon_finder_recursive() public méthode

public polygon_finder_recursive ( Graph $graph, $currentPolygon, $currentVertex, $lastVertex )
$graph Graph

rewind() public méthode

public rewind ( )

valid() public méthode

public valid ( )

Property Details

$points protected_oe property

protected $points