Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First: SymPy FTW solution in 3rd party category for Similar Triangles by leggewie
from typing import List, Tuple
from sympy.geometry import Triangle, Point
Coords = List[Tuple[int, int]]
def similar_triangles(coords_1: Coords, coords_2: Coords) -> bool:
# t1 and t2 are SymPy Triangle objects
t1 = Triangle(Point(coords_1[0]), Point(coords_1[1]), Point(coords_1[2]))
t2 = Triangle(Point(coords_2[0]), Point(coords_2[1]), Point(coords_2[2]))
return t1.is_similar(t2)
May 30, 2021
Comments: