# The minimum perimeter and maximum height of a triangle under constraints

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).

• This may not be the right place to get help implementing something in PHP... I'd try to help with the formulas, but I don't think I understand the question. – TravisJ May 12 '15 at 18:54
• (This question was originally Google-translated from Spanish; I edited to clarify the language in some places, but not in the bullet points.) – user147263 May 12 '15 at 19:07
• I do not need help in php, I just wanted to say that I can only use simple mathematical functions such as sin, arctan, pow ... standars in all basic languages like java c ..... – Jesús May 12 '15 at 19:18
• Let $a,b,c=a-b$ the vectors of the triangle sides. The first then is $\min |a|+|b|+|a-b|$ when $b^2-((a\cdot b)/|a|)^2=h_1^2, a^2-((a\cdot b)/|b|)^2=h_2^2$ given. Wolfram Alpha could not. – Alexey Burdin May 12 '15 at 19:30

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:
$$q(z) = 1 - \left(2 \frac{h_a}{h_b} + 1 + 2 \frac{h_b}{h_a}\right) z + 3 z^2 + z^3. \tag{4}$$
• @Jesús: it is obvious that you have no angle, but $(3)$ just shows that the perimeter depends on the angle between $a$ and $b$. So by differentiating $p(\theta)$ and solving $p'(\theta)=0$ you can find the optimal angle. – Jack D'Aurizio May 12 '15 at 20:24