Function pnpoly::pnpoly [−][src]
pub fn pnpoly<T: PartialOrd + Add<Output = T> + Div<Output = T> + Mul<Output = T> + Sub<Output = T> + Copy>(
vertices: &Vec<Vec<T>>,
point: &Vec<T>
) -> bool
Performs a point-included-in-polygon test
Examples
use pnpoly::pnpoly; let vertices = vec![ vec![ 1.0, 1.0 ], vec![ 1.0, 2.0 ], vec![ 2.0, 2.0 ], vec![ 2.0, 1.0 ] ]; let point = vec![ 1.2, 1.9 ]; let included = pnpoly(&vertices, &point);
Panics
- if any leaf vectors do not consist of a coordinate pair (is not a vector of length 2)
- if any leaf vector contains anything but a numeric or an unsigned numeric type, fx u32