Franklin's Point Inclusion in Polygon (PNPOLY) Algorithm

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.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


[1] W. R. Franklin. "PNPOLY - Point Inclusion in Polygon Test." (Oct 9, 2018)
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.