Trying to understand Heron's formula [duplicate]

Hint:

\begin{align} h^2 &=b^2 - d^2\\ &=b^2 - \frac{(b^2+c^2-a^2)^2}{4c^2}\\ &=\frac{(2bc)^2-(b^2+c^2-a^2)^2}{4c^2}\\ &=\frac{(2bc+b^2+c^2-a^2)(2bc-b^2-c^2+a^2)}{4c^2}\\ &=\frac{\big[(b+c)^2-a^2\big]\big[-(b-c)^2+a^2\big]}{4c^2}\\ &=\frac{(a+b+c)(-a+b+c)(a-b+c)(a+b-c)}{4c^2} \end{align}