Let's check first this right triangle from the figure:
We have, using tangent on the angle:
And then, looking at the other right triangle:
Doing the same as before, we have that:
Now, we can use both equations of h to solve for x:
Which we can finally use to find h in any equation: