girgit.org

Straight Lines

Slope from two points: rise over run

The big ideaGiven two points on a line, its slope is rise over run: \( m = \dfrac{y_2 - y_1}{x_2 - x_1} \).

In simple words

Pick two spots on a line. Count how far up you go from the first spot to the second. Count how far across you go. Divide the up by the across. That one number is how steep the line is, and it comes out the same whichever two spots you pick.

Rise over run

Two points fix a line completely, so they should also fix its slope. Let \( P(x_1, y_1) \) and \( Q(x_2, y_2) \) be two points on a line that is not vertical. Then

\[ m = \frac{y_2 - y_1}{x_2 - x_1}, \qquad x_1 \ne x_2 \]

The top, \( y_2 - y_1 \), is the rise: how much the height changes. The bottom, \( x_2 - x_1 \), is the run: how much the across position changes. If \( x_1 = x_2 \), the two points are one above the other, the line is vertical, and we would be dividing by zero. That is the same "slope not defined" we met before.

Try it: drag the two points and watch the rise, the run and their ratio change together.

Why the formula works

Picture the line passing through P and Q, with Q higher up. From Q drop a straight-down line to the x-axis, and from P draw a flat line across until it meets that drop at a point M. Now P, M and Q are the corners of a right triangle with the right angle at M. The flat side PM is the run, and the upright side MQ is the rise.

Case 1: the inclination \( \theta \) is acute (the line rises to the right, Q is to the right of P). The angle of the triangle at P equals \( \theta \), because PM is parallel to the x-axis. So

\[ m = \tan \theta = \frac{\text{MQ}}{\text{MP}} = \frac{y_2 - y_1}{x_2 - x_1} \]

Case 2: \( \theta \) is obtuse (the line falls to the right, so the higher point Q is to the left of P). Now the angle of the triangle at P is \( 180^\circ - \theta \), so \( \theta = 180^\circ - \angle \text{MPQ} \), and since \( \tan(180^\circ - A) = -\tan A \),

\[ m = \tan \theta = -\tan \angle \text{MPQ} = -\frac{\text{MQ}}{\text{MP}} \]

Here MQ \( = y_2 - y_1 \) and, because P is now to the right, MP \( = x_1 - x_2 \). So

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

Both cases give the same formula, so it always works.

Worked examples

Worked example 1: four kinds of line

Find the slope of the line through each pair of points.

  1. \( (1, 2) \) and \( (4, 8) \): \( m = \frac{8 - 2}{4 - 1} = \frac{6}{3} = 2 \). Rises to the right.
  2. \( (-2, 5) \) and \( (3, -5) \): \( m = \frac{-5 - 5}{3 - (-2)} = \frac{-10}{5} = -2 \). Falls to the right.
  3. \( (-1, 4) \) and \( (6, 4) \): \( m = \frac{4 - 4}{6 - (-1)} = \frac{0}{7} = 0 \). Same height: a horizontal line.
  4. \( (2, -3) \) and \( (2, 7) \): \( m = \frac{10}{0} \), not defined. Same \( x \): a vertical line.

The order of the points does not matter. With \( (4, 8) \) first, \( \frac{2 - 8}{1 - 4} = \frac{-6}{-3} = 2 \): both top and bottom change sign. What you must not do is mix the order, taking \( y_2 - y_1 \) on top and \( x_1 - x_2 \) below. That flips the sign of the answer.

Worked example 2: a hill road

A straight stretch of road starts at a point we call \( (0, 0) \) and reaches the point \( (400, 20) \), in metres (400 m along the flat, 20 m higher). What is its slope?

  1. \( m = \frac{20 - 0}{400 - 0} = \frac{1}{20} = 0.05 \), a gradient of "1 in 20" or 5%.

Three points on one line

If A, B and C lie on one straight line, the slope from A to B must equal the slope from B to C: it is the same line, so the same steepness. The reverse is true too: if slope of AB = slope of BC, the two pieces have the same steepness and share the point B, so they are one line. So three points A, B and C are collinear if and only if slope of AB = slope of BC.

Worked example 3

(a) Are \( (1, 1) \), \( (3, 5) \) and \( (4, 7) \) collinear? (b) Find \( k \) so that \( (2, 3) \), \( (4, k) \) and \( (8, 15) \) are collinear.

  1. (a) Slope of AB \( = \frac{5 - 1}{3 - 1} = 2 \), slope of BC \( = \frac{7 - 5}{4 - 3} = 2 \). Equal, so yes. (The area test on the first page gave 0 too.)
  2. (b) The slope from \( (2, 3) \) to \( (8, 15) \) is \( \frac{12}{6} = 2 \). The middle point must fit the same slope: \( \frac{k - 3}{4 - 2} = 2 \), so \( k = 7 \).

Try it: move the middle point and watch the two slopes. The path is straight only when they agree.

Try it. (a) Find the slope of the line through \( (-3, -1) \) and \( (5, 3) \), and its inclination to the nearest degree. (b) Are \( (0, 4) \), \( (2, 1) \) and \( (6, -5) \) collinear?

Answer
(a) \( m = \frac{3 - (-1)}{5 - (-3)} = \frac{4}{8} = \frac{1}{2} \); \( \theta = \tan^{-1} \frac{1}{2} \approx 27^\circ \). (b) Slopes are \( \frac{1 - 4}{2 - 0} = -\frac{3}{2} \) and \( \frac{-5 - 1}{6 - 2} = -\frac{6}{4} = -\frac{3}{2} \). Equal, so yes.

Words to know

Rise
The change in height, \( y_2 - y_1 \).
Run
The change in across position, \( x_2 - x_1 \).
Slope from two points
\( m = \frac{y_2 - y_1}{x_2 - x_1} \), for \( x_1 \ne x_2 \).
Collinear points
Points on one line; for A, B, C, slope of AB equals slope of BC.

What is the slope of the line through \( (2, 7) \) and \( (5, 1) \)?

  1. 2
  2. \( -2 \)
  3. \( -\frac{1}{2} \)

Two points on a line have the same \( x \)-coordinate. What is the slope of the line?

  1. 0
  2. 1
  3. Not defined

For which \( k \) are \( (0, 0) \), \( (2, 6) \) and \( (5, k) \) collinear?

  1. 15
  2. 12
  3. 10