For any triangle with side lengths , the area can be found using the following formula:
where the semi-perimeter .
Isosceles Triangle Simplification
for all triangles
for all isosceles triangles
Let's say that you have a right triangle with the sides , , and . Your semi- perimeter would be since ÷ is . Then you have , , . The square root of is . The area of your triangle is .
In general, it is a good advice not to use Heron's formula in computer programs whenever we can avoid it. For example, whenever vertex coordinates are known, vector product is a much better alternative. Main reasons:
- Computing the square root is much slower than multiplication.
- For triangles with area close to zero Heron's formula computed using floating point variables suffers from precision problems.