If you've been given any two coordinates on a particular line, you can figure out the equation of the line by:
1. Find the gradient (m) using information from both sets of coordinates and using the following formula
m = (y2-y1/x2-x1)
2. Insert the numerical values of x and y from any one of the coordinates and you will be left with only one unknown, b. B is the value of y for which x = 0 (the y-intercept, as previously mentioned). You can solve for the value of b.
3. Write the equation and insert the value of m and b , but not those of x and y as they can vary along the line.
E.g. The two cordinates along a line are (2,2) and (4,6)
m = (y2-y1) / (x2-x1) = (6-2)/(4-2) = 4/2 = 2
M = 2
y = mx + b
6 = 2(4) + b
6 - 8 = b
B = -2
y = mx + b
y=2x - 2