Why it matters
Polygon operations underlie GIS + graphics. Understanding enables polygon-based work.
Advertisement
The architecture
Shoelace: sum of signed triangles.
Ray casting: point-in-polygon via edge crossings.
Ear clipping: recursively remove ear triangles.
Advertisement
How it works end to end
Ray casting: shoot ray from point; count edge crossings; odd = inside.
Ear clipping: O(n²) simple triangulation; Delaunay for better quality.
Convex hull check: O(n) sequential turn checks.