Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
dict of formulas solution in Clear category for Simple Areas by maybe
def simple_areas(*args):
from math import pi,sqrt
# (1) circle (2) rectangle (3) triangle -> Heron's formula
func={ 1: lambda d:d*d*pi/4, 2: lambda a,b: a*b,
3: lambda a,b,c: sqrt((a+b-c)*(a+c-b)*(b+c-a)*(a+b+c))/4 }
return round(func[len(args)](*args),2)
Dec. 30, 2019
Comments: