Skip to content
Family Table Math
Auto

Equations of Lines in 3-Space

In 2-space, a line could be described by a vector equation or by one scalar equation. In 3-space, the vector equation still works perfectly, but a single scalar equation no longer describes a line at all. This page shows how to write lines in 3-space, and how to describe one using two planes instead.

Why there’s no scalar equation of a line in 3-space

Section titled “Why there’s no scalar equation of a line in 3-space”

In 2-space, the scalar equation Ax+By+C=0Ax + By + C = 0 works because there is only one direction perpendicular to a line (up to scalar multiples), so the normal [A,B][A, B] pins down the line’s direction.

In 3-space, a whole flat fan of directions is perpendicular to any given vector. A single equation Ax+By+Cz+D=0Ax + By + Cz + D = 0 has solutions forming a plane (see linear equations in 2-space and 3-space), not a line. So a line in 3-space needs either a vector (or parametric) equation, or two scalar equations, one for each of two planes that meet in the line.

Exactly as in 2-space, a line through P0(x0,y0,z0)P_0(x_0, y_0, z_0) with direction vector m⃗=[m1,m2,m3]\vec{m} = [m_1, m_2, m_3] is

r⃗=r⃗0+tm⃗,t∈R\vec{r} = \vec{r}_0 + t\vec{m}, \qquad t \in \mathbb{R}

where r⃗=[x,y,z]\vec{r} = [x, y, z] and r⃗0=[x0,y0,z0]\vec{r}_0 = [x_0, y_0, z_0]. In parametric form:

x=x0+tm1,y=y0+tm2,z=z0+tm3x = x_0 + t m_1, \qquad y = y_0 + t m_2, \qquad z = z_0 + t m_3
A line in 3-space through P0 with direction vector m x y z P₀ P O r₀ r m r = r₀ + tm
Every point PP on the line is reached by going to P0P_0 (that’s r⃗0\vec{r}_0), then tt copies of m⃗\vec{m}.

If you know two points AA and BB on the line, use m⃗=AB→\vec{m} = \overrightarrow{AB} (or any non-zero multiple of it, to keep the numbers small) and either point for r⃗0\vec{r}_0.

A zero component in m⃗\vec{m} means that coordinate never changes. For example, the line r⃗=[3,−1,2]+t[2,0,−5]\vec{r} = [3, -1, 2] + t[2, 0, -5] has y=−1y = -1 for every point, so it lies in the plane y=−1y = -1.

If none of m1,m2,m3m_1, m_2, m_3 is zero, solve each parametric equation for tt and set the results equal:

x−x0m1=y−y0m2=z−z0m3\frac{x - x_0}{m_1} = \frac{y - y_0}{m_2} = \frac{z - z_0}{m_3}

These are the symmetric equations of the line. You’ll see them in some textbooks; they’re really two scalar equations in disguise (the first fraction equals the second, and the second equals the third).

Substitute the point into the parametric equations and solve each one for tt. The point is on the line only if all three give the same tt.

To describe a line with scalar equations, find two planes that contain it:

  • From parametric to planes: solve one parametric equation for tt and substitute into the other two. Each result is the equation of a plane containing the line.
  • From planes to parametric: solve the two plane equations together, letting one variable be the parameter tt (as in linear equations in 2-space and 3-space).

A quick check for the second direction: the line lies in both planes, so its direction is perpendicular to both normals. The cross product n⃗1×n⃗2\vec{n}_1 \times \vec{n}_2 is a direction vector for the line.

Write vector and parametric equations of the line through P(3,−1,2)P(3, -1, 2) with direction vector [2,0,−5][2, 0, -5], and find the point where t=1t = 1.

Solution.

r⃗=[3,−1,2]+t[2,0,−5],t∈R\vec{r} = [3, -1, 2] + t[2, 0, -5], \quad t \in \mathbb{R} x=3+2t,y=−1,z=2−5tx = 3 + 2t, \qquad y = -1, \qquad z = 2 - 5t

For t=1t = 1: (5,−1,−3)(5, -1, -3). Notice yy is −1-1 for every point, because the direction vector has no yy-component.

Example 2: Through two points, and testing points

Section titled “Example 2: Through two points, and testing points”

Find a vector equation of the line through A(1,4,−2)A(1, 4, -2) and B(3,1,2)B(3, 1, 2). Then decide whether C(7,−5,10)C(7, -5, 10) and D(5,−2,5)D(5, -2, 5) are on the line.

Solution. AB→=[3−1, 1−4, 2−(−2)]=[2,−3,4]\overrightarrow{AB} = [3 - 1,\ 1 - 4,\ 2 - (-2)] = [2, -3, 4], so

r⃗=[1,4,−2]+t[2,−3,4],t∈R\vec{r} = [1, 4, -2] + t[2, -3, 4], \quad t \in \mathbb{R}

For C(7,−5,10)C(7, -5, 10):

1+2t=7⇒t=3,4−3t=−5⇒t=3,−2+4t=10⇒t=31 + 2t = 7 \Rightarrow t = 3, \qquad 4 - 3t = -5 \Rightarrow t = 3, \qquad -2 + 4t = 10 \Rightarrow t = 3

All three agree, so CC is on the line.

For D(5,−2,5)D(5, -2, 5): 1+2t=51 + 2t = 5 gives t=2t = 2, and 4−3(2)=−24 - 3(2) = -2 ✓, but −2+4(2)=6≠5-2 + 4(2) = 6 \ne 5. DD is not on the line, even though two of the coordinates matched.

Example 3: From parametric equations to two planes

Section titled “Example 3: From parametric equations to two planes”

Write the line x=2+tx = 2 + t, y=−1+3ty = -1 + 3t, z=4−2tz = 4 - 2t as the intersection of two planes.

Solution. From the first equation, t=x−2t = x - 2. Substitute into the other two:

y=−1+3(x−2)=3x−7⇒3x−y−7=0z=4−2(x−2)=8−2x⇒2x+z−8=0\begin{aligned} y &= -1 + 3(x - 2) = 3x - 7 && \Rightarrow\quad 3x - y - 7 = 0 \\ z &= 4 - 2(x - 2) = 8 - 2x && \Rightarrow\quad 2x + z - 8 = 0 \end{aligned}

The line is the intersection of the planes 3x−y−7=03x - y - 7 = 0 and 2x+z−8=02x + z - 8 = 0.

Check with t=1t = 1, the point (3,2,2)(3, 2, 2): 9−2−7=09 - 2 - 7 = 0 ✓ and 6+2−8=06 + 2 - 8 = 0 ✓.

Example 4: From two planes to a vector equation

Section titled “Example 4: From two planes to a vector equation”

The line LL is the intersection of the planes x−y+z=1x - y + z = 1 and 2x+y−z=52x + y - z = 5. Find a vector equation of LL.

Solution. Add the equations to eliminate both yy and zz:

3x=6⇒x=23x = 6 \quad\Rightarrow\quad x = 2

Then the first equation gives 2−y+z=12 - y + z = 1, so z=y−1z = y - 1. Let y=ty = t:

x=2,y=t,z=−1+tx = 2, \qquad y = t, \qquad z = -1 + t r⃗=[2,0,−1]+t[0,1,1],t∈R\vec{r} = [2, 0, -1] + t[0, 1, 1], \quad t \in \mathbb{R}

Check with the cross product: [1,−1,1]×[2,1,−1]=[0,3,3]=3[0,1,1][1, -1, 1] \times [2, 1, -1] = [0, 3, 3] = 3[0, 1, 1] ✓. And the point (2,0,−1)(2, 0, -1) satisfies both planes: 2−0−1=12 - 0 - 1 = 1 ✓ and 4+0+1=54 + 0 + 1 = 5 ✓.

Writing a single scalar equation for a line in 3-space. An equation like 2x−y+3z=42x - y + 3z = 4 is a plane. A line in 3-space needs a vector or parametric equation, or two scalar equations.

Testing only two coordinates. In Example 2, point DD matched the line in xx and yy but not in zz. All three components must give the same tt.

Using a position vector as the direction. The direction vector through AA and BB is AB→=b⃗−a⃗\overrightarrow{AB} = \vec{b} - \vec{a}, not a⃗\vec{a} or b⃗\vec{b} themselves.

Dividing by zero in symmetric equations. If a direction component is 00, that coordinate is constant. Write it separately (for example, y=−1y = -1) instead of putting a 00 in a denominator.

Using the same parameter for two different lines. When you work with two lines at once, give them different parameters, like tt and ss. Otherwise you’re forcing both lines to be at the “same time”, which is a different question.

1. (Warm-up) Write vector and parametric equations of the line through (0,5,−3)(0, 5, -3) with direction vector [1,−2,4][1, -2, 4]. Find the point where t=−1t = -1.

Solutionr⃗=[0,5,−3]+t[1,−2,4]x=t,y=5−2t,z=−3+4t\vec{r} = [0, 5, -3] + t[1, -2, 4] \qquad x = t, \quad y = 5 - 2t, \quad z = -3 + 4t

For t=−1t = -1: (−1, 5+2, −3−4)=(−1,7,−7)(-1,\ 5 + 2,\ -3 - 4) = (-1, 7, -7).

2. (Warm-up) State a point on the line and a direction vector: x=4−tx = 4 - t, y=2ty = 2t, z=−3+5tz = -3 + 5t.

Solution

At t=0t = 0 the point is (4,0,−3)(4, 0, -3). The coefficients of tt give the direction vector [−1,2,5][-1, 2, 5].

3. (Warm-up) Is the point (6,−4,7)(6, -4, 7) on the line r⃗=[2,0,−1]+t[2,−2,4]\vec{r} = [2, 0, -1] + t[2, -2, 4]?

Solution

2+2t=62 + 2t = 6 gives t=2t = 2. Then y=0−2(2)=−4y = 0 - 2(2) = -4 ✓ and z=−1+4(2)=7z = -1 + 4(2) = 7 ✓.

Yes, the point is on the line (at t=2t = 2).

4. (Core) Find vector and symmetric equations of the line through A(−2,3,1)A(-2, 3, 1) and B(4,0,7)B(4, 0, 7).

Solution

AB→=[6,−3,6]=3[2,−1,2]\overrightarrow{AB} = [6, -3, 6] = 3[2, -1, 2], so use m⃗=[2,−1,2]\vec{m} = [2, -1, 2]:

r⃗=[−2,3,1]+t[2,−1,2]\vec{r} = [-2, 3, 1] + t[2, -1, 2]

Symmetric equations:

x+22=y−3−1=z−12\frac{x + 2}{2} = \frac{y - 3}{-1} = \frac{z - 1}{2}

Check BB: t=3t = 3 gives (−2+6, 3−3, 1+6)=(4,0,7)(-2 + 6,\ 3 - 3,\ 1 + 6) = (4, 0, 7) ✓.

5. (Core) Find a vector equation of the line through (1,−1,4)(1, -1, 4) parallel to the line r⃗=[0,2,5]+s[3,1,−2]\vec{r} = [0, 2, 5] + s[3, 1, -2]. Are the two lines the same?

Solution

Parallel lines share a direction vector:

r⃗=[1,−1,4]+t[3,1,−2]\vec{r} = [1, -1, 4] + t[3, 1, -2]

Is (1,−1,4)(1, -1, 4) on the given line? 3s=13s = 1 gives s=13s = \dfrac{1}{3}, but then y=2+13≠−1y = 2 + \dfrac{1}{3} \ne -1. So the lines are parallel and distinct.

6. (Core)

  • (a) Write a vector equation of the line through (2,−3,5)(2, -3, 5) parallel to the zz-axis.
  • (b) Explain why the equation 2x−y=72x - y = 7 does not describe a single line in 3-space.
Solution

(a) The zz-axis has direction k⃗=[0,0,1]\vec{k} = [0, 0, 1]:

r⃗=[2,−3,5]+t[0,0,1]\vec{r} = [2, -3, 5] + t[0, 0, 1]

(b) In 3-space, zz is free in 2x−y=72x - y = 7: every point (x,y,z)(x, y, z) with 2x−y=72x - y = 7 works, for any zz. Those points form a plane (parallel to the zz-axis), not a line.

7. (Core) Represent the line through (3,1,−2)(3, 1, -2) and (1,1,2)(1, 1, 2) with a vector equation, with parametric equations, and as the intersection of two planes.

Solution

Direction: [1−3, 1−1, 2−(−2)]=[−2,0,4]=2[−1,0,2][1 - 3,\ 1 - 1,\ 2 - (-2)] = [-2, 0, 4] = 2[-1, 0, 2].

r⃗=[3,1,−2]+t[−1,0,2]x=3−t,y=1,z=−2+2t\vec{r} = [3, 1, -2] + t[-1, 0, 2] \qquad x = 3 - t, \quad y = 1, \quad z = -2 + 2t

For the planes: y=1y = 1 is already one. From x=3−tx = 3 - t, t=3−xt = 3 - x, so z=−2+2(3−x)=4−2xz = -2 + 2(3 - x) = 4 - 2x, which is 2x+z−4=02x + z - 4 = 0.

The line is the intersection of y=1y = 1 and 2x+z−4=02x + z - 4 = 0.

Check (1,1,2)(1, 1, 2): y=1y = 1 ✓ and 2+2−4=02 + 2 - 4 = 0 ✓.

8. (Challenge) Where does the line r⃗=[1,2,−3]+t[2,−1,3]\vec{r} = [1, 2, -3] + t[2, -1, 3] cross the xyxy-plane? Where does it cross the xzxz-plane?

Solution

The xyxy-plane is z=0z = 0: −3+3t=0-3 + 3t = 0 gives t=1t = 1, so the point is (3,1,0)(3, 1, 0).

The xzxz-plane is y=0y = 0: 2−t=02 - t = 0 gives t=2t = 2, so the point is (5,0,3)(5, 0, 3).

9. (Challenge) Find a vector equation of the line of intersection of the planes x+2y−z=4x + 2y - z = 4 and 3x−y+z=23x - y + z = 2, using the cross product for the direction.

Solution

Direction: the line is perpendicular to both normals.

[1,2,−1]×[3,−1,1]=[2(1)−(−1)(−1), (−1)(3)−1(1), 1(−1)−2(3)]=[1,−4,−7][1, 2, -1] \times [3, -1, 1] = [2(1) - (-1)(-1),\ (-1)(3) - 1(1),\ 1(-1) - 2(3)] = [1, -4, -7]

For a point, set x=0x = 0: 2y−z=42y - z = 4 and −y+z=2-y + z = 2. Adding gives y=6y = 6, then z=8z = 8. The point is (0,6,8)(0, 6, 8).

r⃗=[0,6,8]+t[1,−4,−7]\vec{r} = [0, 6, 8] + t[1, -4, -7]

Check with t=1t = 1, the point (1,2,1)(1, 2, 1): 1+4−1=41 + 4 - 1 = 4 ✓ and 3−2+1=23 - 2 + 1 = 2 ✓.