I'm developing a web application that consists of a calculator triangles. Although I am not a mathematician, with paper, derive and Geogebra I managed to get a lot of formulas to calculate a triangle with the minimum number of data possible. Maybe some is unpublished, and limits to be introduced only correct data.
I do not get the following formulas :
The minimum perimeter of any triangle (abc) once known the heights corresponding to the $a$ and $b$-sides.
The maximum height corresponding to the side $b$ of any triangle (abc) once known the value of its perimeter and height corresponding to the $a$-side.
I am looking for an answer in a way that could be implemented in php (programming language).
In the first case, we may assume that the angle between the $a$ and $b$ sides is $\theta$. Then: $$ h_a = b\sin\theta,\qquad h_b = a\sin\theta \tag{1}$$ and by the law of cosines: $$ c^2 = a^2+b^2-2ab\cos\theta = \frac{h_a^2+h_b^2-2h_a h_b\cos\theta}{\sin^2\theta}\tag{2}$$ so we just have to find the stationary points of the function: $$ p(\theta) = \frac{h_a+h_b+\sqrt{h_a^2+h_b^2-2h_a h_b\cos\theta}}{\sin\theta}\tag{3}$$ over the interval $(0,\pi)$ by solving $p'(\theta)=0$ or $\frac{d}{d\theta}\frac{1}{p(\theta)}=0$. This leads to a cubic equation in $\cos\theta$, hence the problem, in general, is not solvable with straightedge and compass. When the perimeter reaches it minimum we have that $\cos\theta$ is the only root in $(-1,1)$ of:
The second problem is just the dual problem of the first one.