Skip to content
CalculatorBuddy

Slope Calculator

Find the slope of a line from two points, or find the second point from one point, a distance, and the slope or incline angle. Get θ, distance, intercepts, and the line equation.

Enter two points on the line. The calculator returns slope, angle, distance, and the equation.

ExampleSample values — edit any field to see your result.

x-coordinate of the first point.

y-coordinate of the first point.

x-coordinate of the second point.

y-coordinate of the second point.

Results update as you type.

Slope (m)

Increasing

1

Estimated result

Rise over run
1/1 = 1
Angle of incline (θ)
45°
Distance (d)
1.4142135623731
ΔX
1
ΔY
1
Equation of the line
y = x
Point-slope form
y - 1 = (x - 1)
When x = 0
0
When y = 0
0

Calculation steps

Worked solution
ΔX = 2 - 1 = 1
ΔY = 2 - 1 = 1
m = ΔY / ΔX = 1/1 = 1
θ = arctan(ΔY / ΔX) = 45°
d = √(ΔX² + ΔY²) = √2 = 1.4142135623731
y = x

Find the slope of a straight line from two points, or find the second point when you already know one point, a distance, and either the slope or the incline angle. Results include θ, ΔX, ΔY, distance, intercepts, and the line equation.

Formula

Slope is rise over run. Given two points (x₁, y₁) and (x₂, y₂):

m = (y₂ − y₁) / (x₂ − x₁) = ΔY / ΔX = tan(θ)
d = √(ΔX² + ΔY²)

A positive m means the line rises from left to right; a negative m means it falls. m = 0 is horizontal. When ΔX = 0 the slope is undefined (a vertical line).

If one point, a distance d, and the slope are known, the heading is θ = arctan(m) (with negative slopes shifted by 180° so θ is between 0° and 180°). The second point is then

ΔX = d · cos(θ)
ΔY = d · sin(θ)
(x₂, y₂) = (x₁ + ΔX, y₁ + ΔY)

The same line in the opposite direction uses θ + 180°. The slope-intercept equation is y = mx + b with b = y₁ − m x₁.

The default two-point example is (1, 1) and (2, 2): m = 1, θ = 45°, and d = √2 ≈ 1.4142135623731, so y = x. The default point-and-slope example is (1, 1), d = 5, m = 0.75, which is the 3-4-5 triangle: the second point is (5, 4) or (−3, −2) the other way.

Worked identities

GivenSlopeDistanceθ
(1, 1) and (2, 2)1√2 ≈ 1.414213562373145°
(3, 4) and (6, 8)4/3553.130102354156°
(4, 2) and (6, 10)4√68 ≈ 8.246211251235375.963756532074°
(1, 2) and (1, 1)infinity1270°

Examples

Two points (article example)

Points (3, 4) and (6, 8). ΔX = 3, ΔY = 4, so m = 4/3 ≈ 1.3333333333333, d = 5, and θ = arctan(4/3) ≈ 53.130102354156°. The line is y = (4/3)x.

One point, distance, and slope (default)

Point (1, 1), d = 5, m = 0.75 = 3/4. Then θ = arctan(0.75) ≈ 36.87°, ΔX = 4, ΔY = 3, and the second point is (5, 4). Heading the other way lands on (−3, −2). Both share y = 0.75x + 0.25.

Vertical line

Points (1, 2) and (1, 1) have ΔX = 0. The slope is infinity, d = 1, and the heading is 270° (straight down). The equation is x = 1.

Frequently asked questions

How do I find the slope of a line from two points?
Subtract the coordinates: m = (y₂ − y₁) / (x₂ − x₁), or rise over run. The distance between the points is √((x₂ − x₁)² + (y₂ − y₁)²), and the incline angle is θ = arctan(m), reported from 0° to 360° so a downward or leftward segment keeps its heading.
What if I know one point and the slope?
Enter the point, a positive distance d, and either the slope m or the incline angle θ in degrees. The second point is d along that heading. When you enter a slope, a second solution 180° away is listed — the same line, the other direction.
What does an undefined or infinite slope mean?
A vertical line has ΔX = 0, so rise over run divides by zero. This calculator reports m as infinity and writes the equation as x = X₁. A horizontal line has m = 0 and equation y = Y₁.
What are slope-intercept and point-slope form?
Slope-intercept is y = mx + b, where b is the y-intercept (the value of y when x = 0). Point-slope is y − y₁ = m(x − x₁), which is convenient when you already have a point on the line. Both describe the same line whenever m is finite.
Do I enter slope or the angle of incline?
Either one. m = tan(θ) with θ in degrees. If both are filled, slope is used and the angle is ignored. Leave slope blank to drive the result from θ.

Related calculators