Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Short solution in Clear category for Similar Triangles by martin_b
# compute and sort squares of sides of the triangles and check that all sides have the same ratio
sides = lambda c: sorted((x1-x2)**2+(y1-y2)**2 for (x1, y1), (x2, y2) in [(c[i-1], c[i]) for i in range(3)])
similar_triangles = lambda c1, c2: len({s1/s2 for (s1, s2) in zip(sides(c1), sides(c2))}) == 1
Dec. 26, 2020
Comments: