How do builders use Pythagoras on site?

Published · Updated · By

Builders use Pythagoras to find a straight-line length when two sides of a right-angled triangle are known: the diagonal of a frame, a stair stringer, a rafter or a brace. Square both sides, add them, then take the square root. Add an angle and basic trigonometry finds everything else.

A right-angled triangle drawn to scale: base 3500 mm, rise 1400 mm, hypotenuse 3769.6 mm, angle A 21.8 degrees and angle B 68.2 degrees, with the sum 3500 squared plus 1400 squared equals 14,210,000
Base 3500 mm and rise 1400 mm give a hypotenuse of 3769.6 mm. Drawn to scale.

What is Pythagoras' theorem, in site terms?

In a triangle with one right angle, the square on the longest side (the hypotenuse) equals the sum of the squares on the other two sides: a² + b² = c² (Pythagorean theorem, Wikipedia). Checked on 28 October 2026. On site, the two short sides are usually a horizontal and a vertical, and the hypotenuse is the sloping or diagonal line you need to cut or measure.

The theorem also runs backwards. If a² + b² = c² for the three sides of a triangle, the angle between a and b is a right angle (same source, Checked on 28 October 2026). That is why a 3, 4, 5 triangle gives a square corner, and why equal diagonals help show a frame is square. See the 3-4-5 rule for setting out a corner this way.

You knowYou wantUse
Two short sides (base and rise)Hypotenuse√(base² + rise²)
Hypotenuse and one short sideOther short side√(hyp² − known²)
Base and riseAngle at the end of the baseatan(rise ÷ base)
One side and one angleThe other sidessin, cos or tan

How do you calculate the hypotenuse from two sides?

Square each short side, add the two, and take the square root. With a base of 3500 mm and a rise of 1400 mm: 3500² is 12,250,000 and 1400² is 1,960,000. The sum is 14,210,000 and its square root is 3769.6 mm. Work in one unit throughout. Mixing metres and millimetres is the most common slip, and it gives an answer that looks plausible and is wrong.

To go the other way, subtract. A 5000 mm hypotenuse with a 3000 mm side leaves √(5000² − 3000²) = √(25,000,000 − 9,000,000) = √16,000,000 = 4000 mm. The hypotenuse is always the longest side, so a result that comes out shorter than a leg means a number went in the wrong place.

Job 1: how do you square a frame or slab?

The diagonal of a rectangle is the hypotenuse of a right-angled triangle, so a square frame has a known diagonal. For a 4800 × 3600 mm frame it is √(4800² + 3600²) = 6000 mm. Measure both diagonals; if they match and opposite sides are equal, the corners are square. The steps, and how far to push when they don't match, are in how to check if a frame is square.

For a whole building, the same check runs across the footprint: see how to square a building. The formula on its own, with a table of common sizes, is in how to calculate the diagonal of a rectangle.

Small errors matter more than they look. On a 3000 × 4000 mm corner, a 5010 mm diagonal instead of 5000 mm means the corner is about 90.24° (computed with the cosine rule). That is a quarter of a degree, roughly 13 mm of lean over 3 m. The working: cos θ = (3000² + 4000² − 5010²) ÷ (2 × 3000 × 4000) = −100,100 ÷ 24,000,000 = −0.00417, so θ = 90.24°, and 3000 × 0.00417 = 12.5 mm.

Job 2: how long is a stair stringer?

The stringer runs along the sloping line from the floor to the landing, so it is the hypotenuse of the total rise and the total run. Take 15 risers of 180 mm, which is a 2700 mm rise, and 14 treads (goings) of 250 mm, which is a 3500 mm run. The stringer is √(2700² + 3500²) = √(7,290,000 + 12,250,000) = √19,540,000 = 4420.4 mm, and the slope angle is atan(2700 ÷ 3500) = atan(0.7714) = 37.65°.

That length is the straight line along the stair's nose line. It is not a cutting list: the stringer stock needs to be longer once you allow for the ends. How many risers a floor height needs is covered in how many steps for a floor height. The limits on riser height, going and slope are set by the National Construction Code in Australia, the NZ Building Code in New Zealand and Approved Document K in England, plus your local council. Check them at the source rather than from the app or from this page.

Job 3: how long is a rafter?

A rafter sloping from the wall plate to the ridge is the hypotenuse of the run and the rise. For a run of 3600 mm and a rise of 1200 mm: √(3600² + 1200²) = √(12,960,000 + 1,440,000) = √14,400,000 = 3794.7 mm, at an angle of atan(1200 ÷ 3600) = atan(0.3333) = 18.43°, a slope of 1 in 3.

This is the length along the slope from the plate line to the ridge line. It is before the birdsmouth, the tail and the ridge allowance, and it does not give you hip or valley lengths. How to get the length from a stated pitch is in rafter length from pitch, and converting a pitch to an angle is in roof pitch to degrees.

Job 4: how long is a knee brace?

A brace between a post and a beam is the hypotenuse of the distance up the post and the distance along the beam. With 2400 mm up the post and 3000 mm along the beam, the brace measures √(2400² + 3000²) = √(5,760,000 + 9,000,000) = √14,760,000 = 3841.9 mm, at atan(2400 ÷ 3000) = atan(0.8) = 38.66° from the horizontal. That is the length between the two points you measured, not the length of timber to buy. See knee brace length for the full method.

How do you find the angle of a right triangle from two sides?

Divide the rise by the base and take the inverse tangent: angle A = atan(rise ÷ base). With a base of 3500 mm and a rise of 1400 mm, 1400 ÷ 3500 is 0.4, and atan(0.4) is 21.8°. The other acute angle is 90° − 21.8° = 68.2°, because the two acute angles add up to 90° (Right triangle, Wikipedia, Checked on 28 October 2026).

The inverse tangent is the atan, tan⁻¹ or arctan key on a scientific calculator or a phone. Check it is set to degrees, not radians. If you have the hypotenuse instead of the base, use the inverse cosine of base ÷ hypotenuse for the same angle.

What is trigonometry for carpenters, in one paragraph?

With an angle and one side, three ratios find the rest. Using the angle in question: sine is opposite ÷ hypotenuse, cosine is adjacent ÷ hypotenuse, and tangent is opposite ÷ adjacent (Right triangle, Wikipedia, Checked on 28 October 2026). With a base of 3500 mm and an angle A of 21.8°, the rise is 3500 × tan 21.8° = 1400 mm and the hypotenuse is 3500 ÷ cos 21.8° = 3769.6 mm. Pythagoras gives you lengths from lengths. Trig is what connects a length to an angle.

Common mistakes

  • Mixed units. Millimetres for one side and metres for the other.
  • The wrong leg. The base is horizontal and the rise is vertical. For a rafter, use the run to the ridge, not the full building width.
  • Adding instead of squaring. The hypotenuse is not base + rise. 3500 + 1400 is 4900, over a metre too long.
  • Treating the answer as the cut. The hypotenuse is a straight-line length between two points. Plumb cuts, seat cuts and tails are separate work.
  • Rounding early. Keep the full number until the last step, then round to the nearest millimetre.

Doing it in MeisterCalc

The Triangles calculator solves a right-angled triangle from any two values: base, rise, hypotenuse, angle A or angle B, as long as at least one is a length. That is nine pairs, shown as Base, Rise, Hyp, Angle A and Angle B. Enter Base 3500 and Rise 1400 and it returns Hyp 3769.6 mm, Angle A 21.801° and Angle B 68.199° (21.8° and 68.2° rounded). Lengths show to 0.1 mm and angles to three decimals. It does not accept two angles alone or three values at once. It rejects a hypotenuse that is not longer than a leg.

Check Square does the frame job: use Target Diagonal with Length and Width for the diagonal, or switch to Is It Square? with your two tape readings. Pitch converts between rise, run, pitch, angle and percent grade. Check Square is one of the three free calculators, with Stairs and Concrete. The other 12, including Triangles and Pitch, unlock inside the app. The app works offline and is on Android only; there is an iOS waitlist. A separate page covers the right-angle triangle calculator in more detail: right-angle triangle calculator in mm.

What Pythagoras and the app don't do

  • Pythagoras gives straight-line lengths. It doesn't give cut angles, birdsmouths, hip or valley lengths, or landings, and MeisterCalc doesn't calculate those either.
  • It only works on right-angled triangles. For an out-of-square corner, measure and compare diagonals instead.
  • The answer is only as good as the measurements. A tape reading that is 5 mm out is 5 mm out in the result.
  • Building rules are set by the NCC, the NZ Building Code or Approved Document K, and your local council. The app does not make work comply.

Which page next?