Answer the question
In order to leave comments, you need to log in
How to determine the presence of a point inside a polygon?
There are two polygons, you need to determine whether the point is in the polygon or not.
What is currently done is to determine if a point is or not in a simple polygon (without overlapping itself). How can you determine if a point is overlapping itself using numpy/matplot.
Create polygons:
from matplotlib.patches import Polygon
polygons = [
{
'label': 'first',
'cors': [
[0.85157715, 0.53259596],
[0.47351539, 0.78381185],
[0.63767088, 0.07172642]
]
},
{
'label': 'second',
'cors': [
[0.82024332, 0.60039117],
[1, 1.80039117],
[1.19215456, 0.62590895],
[1.4, 0.81912354],
[0.83599825, 1.12872215]
]
}
]
for poly in polygons:
polygon = Polygon(poly['cors'], False)
polygon.set_label(poly['label'])
patches.append(polygon)
Answer the question
In order to leave comments, you need to log in
https://ru.wikipedia.org/wiki/%D0%97%D0%B0%D0%B4%D...
https://habr.com/post/301102/
https://habr.com/post /125356/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question