(l1: Line, l2: Line)
| 575 | |
| 576 | |
| 577 | def line_line_intersection(l1: Line, l2: Line) -> Point: |
| 578 | a1, b1, c1 = l1.coefficients |
| 579 | a2, b2, c2 = l2.coefficients |
| 580 | # a1x + b1y + c1 = 0 |
| 581 | # a2x + b2y + c2 = 0 |
| 582 | d = a1 * b2 - a2 * b1 |
| 583 | if d == 0: |
| 584 | raise InvalidLineIntersectError |
| 585 | return Point((c2 * b1 - c1 * b2) / d, (c1 * a2 - c2 * a1) / d) |
| 586 | |
| 587 | |
| 588 | def check_too_close( |