Skip to content

Math

Slope Calculator

Enter your values and the result updates as you type. The formula and a worked example are below the calculator.

What do you know?

Enter two points. The slope, angle, distance, line equation and graph appear as you type. Fractions such as 3/4 work.

Point 1
Point 2

Slope (m)

7/100

= 0.07. Rising from left to right.

Slope (m) = ΔY/ΔX = 7/100 = 0.07

θ = arctan(ΔY/ΔX) = 4.0041729407094°

ΔX = 100 – 0 = 100

ΔY = 7 – 0 = 7

Distance (d) = √(ΔX² + ΔY²) = √10,049 = 100.24470060806

Equation of the line:

y = 0.07x

or

y = 7x/100

When x=0, y = 0

When y=0, x = 0

Run ΔX = x₂ − x₁
100
Rise ΔY = y₂ − y₁
7
Angle θ from the +x direction
4.004173°
Angle of the line (−90° to 90°)
4.0041729407°
Distance d
√10049 = 100.2447006081
Percent grade
7%
Gradient as 1 in N
1 in 14.2857142857
Equation
y = (7/100)x
Equation in decimals
y = 0.07x
Standard form
7x − 100y = 0
y-intercept (x = 0)
(0, 0)
x-intercept (y = 0)
(0, 0)
0501000(0, 0)(100, 7)
  1. y₂ − y₁x₂ − x₁
  2. 7 − 0100 − 0
  3. 7100

How to use

  1. Choose what you know: two points, or one point with a distance and a slope or angle.
  2. For two points, type X1, Y1, X2 and Y2. Fractions such as 3/4 and decimals both work.
  3. Read the slope first, then the rise and run, the angle, the distance, the percent grade, the line equation and where the line crosses the axes. The graph draws the two points and the line through them.
  4. Open the steps to see the slope and distance worked out. In the second mode, type a start point, a distance and either a slope (two points fit, one on each side) or an angle (one point fits).

Formula

Slope m = (y2 - y1) / (x2 - x1) = rise / run = tan(θ). Distance d = √((x2 - x1)² + (y2 - y1)²). The line is y = mx + b with b = y1 - m x1, so it crosses the y-axis at (0, b) and the x-axis at (-b/m, 0). A vertical line has run 0, so its slope is undefined and its equation is x = a number.

Example

Points (3, 4) and (6, 8): rise 4, run 3, slope 4/3 (1.3333), distance 5, angle 53.13°, line y = (4/3)x. In India, a road that climbs 7 m over 100 m has a slope of 0.07, a 7% gradient, written as about 1 in 14.3, and its angle is about 4.0°.

A positive slope rises from left to right, a negative slope falls, 0 is level and a vertical line has no slope. The angle is the direction of travel from point 1 to point 2, from 0° to 360°, so the same line reads differently when you swap the points; the slope does not change. Exact fractions are kept, so 5/4 is not rounded to 1.25 until you ask for decimals. Two identical points do not make a line.