The equation of a straight line can be worked out using coordinates and the gradient, and vice versa.

Part of

The general equation of a straight line is , where is the gradient and the coordinates of the y-intercept.

Look at the National 4 straight line section before continuing.

We can find the equation of a straight line when given the gradient and a point on the line by using the formula:

where is the gradient and is on the line.

Find the equation of the line with gradient 3, passing through (4, 1).

Using with m = 3, a = 4 and b = 1.

Now try the example question below.

- Question
Find the equation of the line which passes through the points A(-2, 0) and B(1, 6) and state the gradient and y-intercept.

Since we are given 2 points that already lie on the line, using the formula as before, we need to calculate the gradient first.

Now we can use the formula when m = 2, a = 1 and b = 6 (You can use any of the 2 points given in the question).

Therefore the gradient equals 2 and y-intercept equals (0, 4).