Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
thats not a practical solution solution in Speedy category for Similar Triangles by Stensen
from math import sqrt, acos
def angles(c):
a, b, c = [sqrt((x2-x1)**2+(y2-y1)**2) for (x1, y1), (x2, y2) in zip(c, c[1:]+c[:1])]
α, β, γ = acos((a**2+b**2-c**2)/(2*a*b)), acos((b**2+c**2-a**2)/(2*b*c)), acos((c**2+a**2-b**2)/(2*c*a))
return sorted([α, β, γ])
def similar_triangles(c1, c2): return angles(c1)==angles(c2)
Sept. 21, 2020
Comments: