<style> .reveal-up, .reveal-left, .reveal-right, .reveal-stagger > * { opacity: 1 !important; transform: none !important; } </style>
  1. Learn
  2. BIM Math
  3. Foundations
All lessons in this course

Lesson 5 of 44 15 minBeginner

Trigonometry on site: slopes, pitches, rise and run

Sine, cosine and tangent on right-angled triangles; the four ways to write a slope; roof pitches, ramps and stairs; and checking a corner is square with the cosine rule.

Roofs, ramps, stairs, drains and setting out on site all come down to one shape: the right-angled triangle. Builders call its sides run (horizontal), rise (vertical) and the sloping side, for a roof, the rafter.

Pythagoras, sine, cosine and tangent

For a right-angled triangle with slope angle θ (measured from the horizontal):

RelationFormulaUse it when you know…
Pythagorasrafter² = run² + rise²two sides, and want the third
Tangenttan θ = rise / runthe angle and the run, and want the rise
Cosinecos θ = run / rafterthe angle and the run, and want the rafter
Sinesin θ = rise / rafterthe angle and the rafter, and want the rise
Inverseθ = Atan(rise / run)two sides, and want the angle
Rafter.cs
static double Rad(double deg) => deg * Math.PI / 180; static double Rise(double run, double pitchDeg) => run * Math.Tan(Rad(pitchDeg));static double Rafter(double run, double pitchDeg) => run / Math.Cos(Rad(pitchDeg)); double run = 4.0, pitch = 30;                 // half the span of an 8 m roofConsole.WriteLine($"Rise:   {Rise(run, pitch):F3} m");Console.WriteLine($"Rafter: {Rafter(run, pitch):F3} m");
Output
Rise:   2.309 m
Rafter: 4.619 m

Four ways to write a slope

The same slope is written differently by different trades, and converting between them is everyday work:

  • Angle in degrees, from the horizontal: “a 30° roof”.
  • Ratio rise : run, usually with the rise as 1: “a 1:12 ramp” rises 1 for every 12 along.
  • Percentage, rise ÷ run × 100: “a 2% fall” on a flat roof or a drain drops 2 cm per metre.
  • Pitch in inches of rise per 12 inches of run, common for roofs in the US: “a 6 in 12 roof”.
Interactive

One slope, four ways to write it

Set the run and the angle, or pick a preset. The triangle is drawn to scale.

run 4.00 mrise 2.31 mrafter 4.62 mθ
Angle30.00°
Percentage57.74%
Ratio1 : 1.73
Roof pitch6.93 in 12
Rise over the run2.309 m
Sloping length4.619 m
rise = run · tan θ
rafter = run / cos θ = √(run² + rise²)
% = rise / run · 100
A 30.0° slope rises 577 mm per metre. Note how the percentage (57.7%) grows much faster than the angle as the slope gets steeper.
Slopes.cs
static double PercentToDeg(double pct) => Math.Atan(pct / 100) * 180 / Math.PI;static double RatioToPercent(double rise, double run) => rise / run * 100; double ramp = RatioToPercent(1, 12);Console.WriteLine($"1:12 ramp    = {ramp:F2}% = {PercentToDeg(ramp):F2} deg"); double roof = RatioToPercent(6, 12);Console.WriteLine($"6 in 12 roof = {roof:F2}% = {PercentToDeg(roof):F2} deg"); Console.WriteLine($"100% slope   = {PercentToDeg(100):F2} deg");
Output
1:12 ramp    = 8.33% = 4.76 deg
6 in 12 roof = 50.00% = 26.57 deg
100% slope   = 45.00 deg

Many accessibility codes, for example the US ADA standards, set 1:12 as the steepest allowed ramp, which is the 8.33% above. Check your local code: limits and landing rules vary by country.

Is the corner square? The cosine rule

Setting-out crews check a right angle with the 3-4-5 rule: measure 3 m along one side, 4 m along the other, and the diagonal must be exactly 5 m, because 3² + 4² = 5². If the diagonal is a little off, the cosine rule tells you the actual angle. It works for any triangle, not only right-angled ones:

c² = a² + b² − 2ab·cos C, so C = Acos((a² + b² − c²) / (2ab)), where C is the angle opposite side c.

Square.cs
static double AngleDeg(double a, double b, double c)    => Math.Acos((a * a + b * b - c * c) / (2 * a * b)) * 180 / Math.PI; Console.WriteLine($"{AngleDeg(6, 8, 10):F2}");       // perfect 6-8-10Console.WriteLine($"{AngleDeg(6, 8, 10.012):F2}");   // diagonal 12 mm long
Output
90.00
90.14

A 12 mm error on a 10 m diagonal means the corner is open by about 0.14°. Over a 30 m wall that is a 75 mm error at the far end: exactly the kind of number worth catching on the first day.

Quick check

A roof has a 3 m run and a 1.5 m rise. What is its slope as a percentage?

Quick check

Which is steeper: a 10% ramp or a 10° ramp?

Quick check

You know a rafter’s length and its angle. Which function gives the rise?

Practice

A stair must climb 3000 mm, with no riser taller than 180 mm and a going (tread depth) of 250 mm. Work out the number of risers, the actual riser height (one decimal), the pitch in degrees (one decimal) and the total horizontal run. A stair has one fewer going than risers.

Show a hint

Risers = Math.Ceiling(3000 / 180.0). Riser height = 3000 / risers. Pitch = Atan(riser / going). Run = (risers − 1) × going.

Show the solution
Solution.cs
double totalRise = 3000, maxRiser = 180, going = 250; int risers = (int)Math.Ceiling(totalRise / maxRiser);double riser = totalRise / risers;double pitch = Math.Atan(riser / going) * 180 / Math.PI;double run = (risers - 1) * going; Console.WriteLine($"{risers} risers of {riser:F1} mm");Console.WriteLine($"Going {going} mm, pitch {pitch:F1} deg");Console.WriteLine($"Horizontal run {run} mm");
Output
17 risers of 176.5 mm
Going 250 mm, pitch 35.2 deg
Horizontal run 4000 mm

Remember

  • Roofs, ramps and stairs are right-angled triangles: run, rise and the sloping side.
  • tan θ = rise / run, cos θ = run / slope length, sin θ = rise / slope length.
  • A slope can be an angle, a ratio (1:12), a percentage (rise ÷ run × 100) or a pitch (6 in 12); 100% is 45°.
  • The cosine rule gives any angle of a triangle from its three sides, which is how site crews check corners are square.
0 of 44 lessons completed