Franklin's Point Inclusion in Polygon (PNPOLY) Algorithm

​
boundary polygon
geometry
convex hull
seed
123
number
20
size
0.015
test points
seed
123
number
500
size
0.015
This Demonstration implements Franklin's point inclusion in polygon (PNPOLY) algorithm[1] 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.

References

[1] W. R. Franklin. "PNPOLY - Point Inclusion in Polygon Test." (Oct 9, 2018) wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html.

External Links

Jordan Curve Theorem (Wolfram MathWorld)
Point in Triangle
An Efficient Test for a Point to Be in a Convex Polygon
Color Blindness
Sylvester's Four-Point Problem

Permanent Citation

Frederick Wu
​
​"Franklin's Point Inclusion in Polygon (PNPOLY) Algorithm"​
​http://demonstrations.wolfram.com/FranklinsPointInclusionInPolygonPNPOLYAlgorithm/​
​Wolfram Demonstrations Project​
​Published: November 6, 2018