The gradient (also known as slope) of a line is defined as
gradient=vertical risehorizontal run
In the following triangle, the gradient of the line is given by: ab
In general, for the line joining the points (x1, y1) and (x2, y2), we have:
We can now write the fomula for the slope of a line.
Gradient of a Line Formula
We see from the diagram above, that the gradient (usually written m) is given by:
m=y2−y1x2−x1
Interactive graph - slope of a line
You can explore the concept of slope of a line in the following JSXGraph (it's not a fixed image).
Drag either point A or point B to investigate how the gradient formula works. The numbers will update as you interact with the graph.
Notice what happens to the sign (plus or minus) of the slope when point B is above or below A.
A
B
C
slope m
= rise / run
= 7 / 10
= 0.7
= rise / run
= 7 / 10
= 0.7
(-9, -4)
(1, 3)
(1, -4)
y2 − y1
= 3 − -4
= 7
= 3 − -4
= 7
x2 − x1
= 1 − -9
= 10
= 1 − -9
= 10
5
10
-5
-10
5
-5
x
y
You can move the graph up-down, left-right if you hold down the "Shift" key and then drag the graph.
Sometimes the explanation boxes overlap. It can't be helped!
If you get lost, you can always refresh the page.
A negative slope means that the value of the dependent variable (usually y) is decreasing as we go left to right:
We have a line with slope m and the angle that the line makes with the x-axis is α.
From trigonometry, we recall that the tan of angle α is given by:
This gives us the result:
Sometimes the explanation boxes overlap. It can't be helped!
If you get lost, you can always refresh the page.
Positive and Negative Slopes
In general, a positive slope indicates the value of the dependent variable increases as we go left to right:
[The dependent variable (usually x) in the above graph is the y-value.]
A negative slope means that the value of the dependent variable (usually y) is decreasing as we go left to right:
Inclination
From trigonometry, we recall that the tan of angle α is given by:
Now, since slope is also defined as opposite/adjacent, we have:tan α=oppositeadjacent
This gives us the result:
Then we can find angle α usingtan α = m
This angle α is called the inclination of the line.α = arctan m(That is, α = tan-1 m)