gizmobench

Slope Calculator

Give two points, a rise and a run, or a roof pitch, and read the slope, the angle in degrees, the percent grade, the distance and the equation at once. The stage draws the line with its rise-and-run triangle at true scale, so the angle you see is the angle in the numbers, and every reading has its own copy button. A vertical line is named as undefined rather than printed as infinity, and the roof mode speaks in x:12 pitch.

run 4rise 3(0, 0)(4, 3)
Two points · slope = rise / run0.75slope36.87° · 75% grade · distance 5
Mode
Point 1
Point 2

The line through (x₁, y₁) and (x₂, y₂). Slope is the rise between them over the run between them.

  • Sloperise / run
    0.75
  • Angledegrees above horizontal, arctan of the slope
    36.8698976458°
  • Percent gradeslope × 100
    75%
  • Distancebetween the two points, √(rise² + run²)
    5
  • Equationy = mx + b, to four places
    y = 0.75x + 0
  • Pitchrise per 12 of run
    9:12
One line, six readings. Slope is rise divided by run. The angle is the arctangent of the slope, in degrees above horizontal, so 45 degrees is a slope of 1. Percent grade is the slope times 100, the number a road sign uses. Distance is the straight length between the two points, from Pythagoras. The equation is the slope-intercept form y = mx + b, with b where the line crosses the y axis. And a roof pitch is the same slope written as the rise per 12 of run, so 6:12 is a slope of 0.5, a 50% grade and an angle of 26.57 degrees. A vertical line has no slope at all: the run is 0, and the tool says so instead of printing infinity.

Common questions

Why does it say the slope is undefined?
Because the two points have the same x, so the line is vertical and the run between them is 0. Slope is rise divided by run, and dividing by 0 has no value, so a vertical line has no slope: it is not infinite, it is undefined. The tool says so and gives the line's equation in the only form it has, x = that number. A horizontal line is the opposite case: its rise is 0, so its slope is exactly 0 and its equation is y = a constant.
What is the difference between percent grade and degrees?
They measure the same tilt on different scales. Percent grade is the slope times 100: a rise of 3 over a run of 4 is a slope of 0.75 and a 75% grade. Degrees is the angle the line makes with horizontal, which is the arctangent of the slope: that same line sits at 36.87 degrees. The two are not proportional. A 100% grade is 45 degrees, not 90, and the grade climbs without limit as the angle nears 90. Road signs use percent; roofs and ramps are usually quoted in degrees or as a pitch.
How do I read a roof pitch like 6:12?
As the rise per 12 of run: a 6:12 roof climbs 6 inches for every 12 inches it goes across, which is a slope of 0.5, a 50% grade and an angle of 26.57 degrees. Switch to Roof pitch and type 6:12, 6/12 or just 6, and the tool gives all of those. Type an angle instead and it gives the pitch. A pitch typed with a different run, say 4:18, is kept as typed for the distance and rewritten as rise per 12 in the Pitch row.
What does a negative slope mean?
The line falls as you move to the right. From (0, 4) to (4, 0) the rise is -4 over a run of 4, so the slope is -1, the angle is -45 degrees and the grade is -100%. The sign only says which way the line leans; its steepness is the size of the number, so -1 is exactly as steep as 1. The order you type the points in does not matter: (4, 0) to (0, 4) is the same line and gives the same slope.
How does it find the slope-intercept form?
From the slope and one of the points. The slope m is the rise over the run, and the intercept b is where the line crosses the y axis, worked out as y₁ minus m times x₁. The Equation row prints y = mx + b with both numbers rounded to four decimal places, so the line through (1, 1) and (4, 3) reads y = 0.6667x + 0.3333. The slope and intercept themselves are kept at full precision in the other rows.
What is the distance row?
The straight-line length between the two points, from Pythagoras: the square root of rise squared plus run squared. A rise of 3 over a run of 4 gives a distance of exactly 5. In roof mode it is the length along the slope for the rise and run typed, so 6:12 gives 13.4164 in the same units as the 6 and the 12.

Slope, angle and distance are computed exactly from the numbers you give; the equation is shown to four decimal places. A roof pitch of 6:12 is the same as a 26.57 degree angle, and the tool says both.