library geometry
point-in-polygon algorithm
pepin82/geometry
point-in-polygon algorithm
- Friday, February 9, 2018
- by pepin82
- Repository
- 1 Watchers
- 1 Stars
- 35 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Description
, (*1)
Point In Polygon Algorithm, based on Michaël Niessen implementation [http://assemblysys.com/php-point-in-polygon-algorithm/], (*2)
Usage
use \Geometry\Point;
use \Geometry\Points;
use \Geometry\Polygon;
$polygon = new Polygon(new Points(array(
new Point(-1, -1),
new Point(-1, 1),
new Point(1, 1),
new Point(1, -1),
new Point(-1, -1)
)));
if($polygon->contains(new Point(0, 0))) {
echo "point is contained in polygon";
}
else {
echo "point isn't contained in polygon";
}
dev-master
9999999-dev
point-in-polygon algorithm
Sources
Download
MIT
GNU GPL V3
The Requires
The Development Requires
by
Andrés Sendra