Handeware
Math

Slope

2.6667
Y-intercept
0.3333

Equation of a Line Calculator

A straight line can be written as y = mx + b, where m is the slope and b is where the line crosses the vertical axis. Enter any two points on the line and this finds both numbers.

How it works

The slope is the rise divided by the run: how much y changes, divided by how much x changes, between the two points.

The y-intercept comes from one of the points. Subtract the slope times that point's x value from its y value, and the line then reads y = slope times x plus the intercept.

Worked example

Through the points (1, 3) and (4, 11), the slope is 2.6667 and the line crosses the y-axis at 0.3333.

Questions

What if both points have the same x value?

Then the line runs straight up and down, a vertical line. A vertical line has no slope, so pick two points with different x values.

Does the order of the points matter?

No. Swapping the two points gives the same line and the same slope.

What does a negative slope mean?

The line goes down as it moves to the right.

More like this

All Math calculators