Slope and y-intercept from two points
The slope of a straight line is m = (y₂ − y₁) / (x₂ − x₁), the change up over the change across, and its y-intercept is c = y₁ − m × x₁. Through (10, 20) and (30, 80) the slope is 60 / 20 = 3 and c = 20 − 3 × 10 = −10, so y = 3x − 10.
Your values
Enter a number from −1,000,000,000 to 1,000,000,000.
Enter a number from −1,000,000,000 to 1,000,000,000.
Enter a number from −1,000,000,000 to 1,000,000,000.
Enter a number from −1,000,000,000 to 1,000,000,000.
The two points need different x values: a vertical line has no slope.
These values have no real result.
Result
- m slope
- c y-intercept
Fix the value marked above to see the result.
Worked steps
- m = (y₂ − y₁) ÷ (x₂ − x₁) = (80 − 20) ÷ (30 − 10) = 3
- c = y₁ − m × x₁ = 20 − 3 × 10 = −10
- y = m x + c: y = 3 x − 10
Formulas used
The same formulas as the formula sheet and the practice questions; the worked steps print them with your numbers.
m = (y₂ − y₁) ÷ (x₂ − x₁)c = y₁ − m × x₁y = m x + c
Questions
What does the slope of a graph mean?
It is a rate: how much the up quantity changes for each unit across. On a distance-time graph in metres and seconds the slope is a speed in m/s; on an energy-time graph it is a power in W.
Which two points should I read off a graph?
Two points far apart where the line crosses grid lines exactly, so both readings are exact. Use the numbers on the axes, not the count of squares.
What if the slope is negative?
The line goes down from left to right: the up quantity falls as the across one grows, like a candle burning shorter. A candle from 30 cm to 10 cm in 40 min has m = −0.5 cm per minute.