The line through two points

Through two distinct points there is exactly one straight line. Here we find the line through A(1,1)A(1, 1) and B(3,5)B(3, 5).

First we find the slope, which measures how much yy increases while xx increases by 11. It is the difference in yy divided by the difference in xx.

5131=42=2\frac{5 - 1}{3 - 1} = \frac{4}{2} = 2

Next we build the equation from the slope 22 and the fact that the line passes through A(1,1)A(1, 1). Writing the line as y=2x+by = 2x + b and substituting AA gives 1=21+b1 = 2 \cdot 1 + b, so b=1b = -1. The line is therefore y=2x1y = 2x - 1.

Let us check with the other point B(3,5)B(3, 5): 231=52 \cdot 3 - 1 = 5, so the line does pass through BB.

In general, the line through two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) has slope y2y1x2x1\dfrac{y_2 - y_1}{x_2 - x_1}. Calling this mm, the line through (x1,y1)(x_1, y_1) with slope mm can be written as follows.

yy1=m(xx1)y - y_1 = m(x - x_1)

This routine — get the slope from two points, then build the equation through one of them — is the foundation for the intersection problems too. The large dots on the graph are the two points AA and BB.