Expand description
A closed polygon in a plane, its corners in order and the last joined back to the first: the area it encloses and whether it holds a point. One implementation over plain coordinates, in single or double precision.
Functionsยง
- contains
- Whether
plies insidepolygonstaken 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. - signed_
area - The area
polygonencloses, signed by the way it is walked: positive counter-clockwise (x toward y), negative clockwise; zero with fewer than three corners. A caller wanting the size alone takesabs.