# Is it possible to compute Right Triangle's Legs starting from another Right Triangle with the same Hypotenuse?

In an application of the Manhattan Distance trough the haversine formula, I was stuck in a problem that doesn't allow me to compute the right distance among two points in a space.

Despite the scope, it could be useful to many other applications, so I'm trying to find a "good enough" solution of this tedious problem.

Take a look at this simple picture to easily understand the problem: right triangles with same hypotenuse

There are two right triangles, one red and one blue, which have the same hypotenuse but different legs and legs ratios. The two legs of the red triangle are known, so it is easy to compute both hypotenuse and angles gamma and beta, but what is important for me is the computation of c and d which are the legs of the blue triangle.

There doesn't exist a same ratio among the red legs and the blue ones (such as 16:9 in TV monitors), so it is probably impossible to solve this problem, but maybe I'm wrong.

I spent some time trying to compute alpha and now I think that this is impossible, I know that putting alpha equal to 45° I will be able to compute c = d but this is not the solution that I want, as you can see the blue legs are different each other.

If you have any idea concerning this problem please let me know your POV, I will appreciate because I was not able to find any suggestion. THANK YOU

• Something is wrong in your picture because in the red triangle $a^2+b^2\neq h^2$ so it can't be right-angled. – nickgard Apr 30 '17 at 16:29
• Yes you are right, h = 202.4277649 but I still need to compute c and d. Thank you. Actually that 202 was written by me just to let you understand that it can be easily computed – piezzoritro Apr 30 '17 at 16:32
• maybe de.wikipedia.org/wiki/Sinussatz can help – mathreadler Apr 30 '17 at 16:56
• In the specific instance in the picture, an integer solution is $c=129, d=156$ because $129^2+156^2=24^2+201^2$. I just did this by brute force. I don't know if there's a specific method. It seems like this would be a hard problem for very large integers. – nickgard Apr 30 '17 at 18:07
• Thank you @nickgard, actually I don't really need integers value, but instead I need a unique value of (c+d) which of course doesn't exists because (c+d) it seems ranged in the interval [ sqrt(40977) ; sqrt(2*40977) ], this problem hence is not solvable at all. Thanks again for your support – piezzoritro Apr 30 '17 at 18:12

This is definitely impossible, as there are infinitely many different values of $c$ and $d$ that could be legs of a right triangle with a given hypotenuse length. See the animation below: if point $P$ is anywhere on the circle whose diameter is the hypotenuse of your known triangle, then the diagram satisfies the conditions of your problem. More specifically, in terms of your diagram, $c$ can be any value between $0$ and $\sqrt{40977}$ (which is the length of your hypotenuse); then $d$ would be $\sqrt{40977-c^2}$.