Linear Algebra, Interactive EditionXYZ Homework Edition

⇩ Download ▾

0.9 Lines in Space

In the plane a line is y=mx+by = mx + b: a slope and an intercept. In space there is no slope — a line can lean in two independent ways at once — and no single equation of the form z=z = \dots describes a line, because such an equation describes a whole plane. What a line has, in any dimension, is a point on it and a direction along it. Start at the point P0P_0, walk any multiple of the direction vector 𝐝\mathbf{d}, and you trace the line:

P ( t ) = P 0 + t 𝐝 P(t) = P_0 + t\,\mathbf{d}

The number tt is a parameter: each value of tt names one point of the line, t=0t = 0 names P0P_0 itself, and negative values run backward through P0P_0 to the other side. Adding a point and a vector means adding coordinates to components, and the result is a point, so the equation splits into one parametric equation per coordinate.

The figure takes P0=(1,1,0)P_0 = (1, -1, 0) and 𝐝=(1,2,1)\mathbf{d} = (1, 2, 1), and puts the parameter on a slider.

A dashed gray line crossing the scene, passing through a red point P0 at (1, -1, 0) on the floor and rising toward the back. A thick shaded arrow from P0 to (2, 1, 1) is the direction vector d = (1, 2, 1), drawn with its tail at P0. A slider s, starting at 1, puts a small bright ball on the line at P(s) = (1 + s, -1 + 2s, s), which at the starting value is exactly the tip of that arrow, and joins the ball to P0 by a thin rod s copies of d long. Two more objects start at the origin: a thin arrow to P0, and a thinner rod to the ball, so the position of P(s) is visibly the origin-to-P0 arrow followed by the rod along the line. Dragging s slides the ball along the dashed line, out past the tip of the direction arrow for s above 1 and back through P0 to the far side for negative s, with the rod from the origin swinging to follow it. Two hidden points can be revealed: a green point Q at (4, 5, 3), which the ball reaches exactly at s = 3, and a purple point R at (2, 0, 2), which the ball passes near but never touches.Explore in 3D (opens in a new tab)
The line through P0=(1,1,0)P_0 = (1, -1, 0) with direction 𝐝=(1,2,1)\mathbf{d} = (1, 2, 1), drawn dashed, and the point P(s)=P0+s𝐝P(s) = P_0 + s\,\mathbf{d} marked by a ball on a slider ss. The thick arrow is 𝐝\mathbf{d} with its tail at P0P_0; the thin rod from P0P_0 to the ball is ss copies of it. From the origin, a thin arrow reaches P0P_0 and a thinner rod reaches the ball. Two hidden points, QQ and RR, are on and off the line.

Explore the figure

  1. At the starting value s=1s = 1 the ball sits exactly at the tip of 𝐝\mathbf{d}: P(1)=(1+1,1+2,0+1)=(2,1,1)P(1) = (1 + 1, \; -1 + 2, \; 0 + 1) = (2, 1, 1). One copy of the direction vector, laid from P0P_0.
  2. Drag ss to 33 and reveal the hidden point Q=(4,5,3)Q = (4, 5, 3). The ball lands exactly on it: Q=P0+3𝐝Q = P_0 + 3\mathbf{d}, so QQ is on the line, three direction vectors along from P0P_0.
  3. Drag ss to 1-1. The ball has passed back through P0P_0 to (0,3,1)(0, -3, -1): the line does not stop at P0P_0, and negative parameters reach the other half of it.
  4. Reveal the hidden point R=(2,0,2)R = (2, 0, 2) and try to reach it with the slider. Its first coordinate would need s=1s = 1, but P(1)=(2,1,1)P(1) = (2, 1, 1) is not RR. No value of ss works, so RR is not on the line — it only looks close from some viewpoints.
  5. Watch the rod from the origin as you sweep ss. It always ends at the ball, and it is always the arrow to P0P_0 followed by the rod along the line: the position of P(s)P(s), read as a vector from the origin, is 𝐩0+s𝐝\mathbf{p}_0 + s\,\mathbf{d}. That is the vector equation of the line, and it is the parametric equations written as one line.

Reading the equations

With P0=(x0,y0,z0)P_0 = (x_0, y_0, z_0) and 𝐝=(a,b,c)\mathbf{d} = (a, b, c), the vector equation P(t)=P0+t𝐝P(t) = P_0 + t\,\mathbf{d} says, coordinate by coordinate,

x = x 0 + a t , y = y 0 + b t , z = z 0 + c t x = x_0 + a t, \qquad y = y_0 + b t, \qquad z = z_0 + c t

The coefficients of tt are the components of the direction, and the constants are the coordinates of the point at t=0t = 0. In n\mathbb{R}^n there are nn such equations; in the plane, two — and eliminating tt between them recovers y=mx+by = mx + b with slope m=b/am = b/a, so nothing has been lost.

A line has many descriptions. Any other point of the line will serve as P0P_0, and any nonzero multiple of 𝐝\mathbf{d} will serve as the direction: the point (2,1,1)(2, 1, 1) with direction (2,4,2)(2, 4, 2) describes the figure's line as well as (1,1,0)(1, -1, 0) with (1,2,1)(1, 2, 1) does, only with the parameter running twice as fast and starting one step along. Two points also determine the line through them: use one as P0P_0 and their difference, head minus tail, as 𝐝\mathbf{d}.

Whether a point lies on a line is a question about a single parameter value: does one tt satisfy all the coordinate equations at once? That is a small system of equations in the one unknown tt, consistent when the point is on the line and inconsistent when it is not — a preview of Chapter 1, where systems like this are the subject.

[130000]\begin{bmatrix}1 & 3 \\ 0 & 0 \\ 0 & 0\end{bmatrix}
Q is on the figure's line ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text Q is on the figure's line, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The three coordinate equations for reaching Q=(4,5,3)Q = (4, 5, 3) from P0=(1,1,0)P_0 = (1, -1, 0)s=3s = 3, 2s=62s = 6, s=3s = 3 — as an augmented matrix with the direction's components on the left and the displacement to QQ on the right, reduced by a computer algebra system. One pivot, one solution: s=3s = 3, and the two zero rows say the other two equations agreed with it.

[100100]\begin{bmatrix}1 & 0 \\ 0 & 1 \\ 0 & 0\end{bmatrix}
R is not ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text R is not, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The same system for R=(2,0,2)R = (2, 0, 2), whose displacement from P0P_0 is (1,1,2)(1, 1, 2). The reduced form has a pivot in the right-hand column — the row that reads 0=10 = 1 — so the three equations contradict one another and no parameter value reaches RR.

11
S is on the worked example's line ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text S is on the worked example's line, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The direction (1,2,1)(1, -2, 1) and the displacement (3,6,3)(3, -6, 3) to SS, stacked as rows. Rank 11 means the displacement is a multiple of the direction — the same test as Section 0.4's parallel vectors — so SS lies on the line.

22
T is not ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text T is not, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

For TT the displacement is (1,2,2)(1, -2, 2), and the two rows have rank 22: not parallel, so TT is off the line.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Its chapter sequence is aligned to Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL); this work is original, copies nothing from it, and is not affiliated with or endorsed by its authors. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.