Formula · math

Pythagorean Theorem

In any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides.

Quick answer
Formula

a² + b² = c²

How it works

The theorem holds in one situation only: a triangle with a right angle. The hypotenuse c is always the side opposite that angle and is always the longest, so if you find yourself with a c smaller than a or b, the sides have been assigned wrongly. It works in reverse as well, and that converse is more useful on site than the theorem itself: if a² + b² equals c², the angle must be a right angle. This is the basis of the 3-4-5 method for squaring a foundation or a set of forms — measure 3 units along one edge and 4 along the other, and when the diagonal reads exactly 5 the corner is square. Any multiple works equally well, so 6-8-10 or 12-16-20 gives more precision on a large layout. A handful of other whole-number sets, called Pythagorean triples, are worth memorising: 5-12-13, 8-15-17 and 7-24-25. The same relationship gives you screen and panel dimensions from a diagonal. A 27-inch monitor in 16:9 is 23.53 inches wide and 13.24 inches tall, which is why two screens quoted at the same diagonal but different aspect ratios are not the same size. It also underlies straight-line distance between two points, whether on a drawing or between map coordinates.

Variables

  • a, bLengths of the two legs
  • cLength of the hypotenuse (longest side)

Worked examples

InputResult
a = 3, b = 4c = √25 = 5
a = 5, b = 12c = √169 = 13
a = 1, b = 1c = √2 ≈ 1.414

Practical applications

  • Squaring a foundation, deck or set of forms using the 3-4-5 method
  • Deriving the width and height of a screen or panel from its quoted diagonal
  • Finding straight-line distance between two points on a plan or a coordinate grid
  • Calculating rafter, brace and truss lengths in framing
  • Checking that a rectangular layout is true by comparing its two diagonals

Common mistakes

  • Applying it to a triangle that has no right angle. Use the law of cosines instead.
  • Treating any side as the hypotenuse. It is always the one opposite the right angle, and always the longest.
  • Stopping at c² and forgetting the square root.
  • Adding the sides before squaring them. It is a² + b², not (a + b)².
  • Mixing units. Both legs must be in the same unit before you square them.

Used in

ConstructionSurveyingComputer graphicsNavigation

Use it in a tool

FAQs

Does it work for non-right triangles?+

No — use the Law of Cosines for general triangles: c² = a² + b² − 2ab·cos(C).

What's a Pythagorean triple?+

Three whole numbers (a, b, c) where a² + b² = c². The classics are 3-4-5, 5-12-13, 8-15-17.

Explore the topic

Knowledge graph

Related formulas