ruby-geometry
ruby-geometry copied to clipboard
Simple geometry classes and algorithms in Ruby
I search function to count distance 2 polygons. Simple outline as distance 
I haven't gotten a chance to spend much time with this, but I've dropped in the algorithm I'm using in my application to replace `Polygon.contains?`. There's one failing test, which...
arr = [Geometry::Point.new(1.6, 1.0), Geometry::Point.new(1.6, 2.0), Geometry::Point.new(1.2, 2.0), Geometry::Point.new(1.2, 1.0)] point = Geometry::Point.new(1.5, 1.5) result = Geometry::Polygon.new(arr).contains?(point) Result = true. It's ok. But: arr = [Geometry::Point.new(1.6, 1.0), Geometry::Point.new(1.6, 2.0), Geometry::Point.new(1.2,...
Hi Daniel, You may find here a pull request removing the full randomness to determine a _good_ray_. I've added missing test for closed polygons. The test is based on the...
I have modified `PointInPolygon#point_location` to use `random_ray` directly instead Then it becomes very fast for me And the result is acceptable too (observed on a map with markers and polygons)...