Difference between revisions of "Heron's Formula"
m (Changed semiperimeter to semi-perimeter for consistancy) |
m (→Example) |
||
(27 intermediate revisions by 18 users not shown) | |||
Line 1: | Line 1: | ||
− | '''Heron's | + | '''Heron's Formula''' (sometimes called Hero's formula) is a [[mathematical formula | formula]] for finding the [[area]] of a [[triangle]] given only the three side lengths. |
− | == | + | == Theorem == |
− | For any triangle with side lengths <math>{a}, {b}, {c}</math>, the area <math>{ | + | For any triangle with side lengths <math>{a}, {b}, {c}</math>, the area <math>{A}</math> can be found using the following formula: |
− | <math> | + | <math>A=\sqrt{s(s-a)(s-b)(s-c)}</math> |
where the [[semi-perimeter]] <math>s=\frac{a+b+c}{2}</math>. | where the [[semi-perimeter]] <math>s=\frac{a+b+c}{2}</math>. | ||
− | |||
+ | == Proof == | ||
+ | |||
+ | <math>[ABC]=\frac{ab}{2}\sin C</math> | ||
+ | |||
+ | <math>=\frac{ab}{2}\sqrt{1-\cos^2 C}</math> | ||
+ | |||
+ | <math>=\frac{ab}{2}\sqrt{1-\left(\frac{a^2+b^2-c^2}{2ab}\right)^2}</math> | ||
+ | |||
+ | <math>=\sqrt{\frac{a^2b^2}{4}\left[1-\frac{(a^2+b^2-c^2)^2}{4a^2b^2}\right]}</math> | ||
+ | |||
+ | <math>=\sqrt{\frac{4a^2b^2-(a^2+b^2-c^2)^2}{16}}</math> | ||
+ | |||
+ | <math>=\sqrt{\frac{(2ab+a^2+b^2-c^2)(2ab-a^2-b^2+c^2)}{16}}</math> | ||
+ | |||
+ | <math>=\sqrt{\frac{((a+b)^2-c^2)(c^2-(a-b)^2)}{16}}</math> | ||
+ | |||
+ | <math>=\sqrt{\frac{(a+b+c)(a+b-c)(b+c-a)(a+c-b)}{16}}</math> | ||
+ | |||
+ | <math>=\sqrt{s(s-a)(s-b)(s-c)}</math> | ||
+ | |||
+ | ==Isosceles Triangle Simplification== | ||
+ | |||
+ | <math>A=\sqrt{s(s-a)(s-b)(s-c)}</math> for all triangles | ||
+ | |||
+ | <math>b=c</math> for all isosceles triangles | ||
+ | |||
+ | <math>A=\sqrt{s(s-a)(s-b)(s-b)}</math> simplifies to <math>A=(s-b)\sqrt{s(s-a)}</math> <math>\blacksquare</math> | ||
+ | |||
+ | ==Example== | ||
+ | Let's say that you have a right triangle with the sides <math>3</math> ,<math>4</math> , and <math>5</math>. Your semi- perimeter would be <math>6</math> since <math>(3+4+5)</math> ÷ <math>2</math> is <math>6</math>. | ||
+ | Then you have <math>6-3=3</math>, <math>6-4=2</math>, <math>6-5=1</math>. | ||
+ | <math>1\cdot 2\cdot 3=6.</math> | ||
+ | <math> 6\cdot 6 = 36</math> | ||
+ | The square root of <math>36</math> is <math>6</math>. The area of your triangle is <math>6</math>. | ||
+ | |||
+ | == See Also == | ||
* [[Brahmagupta's formula]] | * [[Brahmagupta's formula]] | ||
+ | * [[Geometry]] | ||
+ | |||
+ | == External Links == | ||
+ | * [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: | ||
+ | * 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. | ||
+ | |||
+ | [[Category:Geometry]] | ||
+ | [[Category:Theorems]] |
Revision as of 21:28, 21 April 2022
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
Theorem
For any triangle with side lengths , the area can be found using the following formula:
where the semi-perimeter .
Proof
Isosceles Triangle Simplification
for all triangles
for all isosceles triangles
simplifies to
Example
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 .
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.