Slope of a line through two points, with slope-intercept form, point-slope form and angle
Slope formula: m = (y₂ − y₁) ÷ (x₂ − x₁), rise over run. Through (1, 2) and (3, 8) the slope is 6 ÷ 2 = 3, the slope-intercept form is y = 3x − 1 and the point-slope form is y − 2 = 3(x − 1). A vertical line has an undefined slope.
Slope m = (y₂ − y₁) ÷ (x₂ − x₁), rise over run. Through (1, 2) and (3, 8) the slope is (8 − 2) ÷ (3 − 1) = 3, so the slope-intercept form is y = 3x − 1 and the point-slope form is y − 2 = 3(x − 1). A slope of 1 means an angle of 45°, and a 30° angle has a slope of 0.5774, a grade of 57.74%.
| Angle | Slope (m) | Grade | Run for a rise of 1 |
|---|---|---|---|
| 5 degrees | 0.0875 | 8.75% | 11.4301 |
| 10 degrees | 0.1763 | 17.63% | 5.6713 |
| 15 degrees | 0.2679 | 26.79% | 3.7321 |
| 20 degrees | 0.364 | 36.40% | 2.7475 |
| 25 degrees | 0.4663 | 46.63% | 2.1445 |
| 30 degrees | 0.5774 | 57.74% | 1.7321 |
| 35 degrees | 0.7002 | 70.02% | 1.4281 |
| 40 degrees | 0.8391 | 83.91% | 1.1918 |
| 45 degrees | 1 | 100.00% | 1 |
| 50 degrees | 1.1918 | 119.18% | 0.8391 |
| 55 degrees | 1.4281 | 142.81% | 0.7002 |
| 60 degrees | 1.7321 | 173.21% | 0.5774 |
| 70 degrees | 2.7475 | 274.75% | 0.364 |
| 80 degrees | 5.6713 | 567.13% | 0.1763 |
m = (y₂ − y₁) ÷ (x₂ − x₁), the change in y divided by the change in x, also called rise over run.
Subtract the y-coordinates, subtract the x-coordinates in the same order and divide. Through (1, 2) and (3, 8): (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3.
y − y₁ = m(x − x₁), where m is the slope and (x₁, y₁) is a point on the line. For slope 3 through (1, 2) it is y − 2 = 3(x − 1).
Use y = mx + b. Find the slope m, then b = y₁ − m × x₁. For the line through (1, 2) and (3, 8), m = 3 and b = −1, so y = 3x − 1.
It is undefined, because the run x₂ − x₁ is 0 and you cannot divide by zero. A vertical line is written as x = a constant, for example x = 4. A horizontal line has a slope of 0.
The slope of a line through two points (x₁, y₁) and (x₂, y₂) is m = (y₂ − y₁) ÷ (x₂ − x₁), often described as rise over run. A positive slope rises from left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line has an undefined slope because the run is 0.
Through (1, 2) and (3, 8), the rise is 8 − 2 = 6 and the run is 3 − 1 = 2, so the slope is 6 ÷ 2 = 3. Through (2, 5) and (6, 3), the slope is (3 − 5) ÷ (6 − 2) = −0.5: the line falls by one unit for every two units to the right.
The slope-intercept form of a line is y = mx + b, where m is the slope and b is the y-intercept, the value where the line crosses the y-axis. Once you know m, calculate b = y₁ − m × x₁. For the line through (1, 2) and (3, 8): b = 2 − 3 × 1 = −1, so the equation is y = 3x − 1.
The point-slope form is y − y₁ = m(x − x₁). It needs only the slope and one point on the line, so you can write it down directly: for slope 3 through (1, 2) it is y − 2 = 3(x − 1). Expanding it gives the slope-intercept form again.
The angle between a line and the x-axis is θ = arctan(m). A slope of 1 means an angle of 45°, and a slope of 3 about 71.57°. As a percentage grade, a slope of 0.5 is a 50% grade. The table below lists slopes and grades for common angles. The distance formula calculator gives the length between the same two points.