I'm trying to create code that does calculation to know if the line is passing through the rectangle (obstacle), since I only know the position of sta1 and sta2 and I also know the x_min, x_max and y_min, y_max of the rectangle.
sta1 position(x,y) = (1,5) sta2 position(x,y) = (5,1)
retangle x_min = 3 retangle x_max = 4
retangle y_min = 2 retangle y_max = 3
I already have the function that returns the position of the stations:
sta1.position
(1,5)
I also already have the code to get the Euclidean distance between the points:
distance sta1 sta2
example: 20
That is, I need a code where given two points (x, y), and an obstacle that is a rectangle (x,_min, x_max, y_min, y_max), the output of the code informs if there is a line of sight or if the obstacle is in the middle of the way.
Some help in python doing this calculation would help.