CompoundPage

Pythagorean theorem calculator

In the Pythagorean theorem calculator, legs of 5 and 12 give a hypotenuse of 13, because 25 + 144 = 169 and √169 = 13. Set c and leave one leg at 0 to solve for the leg instead.

degrees

degreesFor ASA, AAS and SSA. In ASA the side between angles A and B is c; in AAS the side given is a; in SSA the sides are a and b.

degreesFor ASA and AAS.

Hypotenuse13

Hypotenuse a squared plus b squared equals c squared: 25 + 144 = 169.
13
A Pythagorean triple All three sides are whole numbers, which is rare and is why a handful of triples (3-4-5, 5-12-13, 8-15-17) turn up in every textbook and on every building site.
5, 12, 13
Sides
a = 5, b = 12, c = 13
Angles Summing to 180 degrees, as every plane triangle must.
A = 22.62deg, B = 67.38deg, C = 90deg
Area
30
Perimeter
30
Type
scalene, right
Heights The perpendicular from each side to the opposite vertex. Area is half the base times the height for any of the three.
to a: 12, to b: 5, to c: 4.6154
Circumradius The radius of the circle through all three vertices.
6.5
Inradius The radius of the largest circle that fits inside.
2
Common Pythagorean triples
abcMultiples
3456-8-10, 9-12-15, 30-40-50
5121310-24-26, 15-36-39
8151716-30-34
7242514-48-50
20212940-42-58
9404118-80-82
  • The Pythagorean theorem holds only for right triangles. For any other triangle the law of cosines generalizes it: c squared equals a squared plus b squared minus 2ab cos(C), which reduces to Pythagoras when C is 90 degrees and cos(C) is zero.
  • Any two sides must add to more than the third, or the shape does not close. That triangle inequality is checked here before anything else is computed.

How the Triangle Calculator works

The Pythagorean theorem says that in a right triangle the two shorter sides, the legs a and b, and the longest side, the hypotenuse c, satisfy a² + b² = c². To find the hypotenuse, square the legs, add, and take the square root. With legs of 5 and 12: 5² + 12² = 25 + 144 = 169, and √169 = 13.

Here is one of the many proofs, and the quickest to see. Draw a square with sides a + b and fit four copies of the right triangle inside it, one in each corner, with their hypotenuses facing inwards. The hypotenuses enclose a tilted square of side c. The big square's area is (a + b)², and it is also the inner square plus the four triangles: c² + 4 × ½ab. Expanding (a + b)² gives a² + 2ab + b², the 2ab cancels against the four triangles, and a² + b² = c² is left. With 5 and 12: the outer square is 17² = 289, the triangles are 4 × 30 = 120, and 289 - 120 = 169 = 13².

Solving for a leg runs it the other way: subtract instead of adding. With a hypotenuse of 13 and a leg of 12, the other leg is √(169 - 144) = √25 = 5. In this calculator, enter c and the leg you know and leave the other leg at 0. Adding when you should subtract is the common slip, and it gives itself away: the "leg" comes out longer than the hypotenuse, which no right triangle has. The other mistake is labeling. c must be the side opposite the right angle; plug the hypotenuse in as a leg and the answer is wrong without looking wrong.

Every side must be in the same unit, and the answer comes out in that unit. The squares in the middle of the calculation are areas (25 and 144 square units), but the square root brings them back to a length.

The theorem only holds for right triangles. Its converse is just as useful: if three sides satisfy a² + b² = c², the angle opposite c is exactly 90°. That is how builders check a corner: measure 3 feet along one wall and 4 along the other, and if the diagonal is 5 feet, the corner is square. For a triangle without a right angle, the law of cosines adds a correction term, c² = a² + b² - 2ab cos C, which this calculator's other modes use.

5, 12, 13 is a Pythagorean triple, three whole numbers that fit; most pairs of legs do not give one. Legs of 5 and 7 give √74, about 8.602, and the page shows that exact radical as well as the decimal. The same right triangle here has an area of ½ × 5 × 12 = 30 and acute angles of about 22.62° and 67.38°.

The theorem turns up wherever a straight-line distance is wanted. The distance formula between two points is it, with the legs being the differences in x and in y. In three dimensions it extends to √(a² + b² + c²), the diagonal of a box. And a TV's screen size is the diagonal of a rectangle, which is the hypotenuse of the triangle its width and height make.

Triangle Calculator FAQ

What is the Pythagorean theorem?

In a right triangle, a² + b² = c², where c is the hypotenuse, the side opposite the right angle. Legs of 5 and 12 give a hypotenuse of √169 = 13.

How do I find a missing leg?

Subtract: a = √(c² - b²). With a hypotenuse of 13 and a leg of 12, the other leg is √(169 - 144) = 5. In this calculator, enter c and one leg and leave the other at 0.

Does the Pythagorean theorem work for any triangle?

No, only right triangles. For other triangles use the law of cosines, c² = a² + b² - 2ab cos C, which becomes the Pythagorean theorem when C is 90°.

How do I check that a corner is square?

Use the converse. Measure 3 units along one side and 4 along the other; if the diagonal between those marks is exactly 5, the angle is 90°. Multiples such as 6, 8, 10 work the same way.

More from the Triangle Calculator

Related calculators

Embed this calculator
<div id="compoundpage-triangle-calculator"></div>
<script src="https://compoundpage.com/embed/triangle-calculator.js" async></script>

The same calculation as JSON