MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / check_simtri

Function check_simtri

numericals.py:808–820  ·  view source on GitHub ↗

Check if 6 points make a pair of similar triangles.

(points: list[Point])

Source from the content-addressed store, hash-verified

806
807
808def 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
823def check_contri(points: list[Point]) -> bool:

Callers

nothing calls this directly

Calls 2

close_enoughFunction · 0.85
distanceMethod · 0.45

Tested by

no test coverage detected