Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second: SymPy FTW - now with parameter expansion solution in 3rd party category for Similar Triangles by leggewie
from typing import List, Tuple
from sympy.geometry import Triangle, Point
# improved version with parameter expansion
# inspired by https://py.checkio.org/mission/similar-triangles/publications/r_tchaik/python-3/sympy-triangle/
Coords = List[Tuple[int, int]]
def similar_triangles(coords_1: Coords, coords_2: Coords) -> bool:
# t1 and t2 are SymPy Triangle objects
t1 = Triangle(*coords_1)
t2 = Triangle(*coords_2)
return t1.is_similar(t2)
June 1, 2021
Comments: