Intersection between segments of straight lines

0

I would like some algorithm that I could get from the slope of the semi-circles and their extreme points, to know if they are competing or not.

    
asked by anonymous 02.07.2017 / 17:25

1 answer

0

If you have the extreme points you automatically have the slope of the line, but that does not matter because you just have to

((y1_r1 >= y1_r2) == (y2_r1 <= y2_r2)) && ((y1_r1 <= y1_r2) == (y2_r1 >= y2_r2))

If you return True they are competing.

In this case, y1_r1 is the co-ordinate y of the end of the line 1 with the lower coordinate x .

    
02.07.2017 / 19:15