How this calculator works
In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. Solving for the hypotenuse adds the squares of the legs; solving for a missing leg subtracts the known leg square from the hypotenuse square before taking the square root. All sides must be positive, and a leg must be strictly shorter than the hypotenuse, since the other leg would otherwise be zero or imaginary.
Formula
c² = a² + b², so c = √(a² + b²) and b = √(c² - a²).
Worked example
Legs of 3 and 4 give a hypotenuse of √(9 + 16) = 5. With hypotenuse 13 and known leg 5, the missing leg is √(169 - 25) = 12.
Advertisement
Frequently asked questions
Why must the leg be shorter than the hypotenuse?
The hypotenuse is always the longest side of a right triangle. A leg equal to it would force the other leg to zero, and a longer leg gives a negative number under the square root.
Does it work with decimal sides?
Yes. Any positive lengths work, and whole-number triples such as 3-4-5, 5-12-13 and 8-15-17 come out exact.
Does this work for a triangle that is not right-angled?
No. The equality holds only for a right triangle. Other triangles need the law of cosines or another method.