Skip to content

pepin82/geometry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Build Status

Point In Polygon Algorithm, based on Michaël Niessen implementation [http://assemblysys.com/php-point-in-polygon-algorithm/]

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";
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages