Back to geometry
Heron’s formula is a formula that is used to find the area of any triangle. All you need is the lengths of all 3 sides.
Text
area = √s * (s-a) * (s-b) * (s-c)
s = (a+b+c)/2
Challenge
Using this formula, write a function that solves for the area of a triangle, given 3 side lengths.
- Triangle 1 with sides 10, 12, and 15.
- Triangle 2 with sides 12, 14, and 7.
You can set the sides to the Double data type.