Subtract the starting x-coordinate from the ending x-coordinate to find the run, or the change in the horizontal position. For example, if your line starts at (-1, 5) and goes through (4, 15), subtract -1 from 4, or 4 - (-1), to get 5.
Subtract the starting y-coordinate from the ending y-coordinate to find the rise, or the change in the vertical position. For example, if your line starts at (-1, 5) and goes through (4, 15), subtract 5 from 15 to get 10.
Divide the rise by the run to find the gradient of the line. In this example, divide 10 by 5 to get a gradient of 2.