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.

SNAPSHOTS

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

DETAILS

Reference
[1] W. R. Franklin. "PNPOLY - Point Inclusion in Polygon Test." (Oct 9, 2018) wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html.
    • 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.