Difference between revisions of "Heron's Formula"
(Undo revision 47342 by StarWarsLiam (talk)) |
(→External Links: added link) |
||
Line 36: | Line 36: | ||
== External Links == | == External Links == | ||
* [http://www.scriptspedia.org/Heron%27s_Formula Heron's formula implementations in C++, Java and PHP] | * [http://www.scriptspedia.org/Heron%27s_Formula Heron's formula implementations in C++, Java and PHP] | ||
+ | * [http://www.artofproblemsolving.com/Resources/Papers/Heron.pdf Proof of Heron's Formula Using Complex Numbers] | ||
In general, it is a good advice <b>not</b> 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: | In general, it is a good advice <b>not</b> 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. | * Computing the square root is much slower than multiplication. |
Revision as of 13:29, 7 June 2012
Heron's Formula (sometimes called Hero's formula) is a formula for finding the area of a triangle given only the three side lengths.
Contents
[hide]Theorem
For any triangle with side lengths , the area can be found using the following formula:
where the semi-perimeter .
Proof
See Also
External Links
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.