Free maths tool · Level: Ages 14 to 16
Slope of a line
Drag point A and point B across the grid. The step between them shows what the slope is actually measuring.
The slope of the line through A(x₁ | y₁) and B(x₂ | y₂) is m = (y₂ - y₁) / (x₂ - x₁), the change in height divided by the change in width. A slope of 3/4 means the line rises 3 for every 4 you move across. A vertical line has x₂ - x₁ equal to zero, so it has no slope at all.
Δy and Δx are just a staircase
The formula looks abstract, but on screen it is a step: some distance across, then some distance up. Those two pieces are Δx and Δy, and their ratio is the slope.
Drag B further right and the step gets wider, but the line does not tilt as long as you stay on it. That is the whole idea: whichever two points you pick, the ratio comes out the same. In an exercise, take whichever grid points are easiest to read.
From slope to the equation y = mx + q
Once you have the slope, the intercept is all that is left. Substitute either point into the equation and solve. The tool prints the finished equation straight away, so you can check your own working against it.
Watch the sign. A line that falls has a negative slope, and the equation carries a minus. Drag B below A and watch the step and the sign flip together.
Perpendicular lines and the vertical case
Switch the second line on to see the perpendicular through A. For ordinary lines m · m′ = -1, so 2 pairs with -1/2.
That rule breaks in two places, and those are the ones that turn up in tests. A horizontal line has m = 0, and the perpendicular to it is vertical with no slope at all. The other way round, the perpendicular to a vertical line is horizontal with m = 0. Stack A and B in the same column and the tool simply says the slope does not exist, because dividing by zero is not allowed.
Still stuck on straight lines?
A tutor works through your own exercises with you, so you can see exactly where it goes wrong.
Frequently asked questions
- How do you calculate the slope of a line?
- Take two points on the line, subtract the y values and divide by the difference of the x values: m = (y₂ - y₁) / (x₂ - x₁). The order does not matter as long as you keep it consistent on the top and the bottom.
- What does a negative slope mean?
- The line falls. As you move right, the graph goes down. With m = -2 you drop two units for every unit you move across.
- What is the slope of a vertical line?
- There is none. A vertical line has Δx equal to zero, and you cannot divide by zero. Its equation is written x = k rather than y = mx + q.
- How can you tell whether two lines are perpendicular?
- Multiply their slopes. If the answer is -1, they are perpendicular. The exception is a horizontal and a vertical line: they are perpendicular too, but one of them has no slope to multiply.
- Is the slope the same thing as the derivative?
- For a straight line, yes. On a curve the steepness changes from point to point, and the derivative at a point is the slope of the tangent line there. That is exactly what our derivative tool shows.
More interactive maths tools
- Discriminant and parabola →Slide a, b and c and see D decide whether the parabola cuts, touches or misses the axis.
- Unit circle →Drag the angle and see sin, cos and tan as lengths, with the exact values.
- Sine and cosine rule →Drag a triangle and watch both rules keep up, with Pythagoras as the special case.