2017 © Pedro PelĂĄez
 

library geometry

point-in-polygon algorithm

image

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

The README.md

Description

Build Status, (*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";
}

The Versions

09/02 2018

dev-master

9999999-dev

point-in-polygon algorithm

  Sources   Download

MIT GNU GPL V3

The Requires

  • php >=5.3.0

 

The Development Requires

by Andrés Sendra