[Math] Finding the third side of a triangle given the area

triangles

I know the area and the lengths of two sides (a and b) of a non-right triangle. I also know P1 (vertex between a and c) and P2 (vertex between a and b).

I already know this much:

Perimeter = $ \frac{(a+b+c)}{2} $

Area = $ A=\sqrt{p(p-a)(p-b)(p-c)} $

How do I simplify the above two equations to solve for c? (Obviously, this is just algebra, but it's long enough that it is prone to error; I've tried this by hand now and gotten a different set of solutions each time.)

Best Answer

By cosine rule, \begin{align} c^2&=a^2+b^2-2ab\cos\gamma \tag{1}\label{1} , \end{align}
And from the formula for the area \begin{align} 2S&=ab\sin\gamma ,\\ \sin\gamma&=\frac {2S}{ab} , \end{align}

so, with \begin{align} \cos\gamma&=\pm\sqrt{1-\sin^2\gamma} = \pm\sqrt{1-\frac {4S^2}{a^2b^2}} =\pm\frac{\sqrt{a^2b^2-4S^2}}{ab} \end{align}

\eqref{1} becomes

\begin{align} c^2&=a^2+b^2\pm2\sqrt{a^2b^2-4S^2} . \end{align}

Related Question