pyfeyn2.auto.position.intersect

pyfeyn2.auto.position.intersect(A, B, C, D)[source]

Return true if line segments AB and CD intersect

Parameters:
  • A (Point) – The first point of the first line segment.

  • B (Point) – The second point of the first line segment.

  • C (Point) – The first point of the second line segment.

  • D (Point) – The second point of the second line segment.

Returns:

True if the line segments intersect, False otherwise.

Return type:

bool

Examples

>>> A = Point(0, 0)
>>> B = Point(1, 1)
>>> C = Point(0, 1)
>>> D = Point(1, 0)
>>> intersect(A, B, C, D)
True
>>> A,B,C,D = Point(0,0), Point(1,1), Point(0,0), Point(1,0)
>>> intersect(A, B, C, D)
False