point-in-polygon icon indicating copy to clipboard operation
point-in-polygon copied to clipboard

An interactive program for creating polygons and determining if a given point is inside or outside the polygons

Point in Polygon

Experimenting the point-in-polygon algorithm with C++ and OpenGL.

Runtime

O(N), where N = #sides of polygon(s).

Build and Run

mkdir build && cd build
cmake ..
make

// Run example with single polygon
./Example

// Run example with multiple polygons 
// (i.e. you can draw multiple polygons and test
// if a point is inside of any of the polygons).
./Example2

Examples

Alt Text Alt Text