Check if 6 points make a pair of similar triangles.
(points: list[Point])
| 806 | |
| 807 | |
| 808 | def check_simtri(points: list[Point]) -> bool: |
| 809 | """Check if 6 points make a pair of similar triangles.""" |
| 810 | a, b, c, x, y, z = points |
| 811 | ab = a.distance(b) |
| 812 | bc = b.distance(c) |
| 813 | ca = c.distance(a) |
| 814 | xy = x.distance(y) |
| 815 | yz = y.distance(z) |
| 816 | zx = z.distance(x) |
| 817 | tol = 1e-9 |
| 818 | return close_enough(ab * yz, bc * xy, tol) and close_enough( |
| 819 | bc * zx, ca * yz, tol |
| 820 | ) |
| 821 | |
| 822 | |
| 823 | def check_contri(points: list[Point]) -> bool: |
nothing calls this directly
no test coverage detected