Gradient from two points
Gradient compares vertical change with horizontal change. For points A(x1,y1) and B(x2,y2) on a straight line,
m=x2−x1y2−y1,x2=x1.
Use the same point order in both differences: Δy=y2−y1 and Δx=x2−x1.
- Find the change in the y-coordinates.
- Find the change in the x-coordinates in the same order.
- Divide Δy by Δx and simplify.
A line segment is a finite part of a straight line between two endpoints, and it has the same gradient as the line containing it.
The horizontal and vertical changes form a right-angled triangle.
Using the calculation
For the points (−2,5) and (6,−7),
m=6−(−2)−7−5=8−12=−23.
Here x increases by 8 while y decreases by 12, so the line has a negative gradient. In y=mx+c, the coefficient m is the gradient.