Calculate the slope (gradient), y-intercept, line equation, distance between two points, and angle of inclination.
Slope is rise over run: m = (yโ โ yโ) / (xโ โ xโ). From (2, 3) to (6, 11): rise = 8, run = 4, so m = 2 โ the line climbs 2 units for every 1 across. A slope of 0 is flat; a vertical line has an undefined slope, because run is zero and division by zero has no answer. In construction, the same value is often written as a percentage grade or a ratio like 1โถ10.
Point 1: (xโ, yโ) and Point 2: (xโ, yโ). Results update as you type.
Keyboard: Enter calculates, Esc resets.
Quick Examples
| Property | Value |
|---|
Slope (or gradient) measures how steep a line is โ how much it rises or falls for each unit it moves across. It is the single number that describes a line's direction, and it is central to graphing, calculus, construction grades, and physical quantities like speed and acceleration, which are themselves slopes on a graph of distance or velocity over time.
Subtract the y-values to get the rise, subtract the x-values to get the run, then divide. From (2, 3) to (6, 11): rise = 8, run = 4, so m = 2. The order of the two points does not matter as long as you're consistent โ computing Pโ โ Pโ for both top and bottom.
| Case | Slope | Note |
|---|---|---|
| Horizontal line | m = 0 | No rise โ y is constant |
| Vertical line | Undefined | Run is zero โ division by zero has no answer |
| Parallel lines | mโ = mโ | Same steepness, never intersect |
| Perpendicular lines | mโ ร mโ = โ1 | Slopes are negative reciprocals |
Slope-intercept form: y = mx + b, where b is the y-intercept.
Point-slope form: y โ yโ = m(x โ xโ), useful when you have a point and the slope but no intercept.
Standard form: Ax + By = C.
Road and roof grades are often expressed as a percentage (grade % = slope ร 100) or a ratio like 1โถ10, meaning 1 unit of rise for every 10 units of run. A 10% grade is a slope of 0.1. Steeper slopes give a smaller ratio denominator โ 1โถ4 is much steeper than 1โถ20.
| Field | Use |
|---|---|
| Construction | Roof pitch, ramp gradients, drainage falls |
| Roads | Grade signage, braking distance calculations |
| Data analysis | Trend lines, rates of change |
| Physics | Velocity as the slope of a distance-time graph |
| Mistake | Fix |
|---|---|
| Swapping x and y in the formula | Rise (ฮy) is always the numerator |
| Mismatching point order | Use the same point first in both subtractions |
| Treating undefined as zero | A vertical line has no slope at all, not a slope of 0 |
| Confusing slope with angle | A 100% grade is a 45ยฐ angle, not 100ยฐ |
1) (10โ2)/(5โ1) = 2 2) m = 0 3) y = 3x + 4
What is slope?
Slope measures the steepness and direction of a line: how much it rises or falls for each unit it moves horizontally. It is calculated as rise over run, m = (yโโyโ)/(xโโxโ).
How do you calculate slope from two points?
Subtract the y-coordinates for the rise, subtract the x-coordinates for the run, then divide: m = (yโโyโ)/(xโโxโ). From (2,3) to (6,11), m = 8/4 = 2.
What does a negative slope mean?
A negative slope means the line falls as x increases โ moving right, y decreases. The steeper the negative number, the faster it falls.
Why is a vertical line's slope undefined?
Because the run (ฮx) is zero, and division by zero has no defined value. A vertical line is not a slope of zero โ it simply has no slope at all.
What is the y-intercept?
The point where a line crosses the y-axis, found by b = yโ โ mรxโ. It is undefined for a vertical line, since such a line either never crosses the y-axis or lies on it entirely.
How are parallel and perpendicular slopes related?
Parallel lines share the same slope (mโ = mโ). Perpendicular lines have slopes that multiply to โ1 (mโ ร mโ = โ1) โ one is the negative reciprocal of the other.
How do I convert slope to a percentage grade?
Multiply the slope by 100. A slope of 0.1 is a 10% grade โ 1 unit of rise for every 10 units of horizontal distance.
What is the angle of inclination?
The angle a line makes with the horizontal, found by taking the arctangent of the slope's absolute value. A slope of 1 corresponds to a 45ยฐ angle in either direction.
Does this calculator show the line equation?
Yes โ in slope-intercept form (y = mx + b) for standard lines, or x = constant for a vertical line, along with the point-slope form and the working.
Can slope be zero?
Yes โ a slope of exactly 0 means a perfectly horizontal line, where y stays constant as x changes.