Enter two points to get the slope of the line through them, the angle it makes with the horizontal, the distance between the points and the equation of the line. If you know one point and the slope or angle instead, the calculator finds the second point. A graph shows the line with its rise and run.
Choose what you know: two points, or one point with a slope or an angle.
Enter the coordinates and the other values.
Read the slope, angle, distance and equation.
Check the graph to see the rise and run.
Slope: m = (y₂ − y₁) ÷ (x₂ − x₁)
Angle: θ = tan⁻¹(m)
Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²)
Line: y = mx + c, where c = y₁ − m × x₁
Percentage gradient: m × 100
Slope, called gradient in many textbooks, is a single number that says how steep a line is and which way it leans. The slope calculator finds it from two points on the line, or works the other way: from one point plus a slope or an angle and a distance, it finds where the second point lies.
Alongside the slope it gives the angle the line makes with the horizontal, the straight-line distance between the points, the rise and the run, the percentage gradient used for roads and ramps, and the equation of the line with the places it crosses the axes. A graph draws the line with a right triangle showing the rise and run, which is the picture used in Class 9 to 11 coordinate geometry. It is equally useful for practical checks, such as whether a wheelchair ramp or a drain has the right fall.
1. Label the points (x₁, y₁) and (x₂, y₂). The order does not matter as long as you are consistent.
2. Find the rise: y₂ − y₁.
3. Find the run: x₂ − x₁.
4. Divide rise by run to get the slope m. If the run is 0, the line is vertical and the slope is undefined.
5. For the angle, take the inverse tangent of m.
6. For the distance, use Pythagoras: the square root of rise² + run².
7. For the equation, put m and one point into y = mx + c and solve for c.
Moving along a straight line, the ratio of vertical change to horizontal change is the same between any two points you pick. That constant ratio is the slope. A slope of 2 means the line climbs 2 units for every 1 unit across, and a slope of minus one half means it drops 1 unit for every 2 across. Parallel lines have equal slopes, and two lines are perpendicular when their slopes multiply to give −1.
The rise and the run are the two shorter sides of a right triangle whose longest side is the segment joining the points. The angle at the base of that triangle is the angle of incline, and its tangent is rise over run, which is the slope. That is why m = tan θ. The same triangle gives the distance between the points through the Pythagorean theorem, so slope, angle and distance all come from one figure.
Engineers usually quote slope as a percentage or a ratio. A 5% road gradient rises 5 metres in every 100 metres of horizontal travel. A ramp described as 1 in 12 rises 1 unit for 12 units along the ground, a slope of about 0.083 or 4.8 degrees, which is a common limit for wheelchair access. Roofs, drains and railway lines are specified the same way, and percentage is simply the slope multiplied by 100.
A ramp starts at the point (0, 0) and ends at (12, 1), measured in metres along the ground and up. Find its slope, angle and length to check it against the 1 in 12 guideline.
Slope = rise ÷ run: m = (y₂ − y₁) ÷ (x₂ − x₁) = (1 − 0) ÷ (12 − 0) = 1 ÷ 12 = 1/12 = 0.083333
Distance between the points: d = √(Δx² + Δy²) = √(12² + 1²) = 12.041595
Angle of incline: θ = tan⁻¹(m) = tan⁻¹(0.083333) = 4.7636°
Equation of the line: c = y₁ − m × x₁ = 0 − 0.083333 × 0 = 0 y = 0.0833333333333x
Answer: Slope (m) 1/12 = 0.083333; Angle of incline (θ) 4.7636°; Distance (d) 12.041595
Dividing run by rise instead of rise by run.
Subtracting the coordinates in a different order on top and bottom, which flips the sign.
Calling the slope of a vertical line 0. It is undefined; a horizontal line has slope 0.
Confusing percentage gradient with degrees. A 100% gradient is 45°, not 90°.
Using the sloping length as the run. The run is the horizontal distance.
Coordinate geometry problems on lines, parallels and perpendiculars.
Checking the gradient of ramps, roads, drains and roofs.
Finding the rate of change between two data points on a graph.
Writing the equation of a line through two known points.
Converting between slope, angle and percentage gradient.
What is the slope of a vertical line?
It is undefined, because the run is 0 and you cannot divide by 0. The line's equation is x = a constant.
How do I turn a slope into an angle?
Take the inverse tangent: θ = tan⁻¹(m). A slope of 1 is 45°, and a slope of 4/3 is about 53.13°.
What does a 10% gradient mean?
The road rises 10 units for every 100 units of horizontal distance. That is a slope of 0.1, or an angle of about 5.71°.
Does it matter which point is first?
No. Swapping the points changes the sign of both rise and run, so the slope is the same.