PHP 클래스 Polygon, AlgorithmsNYC

상속: extends Shape
파일 보기 프로젝트 열기: AlgorithmsNYC/AlgorithmsNYC 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$points

공개 메소드들

메소드 설명
__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 ( )

메소드 상세

__construct() 공개 메소드

public __construct ( )

addPoint() 공개 메소드

public addPoint ( Point $point )
$point Point

contains() 공개 메소드

public contains ( Point $point )
$point Point

count() 공개 메소드

Interface Countable
public count ( )

current() 공개 메소드

public current ( )

find_polygons_in_graph() 공개 정적인 메소드

public static find_polygons_in_graph ( Graph $graph )
$graph Graph

getArea() 공개 메소드

Calculates the area of any given non-crossing polygon
또한 보기: http://www.mathopenref.com/coordpolygonarea2.html
public getArea ( )

getCentroid() 공개 메소드

Gets the coordinates of the centroid of the polygon
또한 보기: http://stackoverflow.com/questions/2792443/finding-the-centroid-of-a-polygon
public getCentroid ( )

getPerimeter() 공개 메소드

public getPerimeter ( )

includes() 공개 메소드

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
또한 보기: http://stackoverflow.com/questions/217578/point-in-polygon-aka-hit-test
public includes ( Point $point )
$point Point

key() 공개 메소드

public key ( )

next() 공개 메소드

public next ( )

offsetExists() 공개 메소드

public offsetExists ( $offset )

offsetGet() 공개 메소드

public offsetGet ( $offset )

offsetSet() 공개 메소드

Interface ArrayAccess
public offsetSet ( $offset, $value )

offsetUnset() 공개 메소드

public offsetUnset ( $offset )

polygon_finder_recursive() 공개 메소드

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

rewind() 공개 메소드

public rewind ( )

valid() 공개 메소드

public valid ( )

프로퍼티 상세

$points 보호되어 있는 프로퍼티

protected $points