inpoly
Fast point-in-polygon testing using the crossing-number algorithm.
Efficiently determines whether points lie inside, outside, or on the boundary of polygons (including those with holes).
Usage
use array;
use inpoly2;
// Define a square polygon
let node = array!;
// Test some points
let points = array!;
let = inpoly2;
assert!; // point is inside
assert!; // point is outside
assert!; // point on edge counts as inside
assert!; // detected as on boundary
Polygons with Holes
use array;
use inpoly2;
// Diamond with a square hole
let node = array!;
let edge = array!;
let points = array!;
let = inpoly2;
assert!; // center of hole is outside
assert!; // between hole and outer edge is inside
License
MIT