Lesson 8 · Circle

Equation of Lines Passing through Two Points

Optional MathematicsSubject
8 minEstimated read

Coordinate Geometry and René Descartes

Coordinate geometry describes the position of every point with numbers. A point is written as an ordered pair \( (x, y) \). The first number tells how far the point is to the right or left of the y-axis, and the second tells how far it is above or below the x-axis. Once points become numbers, lines and shapes can become equations, and a question about a drawing can be answered with algebra.

Definition

Coordinate geometry: the branch of mathematics that expresses the position of any point numerically, using coordinates \( (x, y) \), and describes lines, curves and geometric figures by equations.

The first person to develop this idea was the French mathematician René Descartes. The cartesian coordinate system, the pair of perpendicular axes you draw on graph paper, is named after him. Pierre de Fermat and Apollonius of Perga also contributed to this field. Their work expressed points as ordered pairs, and straight lines, curves and geometric figures as equations. Curves such as the circle, the parabola, the ellipse and the hyperbola were also written in algebraic form.

René Descartes, the French mathematician after whom the cartesian coordinate system is named.
René Descartes, the French mathematician after whom the cartesian coordinate system is named.

Because it gives algebra and geometry one common language, the cartesian coordinate system is used in physics, computer science, engineering and astronomy. A computer drawing a straight line on a screen and an engineer planning a straight road are both working with the kind of equations you meet in this topic.

Point-Slope Form of a Line

A straight line is fixed completely by two pieces of information. One way is to know one point on the line and how steep the line is. The steepness is called the slope. If a line makes an angle \( \theta \) with the positive direction of the x-axis, its slope is \( m = \tan\theta \).

Definition

Slope of a line: the tangent of the angle \( \theta \) that the line makes with the positive x-axis, written \( m = \tan\theta \). For two points \( (x_1, y_1) \) and \( (x_2, y_2) \) on the line, \( m = \frac{y_2 - y_1}{x_2 - x_1} \).

Line AB makes angle \( \theta \) with the x-axis and cuts the y-axis at M, so its slope is \( \tan\theta = m \) and its y-intercept is \( OM = c \).
Line AB makes angle \( \theta \) with the x-axis and cuts the y-axis at M, so its slope is \( \tan\theta = m \) and its y-intercept is \( OM = c \).

In the figure, line AB has slope \( \tan\theta = m \) and cuts the y-axis at M, so its y-intercept is \( OM = c \). Take any point \( P(x, y) \) on AB. A line with slope m and y-intercept c has the equation:

\[ y = mx + c \quad \text{(i)} \]

Suppose the line also passes through a known point \( Q(x_1, y_1) \). A point that lies on a line satisfies its equation, so:

\[ y_1 = mx_1 + c \quad \text{(ii)} \]

Step 1: Subtracting equation (ii) from equation (i):

\[ y - y_1 = mx + c - (mx_1 + c) \]

Step 2: Removing the bracket, which changes the sign of each term inside it:

\[ y - y_1 = mx + c - mx_1 - c \]

Step 3: Cancelling \( c \) against \( -c \):

\[ y - y_1 = mx - mx_1 \]

Step 4: Taking m out as a common factor:

\[ y - y_1 = m(x - x_1) \]

Definition

Point-slope form: the equation of the straight line that passes through the point \( (x_1, y_1) \) and has slope m is \( y - y_1 = m(x - x_1) \).

The y-intercept c has disappeared from the result. That is exactly why this form is useful: you need only one point and the slope.

Example: find the equation of the line that passes through \( (2, -3) \) and has slope 4.

Step 1: Putting \( x_1 = 2 \), \( y_1 = -3 \) and \( m = 4 \) into the point-slope form:

\[ y - (-3) = 4(x - 2) \]

Step 2: Simplifying both sides:

\[ y + 3 = 4x - 8 \]

Step 3: Collecting every term on one side:

\[ 4x - y - 11 = 0 \]

Check: putting \( (2, -3) \) into the answer gives \( 8 + 3 - 11 = 0 \), so the point really lies on the line.

Equation of a Line Through Two Points

Very often the slope is not given at all. Instead you know two points on the line. Two points are enough, because only one straight line can pass through two given points.

C(x, y) is any point on the line through A and B. All three lie on one line, so the slope of CA equals the slope of AB.
C(x, y) is any point on the line through A and B. All three lie on one line, so the slope of CA equals the slope of AB.

Let \( A(x_1, y_1) \) and \( B(x_2, y_2) \) be the two points, and let AB be the line through them. Let \( C(x, y) \) be any other point on AB.

Step 1: Writing the slope of segment AB by the slope formula:

\[ m_1 = \frac{y_2 - y_1}{x_2 - x_1} \]

Step 2: Writing the slope of segment CA by the same formula, using A and C:

\[ m_2 = \frac{y - y_1}{x - x_1} \]

Step 3: Equating the two slopes, because C, A and B lie on one straight line:

\[ \frac{y - y_1}{x - x_1} = \frac{y_2 - y_1}{x_2 - x_1} \]

Step 4: Multiplying both sides by \( (x - x_1) \):

\[ y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1) \]

Definition

Two-point form: the equation of the straight line passing through the points \( (x_1, y_1) \) and \( (x_2, y_2) \) is \( y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1) \), where \( x_1 \neq x_2 \).

Key idea

The two-point form is the point-slope form with the slope worked out for you. The fraction \( \frac{y_2 - y_1}{x_2 - x_1} \) is simply m, found from the two points.

What happens if you equate the slope of AB with the slope of BC instead of CA? You get \( y - y_2 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_2) \). It looks different because B is now the fixed point, but it describes the same line. The slope is the same and B lies on the line, so once both are simplified they give exactly the same equation.

Another Proof Using Similar Triangles

The same formula can be proved with similar triangles. Here the straight line MN passes through \( B(x_1, y_1) \) and \( C(x_2, y_2) \), and \( P(x, y) \) is any point on it.

Perpendiculars BG, PR and CD drop to the x-axis, and BE, drawn perpendicular to CD, cuts PR at F. Triangles BPF and BCE are similar.
Perpendiculars BG, PR and CD drop to the x-axis, and BE, drawn perpendicular to CD, cuts PR at F. Triangles BPF and BCE are similar.

Draw perpendiculars BG, PR and CD from the three points to the x-axis OX. Then draw BE perpendicular to CD. BE cuts PR at F. Each side of the two small triangles can now be written using coordinates:

  • \( BF = GR = OR - OG = x - x_1 \)
  • \( BE = GD = OD - OG = x_2 - x_1 \)
  • \( PF = PR - FR = PR - BG = y - y_1 \)
  • \( CE = CD - ED = CD - BG = y_2 - y_1 \)

Triangles BPF and BCE are similar. The angle at B is common to both, and the angles at F and E are both right angles, so the third angles are equal as well. Corresponding sides of similar triangles are in the same ratio.

Step 1: Writing the ratio of corresponding sides:

\[ \frac{BF}{BE} = \frac{PF}{CE} \]

Step 2: Replacing each side by its length in coordinates, where \( x_1 \neq x_2 \) and \( y_1 \neq y_2 \):

\[ \frac{x - x_1}{x_2 - x_1} = \frac{y - y_1}{y_2 - y_1} \]

Step 3: Multiplying both sides by \( (y_2 - y_1) \):

\[ y - y_1 = \frac{x - x_1}{x_2 - x_1}(y_2 - y_1) \]

Step 4: Rearranging the right side so the slope comes first:

\[ y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1) \]

Both proofs arrive at the same two-point form, one through equal slopes and one through similar triangles.

Worked Example: A Line Through Two Given Points

Find the equation of the straight line AB passing through the points \( A(-1, 1) \) and \( B(3, 2) \).

The straight line through \( A(-1, 1) \) and \( B(3, 2) \).
The straight line through \( A(-1, 1) \) and \( B(3, 2) \).

Step 1: Naming the points as \( (x_1, y_1) = (-1, 1) \) and \( (x_2, y_2) = (3, 2) \), and writing the two-point form:

\[ y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1) \]

Step 2: Substituting the coordinates:

\[ y - 1 = \frac{2 - 1}{3 - (-1)}\{x - (-1)\} \]

Step 3: Simplifying the fraction and the bracket, since \( 3 + 1 = 4 \):

\[ y - 1 = \frac{1}{4}(x + 1) \]

Step 4: Multiplying both sides by 4 to clear the fraction:

\[ 4y - 4 = x + 1 \]

Step 5: Moving every term to one side:

\[ x - 4y + 5 = 0 \]

So \( x - 4y + 5 = 0 \) is the required equation of AB. A quick check with B gives \( 3 - 8 + 5 = 0 \), so B lies on it too.

Does It Matter Which Point Comes First?

Must A always be \( (x_1, y_1) \)? Work the same example again with the points swapped: \( (x_1, y_1) = (3, 2) \) and \( (x_2, y_2) = (-1, 1) \).

Step 1: Substituting into the two-point form:

\[ y - 2 = \frac{1 - 2}{-1 - 3}(x - 3) \]

Step 2: Simplifying the fraction, since \( \frac{-1}{-4} = \frac{1}{4} \):

\[ y - 2 = \frac{1}{4}(x - 3) \]

Step 3: Multiplying both sides by 4:

\[ 4y - 8 = x - 3 \]

Step 4: Moving every term to one side:

\[ x - 4y + 5 = 0 \]

Key idea

The answer is exactly the same. Swapping the points changes the sign of both \( y_2 - y_1 \) and \( x_2 - x_1 \), so their quotient, the slope, does not change, and both points are still on the line. Choose whichever order makes the arithmetic easier.

Collinear Points

Definition

Collinear points: three or more points that lie on the same straight line.

To test whether three points are collinear, find the equation of the line through any two of them. Then substitute the third point into that equation. If it satisfies the equation, it lies on the same line and all three points are collinear. If it does not, they are not collinear.

Example: the points \( A(-5, 3) \), \( B(-10, 6) \) and \( C(5, -3) \) are given.

  • (a) Find the equation of line AB.
  • (b) Prove that the three points are collinear.

(a) Take \( (x_1, y_1) = (-5, 3) \) and \( (x_2, y_2) = (-10, 6) \).

Step 1: Substituting into the two-point form:

\[ y - 3 = \frac{6 - 3}{-10 - (-5)}\{x - (-5)\} \]

Step 2: Simplifying the fraction, since \( -10 + 5 = -5 \):

\[ y - 3 = \frac{3}{-5}(x + 5) \]

Step 3: Multiplying both sides by \( -5 \):

\[ -5(y - 3) = 3(x + 5) \]

Step 4: Opening the brackets:

\[ -5y + 15 = 3x + 15 \]

Step 5: Moving every term to one side, where the two 15s cancel:

\[ 3x + 5y = 0 \quad \text{(i)} \]

(b) Substituting \( C(5, -3) \) into equation (i):

\[ 3 \times 5 + 5 \times (-3) = 15 - 15 = 0 \]

This gives \( 0 = 0 \), which is true. So C also lies on line (i). Hence A, B and C are collinear, and the equation of the straight line through all three is \( 3x + 5y = 0 \).

Key idea

Any two of three collinear points give the same line. Using A and C, the slope is \( \frac{-3 - 3}{5 - (-5)} = -\frac{3}{5} \), the same as from A and B, and the equation again simplifies to \( 3x + 5y = 0 \).

Worked Example: A Line Through the Meeting Point of Two Lines

A straight line passes through the point where the lines \( 3x + y = 2 \) and \( 5x + 2y = 3 \) meet, and also through the point \( (3, 1) \).

  • (a) Find the coordinates of the point of intersection of the two lines.
  • (b) Find the equation of the line through the point of intersection and \( (3, 1) \).

(a) The point of intersection lies on both lines, so it satisfies both equations at once:

\[ 3x + y = 2 \quad \text{(i)} \]

\[ 5x + 2y = 3 \quad \text{(ii)} \]

Step 1: Making y the subject of equation (i):

\[ y = 2 - 3x \]

Step 2: Substituting this value of y into equation (ii):

\[ 5x + 2(2 - 3x) = 3 \]

Step 3: Opening the bracket:

\[ 5x + 4 - 6x = 3 \]

Step 4: Collecting the x terms on the left and the numbers on the right:

\[ -x = 3 - 4 \]

Step 5: Solving for x, since \( -x = -1 \):

\[ x = 1 \]

Step 6: Putting \( x = 1 \) back into \( y = 2 - 3x \):

\[ y = 2 - 3 \times 1 = -1 \]

So the two lines meet at the point \( (1, -1) \).

(b) Now the required line passes through two known points. Take \( (x_1, y_1) = (3, 1) \) and \( (x_2, y_2) = (1, -1) \).

Step 1: Substituting into the two-point form:

\[ y - 1 = \frac{-1 - 1}{1 - 3}(x - 3) \]

Step 2: Simplifying the fraction, since \( \frac{-2}{-2} = 1 \):

\[ y - 1 = x - 3 \]

Step 3: Moving every term to one side:

\[ x - y - 2 = 0 \]

The required equation is \( x - y - 2 = 0 \). Check: \( (3, 1) \) gives \( 3 - 1 - 2 = 0 \) and \( (1, -1) \) gives \( 1 + 1 - 2 = 0 \).

A Line Through (a, 0) and (0, b)

Some problems give the two points where a line crosses the axes. If a line cuts the x-axis at \( (a, 0) \) and the y-axis at \( (0, b) \), the two-point form gives a tidy result.

Step 1: Substituting \( (x_1, y_1) = (a, 0) \) and \( (x_2, y_2) = (0, b) \):

\[ y - 0 = \frac{b - 0}{0 - a}(x - a) \]

Step 2: Multiplying both sides by \( -a \):

\[ -ay = b(x - a) \]

Step 3: Opening the bracket and moving the terms with x and y to the left:

\[ bx + ay = ab \]

Step 4: Dividing every term by ab:

\[ \frac{x}{a} + \frac{y}{b} = 1 \]

Here a is the x-intercept and b is the y-intercept. The same working with points such as \( (p, 0) \) and \( (0, q) \) gives \( qx + py = pq \), which is the form you need when a third point is known to lie on that line.

When the Two Points Have the Same x-Coordinate

The two-point form divides by \( x_2 - x_1 \). If the two points have the same x-coordinate, this difference is zero, and division by zero has no meaning. The line through such points is vertical.

Common mistake

Never put \( x_2 - x_1 = 0 \) in the denominator. When both points have the same x-coordinate, stop and write the vertical line directly instead of using the formula.

A vertical line is easy to write down, because every point on it has the same x-coordinate. For example, the line through \( (1, 0) \) and \( (1, 2) \) is:

\[ x = 1 \]

When the two points share the same y-coordinate instead, the formula still works. The slope comes out as 0 and the line is horizontal. Through \( (2, 5) \) and \( (7, 5) \) the formula gives \( y - 5 = 0 \), which is \( y = 5 \).

Reading a Line from Its Graph

A line drawn on a grid can be turned into its equation. Find two points on the line that are marked with dots, or where the line passes exactly through a corner of the grid, and read their coordinates. Then use the two-point form as usual.

Graph (क) above and graph (ग) below: each line passes through the points marked with dots.
Graph (क) above and graph (ग) below: each line passes through the points marked with dots.
Graph (ख) above and graph (घ) below: each line passes through the points marked with dots.
Graph (ख) above and graph (घ) below: each line passes through the points marked with dots.

In graph (ख), the line passes through the marked points \( (-1, -2) \) and \( (5, 0) \). Take \( (x_1, y_1) = (-1, -2) \) and \( (x_2, y_2) = (5, 0) \).

Step 1: Substituting into the two-point form:

\[ y - (-2) = \frac{0 - (-2)}{5 - (-1)}\{x - (-1)\} \]

Step 2: Simplifying the fraction, since \( \frac{2}{6} = \frac{1}{3} \):

\[ y + 2 = \frac{1}{3}(x + 1) \]

Step 3: Multiplying both sides by 3:

\[ 3y + 6 = x + 1 \]

Step 4: Moving every term to one side:

\[ x - 3y - 5 = 0 \]

Read the points carefully

The equation can only be as correct as the coordinates you read. Count the squares from the origin one at a time, and make sure each point you use actually lies on the line before you substitute.

Formulas at a Glance

What you knowEquation to use
Two points, to find the slope\( m = \frac{y_2 - y_1}{x_2 - x_1} \)
Slope m and y-intercept c\( y = mx + c \)
One point and the slope\( y - y_1 = m(x - x_1) \)
Two points with \( x_1 \neq x_2 \)\( y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1) \)
The points \( (a, 0) \) and \( (0, b) \)\( \frac{x}{a} + \frac{y}{b} = 1 \)
Two points with the same x-coordinate k\( x = k \)
🔐

The full lesson is waiting for you

The notes are free to read in full. A free account opens the rest of the practice, and tracks your progress and confidence score for every subject. Presentations and videos need approval from Learn Yeti.