1 | var pointInPolygon = require('../');
|
2 | var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
|
3 |
|
4 | console.log(pointInPolygon([ 1.5, 1.5 ], polygon)); // true
|
5 | console.log(pointInPolygon([ 4.9, 1.2 ], polygon)); // false
|
6 | console.log(pointInPolygon([ 1.8, 1.1 ], polygon)); // true
|