Closed VictorXjoeY closed 4 years ago
Code is updated to match consider these rules: http://geomalgorithms.com/a03-_inclusion.html#Edge-Crossing-Rules
And to match with this implementation: http://geomalgorithms.com/a03-_inclusion.html#wn_PnPoly()
But it still gives WA on: https://open.kattis.com/problems/pointinpolygon
Fixed. The problem was actually in point_inside_segment(q, a, b) which was not properly treating the degenerate case when a == b.
Geometry/point_inside_polygon.cpp
It fails on https://open.kattis.com/problems/pointinpolygon