Franklin's Point Inclusion in Polygon (PNPOLY) Algorithm
This Demonstration implements Franklin's point inclusion in polygon (PNPOLY) algorithm  that tests whether a point is inside a polygon (convex or concave). The idea, based on Jordan's curve theorem, is to count how many times a ray from the test point crosses an edge of the polygon. At each crossing, the status changes from inside to outside or vice versa.
 W. R. Franklin. "PNPOLY - Point Inclusion in Polygon Test." (Oct 9, 2018) wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html.