# Heron's formula

Heron's formula gives the area, $A$, of a triangle with sides $a, b, c$ as: $$A = \sqrt{s(s-a)(s-b)(s-c)} \;\mathrm{where}\;s = \textstyle\frac{1}{2}(a+b+c).$$ For example,

>>> a = 4.503
>>> b = 2.377
>>> c = 3.902
>>> s = (a + b + c) / 2
>>> area = math.sqrt(s * (s - a) * (s - b) * (s - c))
>>> area
4.63511081571606

(Don't forget to import math if you haven't already in this Python session.)

See also Question P9.1.1.