If we take any point from this image, how can we tell if that point is inside these set of points, when we have the positions of all these points?
If we take any point from this image, how can we tell if that point is inside these set of points, when we have the positions of all these points?
You can use shapely:
Sample code below:
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
point = Point(0.5, 0.5)
polygon = Polygon([(0, 0), (0, 1), (1, 1), (1, 0)])
print(polygon.contains(point))