Answer the question
In order to leave comments, you need to log in
How to find out if a point lies in a given polygon?
There is a picture, it has n number of polygons (mostly 4-angle), they do not intersect. So how do you know to which polygon an arbitrarily introduced current belongs?
What mathematical algorithm should be used?
Answer the question
In order to leave comments, you need to log in
So I say that the ways to solve the problem work faster than the tools.
I suggest a simple way: use the polygon color fill in memory and check the color of the point in the desired coordinates)
And it will work quickly (natively - EVERYWHERE!) And it will definitely work!)
If you need to quickly and periodically check (mouse-move, for example) - make a map: an image with areas filled with different colors (somewhere in memory).
Then, we take the desired coordinates (the current coordinates of the "mouse" cursor, for example) the color of the map image pixel (from memory) and look at the created list based on the number of necessary (for monitoring) zones: which zone/segment it (pixel with desired coordinates) belongs.
Algorithm for determining if a point hits the contour on o ...
Here , I redid the function in javascript , you can see it visually.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question