0
Point in polygon
How to find whether a point lies inside the polygon only using the coordinates of the point and the coordinates of the points of polygon as an array?
2 Respostas
+ 2
You need an „even-odd rule“ algorithm, to check whether a point is inside a polygon. The idea is to test how many times a ray intersects the edges of the polygon. This ray starts at the test point and can go in any direction. If the number of intersections is odd, the point is located inside the polygon, otherwise it is outside the polygon.
https://code.sololearn.com/WEANHkGPRytN/?ref=app
0
Thank you so much Michael.