StringMash.com

Slope calculator

Two points in, the slope and the equation of the line out.

18 characters
Updates as you type
Slope−3/4
Slope as a decimal−0.75
Equationy = −(3/4)x + 3/2
Point-slope formy − 3 = (−3/4)(x + 2)
Standard form3x + 4y = 6
y-intercept3/2
x-intercept2
Angle−36.87°
Distance5
Midpoint(0, 1.5)
The working and the graph are below

Show the steps
run 4rise −3(−2, 3)(2, 0)
  1. Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁).
  2. Rise: 0 − 3 = −3. Run: 2 − (−2) = 4.
  3. m = −3 ÷ 4 = −3/4 ≈ −0.75. Negative, so the line goes down from left to right.
  4. The y-intercept is b = y₁ − m·x₁ = 3 − (−3/4) × (−2) = 3/2.
  5. So the line is y = −(3/4)x + 3/2.

Using the calculator

Type two points, such as (-2, 3) and (2, 0). Brackets are optional, so four numbers in a row work too. The slope appears as you type.

Below it is the line in slope-intercept form, y = mx + b, with point-slope and standard form, the intercepts, the angle, the distance between the points and the midpoint. The graph draws the line with the rise and run marked.

Rise over run

Slope measures how steep a line is: how far it goes up for each step to the right. Take the change in y and divide it by the change in x, so m = (y₂ − y₁) ÷ (x₂ − x₁).

For (-2, 3) and (2, 0), the rise is 0 − 3 = −3 and the run is 2 − (−2) = 4. So the slope is −3/4. The line drops 3 for every 4 it moves right. It doesn't matter which point you call the first, as long as you subtract in the same order top and bottom.

From the slope to the equation

Once you have m, put one point into y = mx + b to find b, the y-intercept. With m = −3/4 and the point (−2, 3), 3 = (−3/4)(−2) + b, so b = 3 − 3/2 = 3/2. The line is y = −(3/4)x + 3/2.

Multiply through to clear the fractions and you get the standard form, 3x + 4y = 6. Teachers often ask for that one.

Flat and vertical lines

A flat line has a rise of 0, so its slope is 0 and its equation is just y = a number. A vertical line has a run of 0. Dividing by 0 has no answer, so its slope is undefined, and its equation is x = a number.

Two lines are parallel when they have the same slope. They are perpendicular when the slopes multiply to −1, so a line with slope 2 meets one with slope −1/2 at a right angle.

Questions

What does a negative slope mean?

The line goes down as you move to the right. A positive slope goes up.

Is slope the same as gradient?

Yes. Gradient is the usual word in British schools, slope in American ones.

Can I use decimals?

Yes. Decimal points are turned into exact fractions, so (0.5, 1) and (1.5, 2.5) give a slope of 3/2.

How is the angle worked out?

It is the inverse tangent of the slope, measured from the x-axis. A slope of 1 is 45°.

Sources

Added and reviewed . What's new