# Is heron's formula inaccurate? [closed]

Here's one example of inaccuracy :-

Suppose a triangle $XYZ$ with sides $a=13$, $b=15$ and $c= 14$. We have to find a perpendicular to side $c$ passing from point $X$.

According to heron's formulae

$\text{Area} = \sqrt{s(s-a)(s-b)(s-c)}$

$A = \sqrt{21 \times 8 \times 7 \times 6}$

$A = 7 \times 3 \times 4$

$A = 84$

Now

$1/2 × \text{base} × \text{height} = 84$

$1/2 × 14 × h = 84$

$H = \dfrac{84}7$

$H = 12$

But by Pythagoras theorem :-

$H ^2 = P^2 + B^2$

Now let's suppose our expected answer is $d$ then (Refer image above ),

$(a+b)^2 = (2d)^2 + c^2$

$28 ^2 = (2d)^2 + 14^2$

$784 = 4d^2 + 196$

$4d^2 = 784 - 196$

$d^2 = 147$

$d = \sqrt{147}$

Which is not equal to $12$ Which proves inaccuracy

## closed as unclear what you're asking by Xander Henderson, Lord Shark the Unknown, user91500, José Carlos Santos, CesareoSep 20 '18 at 15:57

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Please format your text using mathjax – Love Invariants May 13 '18 at 17:34
• How did you use pythagoras theorem? – Love Invariants May 13 '18 at 17:43
• Keep in mind that Hero of Alexandria died ca. 70 AD. If his formula contained an error, it seems very unlikely that it would have survived until today. See this answer for a nice proof of the formula. Heron's formula suffers from catastrophic cancellation when implemented using finite precision arithmetic. This is an issue when the triangle is shaped like a needle. – Carl Christian May 13 '18 at 17:44
• The triangle is a 5-12-13 triangle next to a 3-4-5 traingle scaled up to 9-12-15, with the 12 as the common side. – Peter Phipps May 13 '18 at 17:45
• Where did you get $(a+b)^2=4d^2+c^2$? I'm still trying to figure out how you got to that. The sides $a$ and $b$ don't seem like the hypotenuse, which is what I assume you referred as in the formula $H^2=P^2+B^2$ – Frank W. May 13 '18 at 17:46

Here's what you mean:

You said:

$(a+b)^2=(2d)^2+c^2$

$\Leftrightarrow (XY+XZ)^2=(XH+XH)^2+(HY+HZ)^2$

$\Leftrightarrow XY^2+XZ^2+2XY.XZ=XH^2+XH^2+2XH^2+HY^2+HZ^2+2HY.HZ$

$\Leftrightarrow XY^2+XZ^2+2XY.XZ=(XH^2+HY^2)+(XH^2+HZ^2)+2(XH^2+HY.HZ)$

$\Leftrightarrow XY^2+XZ^2+2XY.XZ=XY^2+XZ^2+2(XH^2+HY.HZ)$

$\Leftrightarrow XY.XZ=XH^2+HY.HZ$

This equality obviously is not true for $XH=12;XY=13;XZ=15;HY=5;HZ=9$, because it is impossible to prove the last equality in general, which means it is false.

• You can use $\cdot$ for multiplication. The LaTeX command is called cdot. – Carl Christian May 13 '18 at 19:39

The inaccuracy is, unfortunately, yours. The step $(a+b)^2=(2d)^2+c^2$ is not a proper way of handling the Pythagorean relations.

If the altitude (of length $d$) separates the base into parts $p$ and $q$, then Pythagoras lets us write $$a^2 = d^2 + p^2 \qquad\text{and}\qquad b^2 = d^2 + q^2 \tag{1}$$ We can use the relation $p+q=c$ to combine these into an equation that allows us to solve for $d$.

Your error, I believe, was in attempting to combine the squared elements in $(1)$, term-by-term: $$(a+b)^2 = (d+d)^2 + (p+q)^2 \qquad(\text{error!})$$ This would be a very convenient algebraic trick, if it worked; but it doesn't. For example, $$5^2=3^2+4^2 \qquad 13^2=5^2+12^2 \qquad\text{but}\qquad \underbrace{(5+13)^2}_{324}\neq\underbrace{(3+5)^2+(4+12)^2}_{320}$$

Instead, we have to work quite a bit harder. We can start by replacing $q$ in $(1)$ with $c-p$: \begin{align} b^2 &= d^2 + (c-p)^2 \tag{2}\\ &= d^2 + c^2 + p^2 - 2 c p \tag{3}\\ &= d^2 + c^2+(a^2-d^2) - 2 c p \tag{4}\\ &=a^2 + c^2 - 2 cp \tag{5}\\ 2 cp&= a^2 -b^2 + c^2 \tag{6}\\ 4c^2p^2 &= ( a^2 -b^2 + c^2)^2 \tag{7}\\ 4c^2(a^2-d^2) &= a^4 + b^2 + c^4 - 2 a^2 b^2+2a^2c^2-2b^2c^2 \tag{8} \end{align}

For the problem at hand, we can substitute $a=13$, $b=15$, $c=14$ to get $$4\cdot 196 \cdot( 169 - d^2 ) = 19600 \quad\to\quad 169 - d^2 = 25 \quad\to\quad d^2 = 144 \quad\to\quad d = \pm 12$$ where we discard the extraneous negative option. Thus, $d=12$, as expected. $\square$

I could stop here, but I won't. Bear with me as I continue manipulating $(8)$ ...

\begin{align} 4a^2c^2-4c^2d^2 &= a^4 + b^2 + c^4 - 2 a^2 b^2-2a^2c^2-2b^2c^2 \tag{9} \\[4pt] -4c^2d^2 &= a^4 + b^2 + c^4 - 2 a^2 b^2-2a^2c^2-2b^2c^2 \tag{10}\\[4pt] 4c^2d^2 &= (a+b+c)(-a+b+c)(a-b+c)(a+b-c) \qquad(\text{trust me}) \tag{11}\\[4pt] \frac14 c^2d^2 &= \frac{1}{16}(a+b+c)(-a+b+c)(a-b+c)(a+b-c) \tag{12}\\[4pt] \left(\frac12 c d\right)^2 &= \frac{a+b+c}{2} \cdot \frac{-a+b+c}{2} \cdot \frac{a-b+c}{2}\cdot \frac{a+b-c}{2} \tag{13} \end{align} Interestingly, if we define $s = (a+b+c)/2$, we have $$s-a = \frac12(a+b+c)-a = \frac12(a+b+c-2a)=\frac{-a+b+c}{2} \tag{14}$$ Also, $$s- b = \frac{a-b+c}{2} \qquad s-c = \frac{a+b-c}{2} \tag{15}$$ Thus, $(13)$ becomes $$\left(\frac12cd\right)^2 = s(s-a)(s-b)(s-c) \tag{16}$$

But $\frac12 cd$ is the area of the triangle! Therefore,

$$\text{area}= \sqrt{s(s-a)(s-b)(s-c)} \tag{\star}$$

We have re-proven Heron's formula! $\square$