Why it matters
Point-in-polygon is fundamental test. Understanding shapes GIS + graphics.
Advertisement
The architecture
Ray from point.
Count edge crossings.
Odd = inside; even = outside.
Advertisement
How it works end to end
Ray casting O(n).
Handle edge cases: vertex on ray, edge parallel.
Winding number for complex polygons.