Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
From cosine formula solution in Clear category for The Angles of a Triangle by oLeBeLo
from typing import List
from math import acos,degrees
ang = lambda a,b,c:round(degrees(acos((a**2+b**2-c**2)/(2*a*b))))
#c2 = a2 + b2 - 2ab cos(C)
def checkio(a: int, b: int, c: int) -> List[int]:
t = (a,b,c)
if max(t) >= sum(t)-max(t):
return [0,0,0]
return sorted([ang(t[i],t[(i+1)%3],t[(i+2)%3]) for i in range(3)])
Nov. 26, 2019
Comments: