Skip to main content

contains

Function contains 

Source
pub fn contains<R: Real>(polygons: &[&[[R; 2]]], p: [R; 2]) -> bool
Expand description

Whether p lies inside polygons taken together, by the even-odd rule: a point inside an odd number of them is in, so a polygon inside another is a hole whichever way either is walked.

A point on an edge is decided by a half-open rule rather than taken as in or out: an edge counts from its lower end up to, not including, its upper end, and a crossing exactly at p does not count. Two polygons sharing an edge then never both hold a point on it.