Saturday, June 16, 2012

Height to Area (UVA - 10522)


I'm not good at Geometry at all. Now I'm trying to learn geometry and want to become good at it. I'm using this list of geometry problems shared by Shahriar Rouf Nafi. Today I'm going to discuss about this problem - Height to Area. You are given 3 heights of a triangle, you have to find out the area of the triangle.


Now given 3 sides Ha, Hb and Hc. We have to calculate the area A.

If three sides are a, b and c we can have -

\[ A = \frac{1}{2} \times a \times Ha ........ (1) \] \[ A = \frac{1}{2} \times b \times Hb ........ (2) \] \[ A = \frac{1}{2} \times c \times Hc ........ (3) \]
Now from 1 and 2, we can get
\[ \frac{a}{b} = \frac{Hb}{Ha} ........ (4) \] \[ \frac{b}{c} = \frac{Hc}{Hb} ........ (5) \]
From (4) and (5)
\[ a : b : c = Hb \times Hc : Hc \times Ha : Ha \times Hb \] As Ha, Hb and Hc given, we got the ratio of a, b and c.

So there will be a k, for which
\[ a = k \times Hb \times Hc ...... (6) \] \[ b = k \times Hc \times Ha ...... (7) \] \[ c = k \times Ha \times Hb ...... (8) \]
If the angles are A, B and C. We know that -

\[ \cos C = \frac{a^2 + b^2 - c^2}{2 \times b \times c} = \frac{Hb^2 \times Hc^2 + Hc^2 \times Ha^2 + Ha^2 \times Hb^2}{2 \times Hb \times Hc^2 \times Ha} \]
So, \[ C = \cos^{-1} \frac{Hb^2 \times Hc^2 + Hc^2 \times Ha^2 + Ha^2 \times Hb^2}{2 \times Hb \times Hc^2 \times Ha} \]
Now, from sin rule
\[ Ha = b \times \sin C \] \[ So,  b = \frac{Ha} {\sin C} ...... (9) \]
From (7) and (9)  we get
\[ k = \frac{1} {Hc \times \sin C} \]
We know Ha, Hb, Hc, and k, so we can calculate the exact value of a, b and c. So we can calculate the area of triangle by the following formula -
\[ A = \sqrt{ \frac{s \times (s - a) \times (s - b) \times (s - c)} {2} }, where   s = \frac{a + b + c}{2} \] This was my solution.

While discussing my solution with Nafi, he gave me a much smarter solution, Here it is
Area
\[ A = \frac{1}{2} \times a \times Ha \] So \[ a = 2 \times \frac{A}{Ha} ... (1) \] Similarly, \[ b = 2 \times \frac{A}{Hb} ... (2) \] \[ c = 2 \times \frac{A}{Hc} ... (3) \] Now, \begin{align} s &= \frac{a + b + c}{2}\\ &= (\frac{A}{Ha} + \frac{A}{Hb} + \frac{A}{Hc}) \end{align} And, \[ A^2 = s \times (s - a) \times (s - b) \times (s - c) \] \[ A^2 = (\frac{A}{Ha} + \frac{A}{Hb} + \frac{A}{Hc}) \times (\frac{A}{Hb} + \frac{A}{Hc} - \frac{A}{Ha}) \times (\frac{A}{Hc} + \frac{A}{Ha} - \frac{A}{Hb}) \times (\frac{A}{Ha} + \frac{A}{Hb} - \frac{A}{Hc}) \] \[ \Rightarrow A^2 = A^4 \times (\frac{1}{Ha} + \frac{1}{Hb} + \frac{1}{Hc}) \times (\frac{1}{Hb} + \frac{1}{Hc} - \frac{1}{Ha}) \times (\frac{1}{Hc} + \frac{1}{Ha} - \frac{1}{Hb}) \times (\frac{1}{Ha} + \frac{1}{Hb} - \frac{1}{Hc}) \] \[ \Rightarrow A^2 = \frac{1}{(\frac{1}{Ha} + \frac{1}{Hb} + \frac{1}{Hc}) \times (\frac{1}{Hb} + \frac{1}{Hc} - \frac{1}{Ha}) \times (\frac{1}{Hc} + \frac{1}{Ha} - \frac{1}{Hb}) \times (\frac{1}{Ha} + \frac{1}{Hb} - \frac{1}{Hc})} \] \[ \Rightarrow A = \sqrt{\frac{1}{(\frac{1}{Ha} + \frac{1}{Hb} + \frac{1}{Hc}) \times (\frac{1}{Hb} + \frac{1}{Hc} - \frac{1}{Ha}) \times (\frac{1}{Hc} + \frac{1}{Ha} - \frac{1}{Hb}) \times (\frac{1}{Ha} + \frac{1}{Hb} - \frac{1}{Hc})}} \]
Much cleaner solution. Thanks Nafi.