Difference between revisions of "Heron's Formula"
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
It is named after the first-century engineer [https://en.wikipedia.org/wiki/Heron_of_Alexandria Heron of Alexandria] (or Hero) who proved it in his work ''Metrica'', though it was probably known centuries earlier. | It is named after the first-century engineer [https://en.wikipedia.org/wiki/Heron_of_Alexandria Heron of Alexandria] (or Hero) who proved it in his work ''Metrica'', though it was probably known centuries earlier. | ||
+ | |||
+ | ==History== | ||
+ | |||
+ | The formula is credited to [https://en.wikipedia.org/wiki/Hero_of_Alexandria Heron (or Hero) of Alexandria], and a proof can be found in his book ''Metrica''. Mathematical historian [https://en.wikipedia.org/wiki/Thomas_Heath_(classicist) Thomas Heath] suggested that [https://en.wikipedia.org/wiki/Archimedes Archimedes] knew the formula over two centuries earlier, and since ''Metrica'' is a collection of the mathematical knowledge available in the ancient world, it is possible that the formula predates the reference given in that work. | ||
+ | |||
+ | A formula equivalent to Heron's was discovered by Chinese mathematician Qin Jiushao: | ||
+ | |||
+ | <cmath>A = \frac{1}{2} \sqrt{a^2 c^2 - (\frac{a^2 + c^2 - b^2}{2}^2)}</cmath> published in ''[https://en.wikipedia.org/wiki/Mathematical_Treatise_in_Nine_Sections Mathematical Treatise in Nine Sections]'' ([https://en.wikipedia.org/wiki/Qin_Jiushao Qin Jiushao], 1247). | ||
== Proof == | == Proof == | ||
Line 41: | Line 49: | ||
==Example== | ==Example== | ||
− | Let | + | |
− | + | Let <math>\triangle ABC</math> be the triangle with sides <math>a = 3</math>, <math>b = 4</math>, and <math>c = 5</math>. This triangle's semiperimeter is | |
− | + | ||
− | + | \begin{align*} | |
− | + | s &= \frac{1}{2} (a + b + c) \\ | |
+ | &= \frac{1}{2} (3 + 4 + 5) \\ | ||
+ | &= 16 | ||
+ | \end{align*} | ||
+ | |||
+ | therefore <math>s - a = 13</math>, <math>s - b = 12</math>, <math>s - c = 11</math>, and the area is | ||
+ | |||
+ | \begin{align*} | ||
+ | A &= \sqrt{s(s - a)(s - b)(s - c)} \\ | ||
+ | &= \sqrt{13 \times 12 \times 11} \\ | ||
+ | &= 24 | ||
+ | \end{align*} | ||
+ | |||
+ | In this example, the triangle's side lengths and area are [[Integer|integers]], making it a [https://en.wikipedia.org/wiki/Heronian_triangle Heronian triangle]. However, Heron's formula works equally well when the side lengths are [[Real number|real numbers]]. As long as they obey the strict [[Triangle Inequality|triangle inequality]], they define a triangle in the [https://en.wikipedia.org/wiki/Euclidean_plane Euclidean plane] whose area is a positive real number. | ||
== See Also == | == See Also == |
Latest revision as of 16:24, 23 February 2025
Contents
Theorem
In geometry, Heron's formula (or Hero's formula) gives the area of a triangle in terms of three side lengths, ,
,
. Letting
be the semiperimeter of the triangle,
, the area
is
It is named after the first-century engineer Heron of Alexandria (or Hero) who proved it in his work Metrica, though it was probably known centuries earlier.
History
The formula is credited to Heron (or Hero) of Alexandria, and a proof can be found in his book Metrica. Mathematical historian Thomas Heath suggested that Archimedes knew the formula over two centuries earlier, and since Metrica is a collection of the mathematical knowledge available in the ancient world, it is possible that the formula predates the reference given in that work.
A formula equivalent to Heron's was discovered by Chinese mathematician Qin Jiushao:
published in Mathematical Treatise in Nine Sections (Qin Jiushao, 1247).
Proof
Using basic Trigonometry, we have
which simplifies to
The Law of Cosines states that in triangle ,
, which can be written as
. Thus,
Now, we can simplify: \begin{align*} [ABC] &= \sqrt{\frac{a^2b^2}{4} \left( 1 - \frac{(a^2 + b^2 - c^2)^2}{4a^2b^2} \right)} \\ &= \sqrt{\frac{4a^2b^2 - (a^2 + b^2 - c^2)^2}{16}} \\ &= \sqrt{\frac{(2ab + a^2 + b^2 - c^2)(2ab - a^2 - b^2 + c^2)}{16}} \\ &= \sqrt{\frac{((a + b)^2 - c^2)((a - b)^2 - c^2)}{16}} \\ &= \sqrt{\frac{(a + b + c)(a + b - c)(b + c - a)(a + c - b)}{16}} \\ &= \sqrt{s(s - a)(s - b)(s - c)} \end{align*}
Isosceles Triangle Simplification
for all triangles
for all isosceles triangles
simplifies to
Square root simplification/modification
From We can "take out" the
in each
, then we have
Using the difference of squares on the first two and last two factors, we get
and using the difference of squares again, we get
From this equation (although seemingly not symmetrical), it is much easier to calculate the area of a certain triangle with side lengths with quantities with square roots. One can remember this formula by noticing that when finding the cosine of an angle in a triangle, the formula is
and the two terms in the formula are just the denominator and numerator of the fraction for
, only they're squared. This can also serve as a reason for why the area
is never imaginary. This is equivalent of ending at step
in the proof and distributing.
Note
Replacing as
, the area simplifies down to
, or
, or
, another common area formula for the triangle.
Example
Let be the triangle with sides
,
, and
. This triangle's semiperimeter is
\begin{align*} s &= \frac{1}{2} (a + b + c) \\ &= \frac{1}{2} (3 + 4 + 5) \\ &= 16 \end{align*}
therefore ,
,
, and the area is
\begin{align*} A &= \sqrt{s(s - a)(s - b)(s - c)} \\ &= \sqrt{13 \times 12 \times 11} \\ &= 24 \end{align*}
In this example, the triangle's side lengths and area are integers, making it a Heronian triangle. However, Heron's formula works equally well when the side lengths are real numbers. As long as they obey the strict triangle inequality, they define a triangle in the Euclidean plane whose area is a positive real number.
See Also
External Links
- Heron's formula implementations in C++, Java and PHP
- Proof of Heron's Formula Using Complex Numbers
- Heron's Formula - Wikipedia
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.