Skip to content

kimhunter/PointInPolygon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation in ruby of the algorithm found in Point in Polygon Winding Number Inclusion

Usage

require "pinp"
points = []
points << Pinp::Point.new(0,0)
points << Pinp::Point.new(20,0)
points << Pinp::Point.new(20,20)
points << Pinp::Point.new(0,20)

pgon = Pinp::Polygon.new points
puts pgon.contains_point? Pinp::Point.new(10, 10)
puts pgon.contains_point? Pinp::Point.new(20.1 ,10)

###Todo

  • more testing
  • add option to test if point is on any edge of the polygon

About

Find a point in a polygon based on Crossing Number Inclusion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages