torchsig.utils.coordinate_system.line_intersection¶
- torchsig.utils.coordinate_system.line_intersection(a: Coordinate, b: Coordinate, c: Coordinate, d: Coordinate) bool[source]¶
Check if the line segments AB and CD intersect.
Uses the counter-clockwise orientation test.
- Parameters:
a (Coordinate) – First endpoint of segment AB.
b (Coordinate) – Second endpoint of segment AB.
c (Coordinate) – First endpoint of segment CD.
d (Coordinate) – Second endpoint of segment CD.
- Returns:
True if segments AB and CD intersect.
- Return type: