I am looking for a solution to calculate an irregularly shaped border.
Lats take a look at an example area:

if I Minimum x and yand Maximum x and the ylike:
MaxX = 5
MinX = 1
MaxY = 5
MinY = 1
in python language:
X = {"Min":1, "Max":5}
Y = {"Min":1, "Max":5}
I can check if there is any coordinate on the square border or not, simply by comparing the axis with min and max of the square border.
now look at these 2 irregular examples:

Now, how can I calculate the border and shape coordinates? I have a point coordinate, but I do not have the coordinates inside the figure and the coordinates of the lines that connect each point of the figure.
:, Point-in-Polygon, , , , .
:, , , , - , , , .