Ingeometry,Heron's formula (orHero's formula) gives thearea of a triangle in terms of the three side lengths Letting be thesemiperimeter of the triangle,, the area is[1]
It is named after first-century engineerHeron of Alexandria (or Hero) who proved it in his workMetrica, though it was probably known centuries earlier.
Let be the triangle with sides,, and.This triangle's semiperimeter is therefore,,, and the area is
In this example, the triangle's side lengths and area areintegers, making it aHeronian triangle. However, Heron's formula works equally well when the side lengths arereal numbers. As long as they obey the stricttriangle inequality, they define a triangle in theEuclidean plane whose area is a positive real number.
The formula is credited toHeron (or Hero) of Alexandria (fl. 60 AD),[4] and a proof can be found in his bookMetrica. Mathematical historianThomas Heath suggested thatArchimedes knew the formula over two centuries earlier,[5] and sinceMetrica 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.[6]
A formula equivalent to Heron's was discovered by Chinese mathematician Qin Jiushao:
There are many ways to prove Heron's formula, for example usingtrigonometry as below, or theincenter and oneexcircle of the triangle,[8] or as a special case ofDe Gua's theorem (for the particular case of acute triangles),[9] or as a special case ofBrahmagupta's formula (for the case of a degenerate cyclic quadrilateral).
A modern proof, which usesalgebra and is quite different from the one provided by Heron, follows.[10]Let be the sides of the triangle and theangles opposite those sides.Applying thelaw of cosines we get
A triangle with sidesa,b andc
From this proof, we get the algebraic statement that
Thealtitude of the triangle on base has length, and it follows
Triangle with altitudeh cutting basec intod + (c −d)
The following proof is very similar to one given by Raifaizen.[11]By thePythagorean theorem we have and according to the figure at the right. Subtracting these yields This equation allows us to express in terms of the sides of the triangle:For the height of the triangle we have that By replacing with the formula given above and applying thedifference of squares identity we get
We now apply this result to the formula that calculates the area of a triangle from its height:
Geometrical significance ofs −a,s −b, ands −c. See thelaw of cotangents for the reasoning behind this.
If is the radius of theincircle of the triangle, then the triangle can be broken into three triangles of equal altitude and bases and Their combined area iswhere is the semiperimeter.
The triangle can alternately be broken into six triangles (in congruent pairs) of altitude and bases and of combined area (seelaw of cotangents)
The middle step above is, thetriple cotangent identity, which applies because the sum of half-angles is
Combining the two, we getfrom which the result follows.
Heron's formula as given above isnumerically unstable for triangles with a very small angle, causinground-off error when computing with limited precision such as when usingfloating-point arithmetic. Such triangles have one or two sides whose length is very close to the semiperimeter, leading tocatastrophic cancellation. A stable alternative involves arranging the lengths of the sides so that and computing[12]The extra parentheses indicate the order of operations required to achieve numerical stability in the evaluation.
Heron's formula is a special case ofBrahmagupta's formula for the area of acyclic quadrilateral. Heron's formula and Brahmagupta's formula are both special cases ofBretschneider's formula for the area of aquadrilateral. Heron's formula can be obtained from Brahmagupta's formula or Bretschneider's formula by setting one of the sides of the quadrilateral to zero.
Brahmagupta's formula gives the area of acyclic quadrilateral whose sides have lengths as
Heron's formula is also a special case of theformula for the area of a trapezoid or trapezium based only on its sides. Heron's formula is obtained by setting the smaller parallel side to zero.
If one of three given lengths is equal to the sum of the other two, the three sides determine adegenerate triangle, a line segment with zero area. In this case, the semiperimeter will equal the longest side, causing Heron's formula to equal zero.
If one of three given lengths is greater than the sum of the other two, then they violate thetriangle inequality and do not describe the sides of a Euclidean triangle. In this case, Heron's formula gives animaginary result. For example if and, then. This can be interpreted using a triangle in thecomplex coordinate plane, where "area" can be a complex-valued quantity, or as a triangle lying in apseudo-Euclidean plane with one space-like dimension and one time-like dimension.[18]
^The formula used here is thenumerically stable formula (relabeled for), not simply. For example, with,,, the correct area is but the naive implementation produces instead. The area is reported as "Not a triangle" when the side lengths fail thetriangle inequality. When the area is equal to zero, the three side lengths specify adegenerate triangle with three colinear points.
^Bényi, Árpád (July 2003). "A Heron-type formula for the triangle".Mathematical Gazette.87:324–326.doi:10.1017/S0025557200172882.
^Mitchell, Douglas W. (November 2005). "A Heron-type formula for the reciprocal area of a triangle".Mathematical Gazette.89: 494.doi:10.1017/S0025557200178532.
^Alekseevskij, D. V.; Vinberg, E. B.; Solodovnikov, A. S. (1993). "Geometry of spaces of constant curvature". In Gamkrelidze, R. V.; Vinberg, E. B. (eds.).Geometry. II: Spaces of constant curvature. Encyclopaedia of Mathematical Sciences. Vol. 29. Springer-Verlag. p. 66.ISBN1-56085-072-8.