∑ Basic Mathematics

Menu and settings

Sound
Comfort
Companion color
Theme
Reading panel
Graphics quality

Part III — Coordinate Geometry · Chapter 10

Segments, Rays, and Lines

One formula, $P + t(Q-P)$, describes a segment, a ray, and a whole line — the only difference being how far you let $t$ run. It is a more flexible description than $y = mx + b$, and this chapter shows how the two fit together.

A puzzle to carry through the chapter

A road climbs steadily: $1$ meter up for every $2$ meters forward. A second road crosses it at a right angle. How steep is the second road?

  • It climbs $1$ for every $2$ as well
  • It drops $1$ for every $2$ forward
  • It drops $2$ for every $1$ forward
  • You cannot tell

Sketch the first road's direction as an arrow, then turn the arrow a quarter turn.

By the end of this chapter you can write the parametric form of a segment, ray, or line through two given points; find points dividing a segment in a given ratio; convert between parametric form, $y = mx + b$, and $ax + by = c$; compute slope and use it to test for parallel and perpendicular lines; and handle the vertical line that $y = mx + b$ cannot express.
Before you start

You should be comfortable with adding and scaling points (Chapter 9) and with solving a linear system (Chapter 2) — the two meet when two lines cross.

Three quick ones from earlier chapters, to wake up what this chapter stands on. They are not scored. If one doesn't come to you, its solution says where to look.

With $P = (1,2)$ and $Q = (4,8)$, compute $Q - P$.

Answer: $(3,6)$

$(4 - 1,\; 8 - 2) = (3, 6)$: the displacement from $P$ to $Q$ — §9.3. It is the direction of every line in this chapter.

Compute $\tfrac13(9,6)$.

Answer: $(3,2)$

$\left(\tfrac13 \cdot 9,\; \tfrac13 \cdot 6\right) = (3,2)$ — §9.1. Going a third of the way along a displacement is the first example below.

Solve $\;x + y = 5,\;\; 2x - y = 1\;$ and give $x$.

Answer: $x = 2$

Adding eliminates $y$: $3x = 6$, so $x = 2$ and $y = 3$ — §2.2. By the end of this chapter that is the point where two lines cross.

10.1 Segments

Take two distinct points $P$ and $Q$. Chapter 9 gave us the displacement $Q - P$, the instruction that carries $P$ to $Q$. Carry out only a fraction $t$ of that instruction and you land at

$$X(t) = P + t\,(Q - P).$$

At $t = 0$ this is $P$; at $t = 1$ it is $P + (Q-P) = Q$; at $t = \tfrac12$ it is the midpoint. As $t$ sweeps from $0$ to $1$, $X(t)$ sweeps steadily from $P$ to $Q$.

The segment $PQ$

$$\overline{PQ} = \{\, P + t(Q-P) \;:\; 0 \le t \le 1 \,\}.$$ The point at parameter $t$ divides the segment so that the part from $P$ has length $t$ times the whole.

That last sentence is worth checking rather than believing. The distance from $P$ to $X(t)$ is the length of the displacement $X(t) - P = t(Q-P)$, which by §9.1 is $|t|$ times the length of $Q - P$ — and the length of $Q-P$ is $PQ$. So $PX = t \cdot PQ$ for $t \ge 0$. The parameter is not an arbitrary label; it measures how far along you are.

Example 1. Dividing a segment in a ratio

Find the point one third of the way from $P = (2,-1)$ to $Q = (11,5)$.

  1. The displacement: $Q - P = (9,6)$.
  2. One third of the way means $t = \tfrac13$: $\tfrac13(9,6) = (3,2)$.
  3. $X = P + (3,2) = (5,1)$.
  4. Check the ratio of distances: $PX = \sqrt{9+4} = \sqrt{13}$ and $PQ = \sqrt{81+36} = \sqrt{117} = 3\sqrt{13}$ ✓. $\blacksquare$

The phrase "in the ratio $1:2$" means the same thing — one part to $X$, two parts beyond — and corresponds to $t = \frac{1}{1+2}$. Converting the ratio to a $t$ first saves a lot of fumbling.

Which point is two thirds of the way from $(1,1)$ to $(7,4)$?

Answer: $(5,3)$

The displacement is $(6,3)$; two thirds of it is $(4,2)$; and $(1,1) + (4,2) = (5,3)$. This is $P + t(Q-P)$ with $t = \tfrac23$.

Let $P = (0, 2)$ and $Q = (6, 8)$. At $t = \tfrac13$, the point $P + t(Q - P)$ is $($ $,$ $)$.

Answer: $(2, 4)$

$Q - P = (6, 6)$, a third of which is $(2, 2)$; and $(0, 2) + (2, 2) = (2, 4)$ — one third of the way along the segment.

10.2 Rays

Now stop restricting $t$ from above. The set

$$\{\, P + t(Q-P) \;:\; t \ge 0 \,\}$$

is the ray starting at $P$ and passing through $Q$: it contains the segment and then continues forever in the same direction. The vector $Q - P$ is called a direction vector for the ray.

A direction vector is not unique

Any positive multiple of $Q-P$ describes the same ray: $(3,4)$, $(6,8)$ and $(0.6, 0.8)$ all point the same way. A negative multiple reverses it, giving the opposite ray from $P$. When comparing two rays or lines, compare directions up to a scalar multiple — not coordinate by coordinate.

A ray starts at the origin and passes through $(2,3)$. Which of these is also a direction vector for that same ray?

  • $(4,6)$
  • $(-2,-3)$
  • $(3,2)$

Answer: $(4,6)$

$(4,6) = 2 \cdot (2,3)$, a positive multiple, so it points the same way. $(-2,-3)$ is a negative multiple and gives the opposite ray; $(3,2)$ is no multiple of $(2,3)$ at all — swapping coordinates is not scaling.

10.3 Lines

Finally, let $t$ be any real number at all. Now $X(t)$ traces the entire line through $P$ and $Q$: forward past $Q$ for $t > 1$, backward past $P$ for $t < 0$.

One formula, three objects. Drag $P$ and $Q$, then sweep $t$. The thick portion is the segment ($0 \le t \le 1$); extend $t$ past $1$ and you are on the ray; go negative and you are on the line but on neither of the other two.

Write $Q - P = (u, v)$ and $P = (p_1, p_2)$. Then the parametric form splits into two ordinary equations,

$$x = p_1 + tu, \qquad y = p_2 + tv,$$

and eliminating $t$ between them recovers the familiar equation of a line. If $u \neq 0$, then $t = (x - p_1)/u$, and substituting into the second gives

$$y = p_2 + \frac{v}{u}\,(x - p_1).$$
Slope

The slope of a non-vertical line through $P$ and $Q$ is $$m = \frac{v}{u} = \frac{y_2 - y_1}{x_2 - x_1},$$ the rise over the run. It measures how much $y$ changes per unit change in $x$, and it does not depend on which two points of the line you use.

What is the slope of the line through $(-2,5)$ and $(2,-3)$?

Answer: $-2$

$m = \dfrac{-3 - 5}{2 - (-2)} = \dfrac{-8}{4} = -2$. The line falls $2$ for every $1$ it moves to the right.

Why the independence? Any two points of the line are $X(t_1)$ and $X(t_2)$, and their difference is $(t_2 - t_1)(Q-P)$ — the same direction, scaled. Scaling both $v$ and $u$ by the same factor leaves $v/u$ alone. So slope is a property of the line, not of the points chosen to compute it.

Parallel and perpendicular
  • Two lines are parallel exactly when they have the same slope (or are both vertical).
  • Two lines are perpendicular exactly when $m_1 m_2 = -1$ — equivalently, when one slope is the negative reciprocal of the other. A horizontal line ($m=0$) and a vertical line are the exception the formula cannot express.
Where $m_1m_2 = -1$ comes from

Take a line through the origin with direction $(1,m)$. Rotating by $90°$ sends $(1,m)$ to $(-m,1)$ — check it against the rotation formula of Chapter 6, or just note that the two displacements have equal length and, by the distance formula, the triangle they make with the origin is a right triangle. The rotated direction has slope $1/(-m) = -1/m$. So the perpendicular slope is $-1/m$, i.e. $m_1m_2 = -1$. $\blacksquare$

Wrong turn. Taking the reciprocal and forgetting the sign

Find the slope of a line perpendicular to $y = 2x + 1$.

  1. The tempting move. Perpendicular means "flip the slope": the reciprocal of $2$ is $\tfrac12$.
  2. The check. A line of slope $2$ has direction $A = (1,2)$; one of slope $\tfrac12$ has direction $B = (2,1)$. If they were perpendicular, the triangle $O$, $A$, $B$ would have a right angle at $O$, so the Pythagorean theorem would give $OA^2 + OB^2 = AB^2$. But $OA^2 = 5$, $OB^2 = 5$, and $AB^2 = (2-1)^2 + (1-2)^2 = 2$. Since $5 + 5 \neq 2$, there is no right angle.
  3. Why. Swapping the coordinates of $(1,2)$ to get $(2,1)$ is a reflection in the line $y = x$, not a quarter turn. A quarter turn sends $(1, m)$ to $(-m, 1)$: it swaps the coordinates and reverses one of them.
  4. The repair. The slope is $-\tfrac12$, with direction $B = (2,-1)$. Now $AB^2 = (2-1)^2 + (-1-2)^2 = 10 = 5 + 5$ ✓ — a right angle at $O$. $\blacksquare$

Both changes or neither: the negative reciprocal. A quick sanity check is that one of two perpendicular lines (unless they are horizontal and vertical) must rise while the other falls.

Example 2. From two points to an equation

Find the equation of the line through $A = (-1,4)$ and $B = (3,-2)$.

  1. Slope: $m = \dfrac{-2-4}{3-(-1)} = \dfrac{-6}{4} = -\dfrac32$.
  2. Use the point-slope form with $A$: $y - 4 = -\tfrac32\,(x+1)$.
  3. Expand: $y = -\tfrac32 x - \tfrac32 + 4 = -\tfrac32 x + \tfrac52$.
  4. Check with the other point: at $x = 3$, $y = -\tfrac92 + \tfrac52 = -2$ ✓. $\blacksquare$

Always verify with the point you did not use to build the equation. It catches essentially every arithmetic slip.

Find the equation of the line through $(0,3)$ and $(2,7)$, in the form $y = mx + b$.

Answer: $y = 2x + 3$

$m = \dfrac{7-3}{2-0} = 2$. The point $(0,3)$ is where the line meets the $y$-axis, so $b = 3$ directly: $y = 2x + 3$. Check with the other point: $2(2) + 3 = 7$ ✓.

10.4 The ordinary equation of a line

The form $y = mx + b$ has one flaw: it cannot describe a vertical line, where the slope is undefined. The symmetric form has no such gap.

General form

Every line can be written as $$ax + by = c \qquad\text{with } a, b \text{ not both zero},$$ and every such equation describes a line. Vertical lines are the case $b = 0$; horizontal lines, $a = 0$.

To get there from the parametric form, eliminate $t$ without dividing. From $x = p_1 + tu$ and $y = p_2 + tv$, multiply the first by $v$, the second by $u$, and subtract:

$$v\,x - u\,y = v p_1 - u p_2,$$

which is $ax+by=c$ with $a = v$, $b = -u$. No division took place, so nothing breaks when $u = 0$ — and $u = 0$ is exactly the vertical case.

Example 3. A perpendicular through a point

Find the line through $(6,1)$ perpendicular to $2x + 3y = 12$.

  1. Rearrange the given line: $3y = -2x + 12$, so $y = -\tfrac23 x + 4$ and $m_1 = -\tfrac23$.
  2. The perpendicular slope is $m_2 = -1/m_1 = \tfrac32$.
  3. Point-slope through $(6,1)$: $y - 1 = \tfrac32(x - 6)$.
  4. So $y = \tfrac32 x - 8$, or in general form $3x - 2y = 16$.
  5. Check: $m_1 m_2 = -\tfrac23 \cdot \tfrac32 = -1$ ✓, and $(6,1)$ satisfies $18 - 2 = 16$ ✓. $\blacksquare$

A shortcut worth knowing: to get a perpendicular to $ax+by=c$, swap the coefficients and flip one sign — $bx - ay = c'$ — then fit $c'$ to the point. Here $2,3 \to 3,-2$, giving $3x-2y = 16$ directly.

Your turn, with help. A parallel through a point

Find the line through $(1,4)$ parallel to $3x + y = 5$. Try each step before opening it.

  1. Rearrange the given line: $y = -3x + 5$, so its slope is $-3$.
  2. Decide the slope of the new line

    Parallel lines have equal slopes, so it is also $-3$.

  3. Write the equation through $(1,4)$

    Point-slope: $y - 4 = -3(x - 1)$, so $y = -3x + 7$, or in general form $3x + y = 7$.

  4. Check

    $(1,4)$ satisfies it: $3 + 4 = 7$ ✓. And the left side $3x + y$ is the same as in the given line with a different constant — which is what parallel looks like in general form. $\blacksquare$

Example 4. Where two lines cross

Find the point where the line $x + 2y = 7$ meets the line $3x - y = 7$.

  1. A point lies on both lines exactly when its coordinates satisfy both equations. So this is a system of two equations in two unknowns — Chapter 2, word for word.
  2. Eliminate $y$: multiply the second equation by $2$ to get $6x - 2y = 14$, and add it to the first. The $y$ terms cancel: $7x = 21$, so $x = 3$.
  3. Back-substitute into $x + 2y = 7$: $3 + 2y = 7$, so $y = 2$.
  4. Check in both: $3 + 4 = 7$ ✓ and $9 - 2 = 7$ ✓. The lines cross at $(3,2)$. $\blacksquare$

The trichotomy of Chapter 2 is now a statement about pictures: different slopes, exactly one crossing point; equal slopes, either no common point (parallel lines) or every point (one line, written twice).

Where do the lines $y = x + 1$ and $y = -2x + 7$ meet?

Answer: $(2,3)$

$x + 1 = -2x + 7$ gives $3x = 6$, so $x = 2$, and then $y = 3$. Check in the second line: $-2(2) + 7 = 3$ ✓. When both lines are already solved for $y$, setting the right sides equal is elimination in one step.

Two equations, one line

$2x + 3y = 12$ and $4x + 6y = 24$ describe the same line — multiplying an equation through by a nonzero constant changes nothing. This is precisely the "infinitely many solutions" case from Chapter 2: two equations that are secretly one. Recognizing it saves you from looking for an intersection point that does not exist.

Put these lines in order to find the equation of the line through $(1, 2)$ and $(3, 8)$.

  1. The slope is $\dfrac{8 - 2}{3 - 1} = 3$.
  2. So the line is $y = 3x + b$ for some $b$.
  3. It passes through $(1, 2)$: $2 = 3 + b$, so $b = -1$.
  4. The line is $y = 3x - 1$; check with $(3, 8)$: $9 - 1 = 8$.

Answer: $y = 3x - 1$

Two points fix the slope; one of them then fixes $b$; the other is the check.

Practice

Write points as pairs like (3,-2), slopes as numbers or fractions like -3/2.

What is the slope of the line through $(1,3)$ and $(4,9)$?

Answer: $2$

$m = \dfrac{9-3}{4-1} = \dfrac63 = 2$. Reversing the two points gives $\dfrac{3-9}{1-4} = \dfrac{-6}{-3} = 2$ — the same, as it must be.

With $P = (1,-2)$ and $Q = (9,10)$, what is $P + t(Q-P)$ at $t = \tfrac12$?

Answer: $(5,4)$

$Q - P = (8,12)$, half of it is $(4,6)$, and $(1,-2) + (4,6) = (5,4)$. As $t=\tfrac12$, this is the midpoint — and indeed it is the average of the two endpoints.

A line has slope $4$. What is the slope of any line perpendicular to it?

Answer: $-\tfrac14$

We need $m_2$ with $4m_2 = -1$, so $m_2 = -\tfrac14$ — the negative reciprocal. Note both parts: the reciprocal and the sign change. A slope of $\tfrac14$ would give a line that is merely less steep, not perpendicular.

For which values of $t$ does $P + t(Q-P)$ lie on the segment from $P$ to $Q$?

  • $t \ge 0$.
  • $0 \le t \le 1$.
  • Every real $t$.
  • $t > 1$.

Answer: $0 \le t \le 1$

$t = 0$ gives $P$ and $t = 1$ gives $Q$; in between you are between them. Allowing all $t \ge 0$ gives the ray from $P$ through $Q$, and allowing every real $t$ gives the whole line.

Find the equation of the line through $(2,1)$ and $(4,7)$, in the form $y = mx + b$.

Answer: $y = 3x - 5$

Slope: $m = \dfrac{7-1}{4-2} = 3$. Point-slope through $(2,1)$: $y - 1 = 3(x-2)$, so $y = 3x - 6 + 1 = 3x - 5$.

Check with the unused point: $3(4) - 5 = 7$ ✓.

How are the lines $3x - y = 4$ and $6x - 2y = 1$ related?

  • They are perpendicular.
  • They are the same line.
  • They are parallel and distinct.
  • They meet at exactly one point.

Answer: parallel and distinct

The first is $y = 3x - 4$; the second is $y = 3x - \tfrac12$. Equal slopes, different intercepts — parallel, and never meeting.

Had the second been $6x - 2y = 8$, it would have been the first equation doubled, hence the same line. The left sides matching is not enough; the constants must match too.

Write the equation of the vertical line through $(3,-7)$.

Answer: $x = 3$

Every point on a vertical line has the same $x$-coordinate; $y$ can be anything. So the equation is $x = 3$.

This is why $ax+by=c$ is the better general form: here $a=1$, $b=0$, $c=3$, while $y = mx+b$ cannot express it at all, the slope being undefined.

$P = (1,-1)$ and $Q = (4,5)$. Which point of the ray from $P$ through $Q$ is twice as far from $P$ as $Q$ is?

Answer: $(7,11)$

Distance from $P$ is $t$ times $PQ$, so we want $t = 2$: $$P + 2(Q-P) = (1,-1) + 2(3,6) = (1,-1) + (6,12) = (7,11).$$

Equivalently: $Q$ is the midpoint of $P$ and the answer — which is another way to see that the answer is $2Q - P$.

For which $k$ does the point $(2,k)$ lie on the line $5x - 2y = -2$?

Answer: $k = 6$

Substitute: $5(2) - 2k = -2$, so $10 - 2k = -2$, giving $2k = 12$ and $k = 6$.

"Lies on the line" and "satisfies the equation" are the same statement — that is the whole content of coordinate geometry.

Which of these is not a valid direction vector for the line through $(0,0)$ and $(2,6)$?

  • $(6,2)$
  • $(1,3)$
  • $(-2,-6)$
  • $(4,12)$

Answer: $(6,2)$

The direction is $(2,6)$, and any nonzero multiple of it describes the same line: $(1,3)$ is half of it, $(4,12)$ is double, $(-2,-6)$ is the reverse. But $(6,2)$ is not a multiple — it has slope $\tfrac13$ instead of $3$, and swapping coordinates is not scaling.

Recap

Back to the puzzle

It drops $2$ for every $1$ forward. The first road has direction $(2, 1)$ and slope $\frac12$. A quarter turn sends $(2,1)$ to $(-1, 2)$, which has slope $\frac{2}{-1} = -2$. Perpendicular slopes multiply to $-1$: the reciprocal and a change of sign, because a quarter turn swaps the two coordinates and reverses one of them.

  • $X(t) = P + t(Q-P)$ gives the segment for $0 \le t \le 1$, the ray for $t \ge 0$, and the line for all real $t$.
  • The parameter measures fractional distance: $PX = t\cdot PQ$, which is what makes ratio problems easy.
  • Slope $m = \Delta y/\Delta x$ is a property of the line, not of the points used to compute it.
  • Parallel means equal slopes; perpendicular means $m_1m_2 = -1$, which comes from rotating a direction vector by $90°$.
  • $ax + by = c$ covers every line including the vertical ones, which $y = mx+b$ cannot reach.