Equations of Lines in 3D

Equations of lines in 3D describe the line through a point (x₀, y₀, z₀) in the direction of a vector v = ⟨a, b, c⟩. The vector equation is r = r₀ + tv. The parametric equations are x = x₀ + at, y = y₀ + bt, z = z₀ + ct, and the symmetric equations are (x − x₀)/a = (y − y₀)/b = (z − z₀)/c.

Before this lesson: Vectors in 3D, Parametric Equations and Point-Slope Form

How a line in space is built

In the plane, a slope pins down a line’s direction. In space, one number isn’t enough, so a direction vector v does the job. A line is then “start at a point, and move any multiple of v.”

The parameter t controls how far you move. At t = 0 you are at the starting point. At t = 1 you have moved one copy of v, at t = −2 you have moved two copies backward, and so on. Every real value of t gives one point, and together they fill the whole line.

Three-dimensional axes with the x-axis toward the viewer, the y-axis to the right and the z-axis up. A straight line passes through the points A(1, 2, −1) and B(4, 0, 5), marked with dots and labeled t = 0 and t = 1. An orange arrow from A to B shows the direction vector v = ⟨3, −2, 6⟩.
In Example 2, the line starts at A when t = 0 and reaches B when t = 1, moving along v = ⟨3, −2, 6⟩.

Two lines in space don’t have to meet even if they aren’t parallel. Lines that are not parallel and never intersect are called skew lines.

Equations of a line in 3D

\mathbf{r}(t) = \langle x_0, y_0, z_0 \rangle + t \langle a, b, c \rangle \quad \text{(vector equation)}
x = x_0 + at, \quad y = y_0 + bt, \quad z = z_0 + ct \quad \text{(parametric equations)}
\dfrac{x - x_0}{a} = \dfrac{y - y_0}{b} = \dfrac{z - z_0}{c} \quad \text{(symmetric equations)}
  • (x₀, y₀, z₀) is any point on the line, and ⟨a, b, c⟩ is any nonzero direction vector.
  • The symmetric equations come from solving each parametric equation for t. If a component is 0, say a = 0, write x = x₀ separately and use the other two fractions.
  • For a line through two points P and Q, use the direction vector Q − P.
  • Two lines are parallel when their direction vectors are scalar multiples of each other.

Equations of lines in 3D examples

Example 1: Vector, parametric and symmetric equations

Write all three forms of the line through P(2, −1, 3) with direction v = ⟨4, 1, −2⟩.

\mathbf{r}(t) = \langle 2, -1, 3 \rangle + t \langle 4, 1, -2 \rangle

Vector form: start at P and add t times v.

x = 2 + 4t

x-coordinate of P plus t times the x-component of v.

y = -1 + t

y-coordinate of P plus t times 1.

z = 3 - 2t

z-coordinate of P plus t times −2.

\dfrac{x - 2}{4} = \dfrac{y + 1}{1} = \dfrac{z - 3}{-2}

Solve each equation for t and set the results equal.

Answer: r(t) = ⟨2, −1, 3⟩ + t⟨4, 1, −2⟩; x = 2 + 4t, y = −1 + t, z = 3 − 2t; and (x − 2)/4 = y + 1 = (z − 3)/(−2).

Example 2: Line through two points

Find parametric equations of the line through A(1, 2, −1) and B(4, 0, 5).

\mathbf{v} = \langle 4 - 1, \; 0 - 2, \; 5 - (-1) \rangle

Subtract A from B to get a direction vector.

= \langle 3, -2, 6 \rangle

Simplify each component.

x = 1 + 3t, \quad y = 2 - 2t, \quad z = -1 + 6t

Start at A and use v.

1 + 3(1) = 4, \quad 2 - 2(1) = 0, \quad -1 + 6(1) = 5

Check: t = 1 should give B(4, 0, 5).

Answer: x = 1 + 3t, y = 2 − 2t, z = −1 + 6t. Starting at B or using −v also gives a correct answer for the same line.

Example 3: Where a line crosses a coordinate plane

Where does the line from Example 2 cross the xy-plane?

-1 + 6t = 0

The xy-plane is z = 0, so set z equal to 0.

6t = 1

Add 1 to both sides.

t = \dfrac{1}{6}

Divide both sides by 6.

x = 1 + 3 \cdot \dfrac{1}{6} = 1 + \dfrac{1}{2} = \dfrac{3}{2}

Substitute t into x (see adding and subtracting fractions).

y = 2 - 2 \cdot \dfrac{1}{6} = 2 - \dfrac{1}{3} = \dfrac{5}{3}

Substitute t into y.

Answer: the line crosses the xy-plane at (3/2, 5/3, 0).

Example 4: Do two lines intersect?

L₁: x = 1 + t, y = 2 − t, z = 3 + 2t. L₂: x = 2 + s, y = −2 + 2s, z = 8 − s. Decide whether the lines are parallel, intersect or are skew.

The direction vectors ⟨1, −1, 2⟩ and ⟨1, 2, −1⟩ are not multiples of each other, so the lines are not parallel. Use different parameters, t and s, and set the coordinates equal.

1 + t = 2 + s

Set the x-coordinates equal.

2 - t = -2 + 2s

Set the y-coordinates equal.

3 = 3s

Add the two equations: the t terms cancel (see elimination method).

s = 1

Divide both sides by 3.

1 + t = 3

Substitute s = 1 into the x-equation.

t = 2

Subtract 1 from both sides.

3 + 2(2) = 7, \quad 8 - 1 = 7

Check the z-coordinates: both are 7.

(1 + 2, \; 2 - 2, \; 7) = (3, 0, 7)

Substitute t = 2 into L₁.

Answer: the lines intersect at (3, 0, 7). If the z-check had failed, the lines would be skew.

Example 5: A drone’s flight path (word problem)

A drone takes off from a platform at (0, 0, 10), in meters, and flies in a straight line with velocity ⟨3, 4, 1⟩ meters per second. When does it reach a height of 25 m, where is it then, and how far has it flown?

\mathbf{r}(t) = \langle 0, 0, 10 \rangle + t \langle 3, 4, 1 \rangle = \langle 3t, 4t, 10 + t \rangle

Write the line with t in seconds.

10 + t = 25

Set the height equal to 25.

t = 15

Subtract 10 from both sides.

\langle 3 \cdot 15, \; 4 \cdot 15, \; 10 + 15 \rangle = \langle 45, 60, 25 \rangle

Substitute t = 15.

\sqrt{3^2 + 4^2 + 1^2} = \sqrt{26}

Find the speed, the length of the velocity vector.

15\sqrt{26} \approx 76.49

Multiply speed by time.

Answer: after 15 seconds the drone is at (45, 60, 25), and it has flown about 76.49 m.

Common mistakes

MistakeExample of the errorFix
Using a point as the directionLine through A(1, 2, −1) and B(4, 0, 5) with direction ⟨4, 0, 5⟩The direction is B − A = ⟨3, −2, 6⟩.
Sign slips in symmetric formy = −1 + t written as (y − 1)/1y − (−1) = y + 1, so write (y + 1)/1.
Dividing by a zero component(x − 2)/0 = (y − 1)/3If a = 0, write x = 2 and keep the other two fractions.
Using one parameter for both linesSetting 1 + t = 2 + t for L₁ and L₂Give each line its own parameter, like t and s.
Assuming nonparallel lines meet“Not parallel, so they intersect”In 3D, check all three coordinates; the lines may be skew.

Related methods

Distance from a point to a line

The distance from a point Q to the line through P with direction v is d = ‖PQ × v‖ ÷ ‖v‖, using the cross product. You can also subtract the projection of PQ onto v, as in vector projections.

Lines in the plane

Drop the z-coordinate and the same ideas give parametric lines in the plane. There, the symmetric form (x − x₀)/a = (y − y₀)/b rearranges to point-slope form with slope b/a.

Practice problems

  1. Write parametric equations of the line through (0, 3, −2) with direction ⟨5, −1, 2⟩.
  2. Write symmetric equations for the line in Problem 1.
  3. Write parametric equations of the line through (2, 0, 1) and (5, 4, −1).
  4. Is the point (8, 8, −3) on the line in Problem 3?
  5. Where does the line x = 1 + 2t, y = −3 + t, z = 4 − t cross the xz-plane?
  6. Write parametric equations of the line through (1, −1, 2) parallel to x = 3 − t, y = 2t, z = 5 + 4t.
  7. Find a point and a direction vector for the line (x − 4)/3 = (y + 1)/(−2) = z/5.
  8. Are the lines x = 1 + 2t, y = −4t, z = 3 + 6t and x = 5 − s, y = 1 + 2s, z = −s parallel? Are they the same line?
  9. Decide whether x = 1 + t, y = 1 + 2t, z = t and x = 2 − s, y = s, z = 3 + s intersect or are skew.
  10. A balloon at (100, 50, 200), in meters, drifts with velocity ⟨2, −1, −0.5⟩ m/s. When and where does it reach the ground (z = 0)?
Show answers

1.

x = 0 + 5t = 5t

Start at x = 0 and add 5t.

y = 3 - t

Start at y = 3 and add −1 · t.

z = -2 + 2t

Start at z = −2 and add 2t.

Answer: x = 5t, y = 3 − t, z = −2 + 2t

2.

\dfrac{x}{5} = \dfrac{y - 3}{-1} = \dfrac{z + 2}{2}

Solve each equation for t and set them equal.

Answer: x/5 = (y − 3)/(−1) = (z + 2)/2

3.

\langle 5 - 2, \; 4 - 0, \; -1 - 1 \rangle = \langle 3, 4, -2 \rangle

Subtract the first point from the second.

x = 2 + 3t, \quad y = 4t, \quad z = 1 - 2t

Start at (2, 0, 1).

Answer: x = 2 + 3t, y = 4t, z = 1 − 2t

4.

2 + 3t = 8

Match the x-coordinate.

3t = 6

Subtract 2 from both sides.

t = 2

Divide both sides by 3.

4(2) = 8

Check y: it matches.

1 - 2(2) = -3

Check z: it matches.

Answer: yes, at t = 2.

5.

-3 + t = 0

The xz-plane is y = 0.

t = 3

Add 3 to both sides.

(1 + 2 \cdot 3, \; 0, \; 4 - 3) = (7, 0, 1)

Substitute t = 3.

Answer: (7, 0, 1)

6.

\langle -1, 2, 4 \rangle

Read the direction from the coefficients of t.

x = 1 - t, \quad y = -1 + 2t, \quad z = 2 + 4t

Start at (1, −1, 2) with the same direction.

Answer: x = 1 − t, y = −1 + 2t, z = 2 + 4t

7.

(4, -1, 0)

Read the point from the numerators: z/5 means z − 0.

\langle 3, -2, 5 \rangle

Read the direction from the denominators.

Answer: point (4, −1, 0), direction ⟨3, −2, 5⟩

8.

-2 \langle -1, 2, -1 \rangle = \langle 2, -4, 2 \rangle

Multiply the second direction by −2 to match the first two components of ⟨2, −4, 6⟩.

2 \ne 6

Compare the third components: they differ.

Answer: no. The directions are not multiples of each other, so the lines are not parallel (and not the same line).

9.

1 + t = 2 - s

Set the x-coordinates equal.

1 + 2t = s

Set the y-coordinates equal.

1 + t = 2 - (1 + 2t)

Substitute s = 1 + 2t into the x-equation.

1 + t = 1 - 2t

Simplify the right side.

1 + 3t = 1

Add 2t to both sides.

3t = 0

Subtract 1 from both sides.

t = 0

Divide both sides by 3.

s = 1 + 2(0) = 1

Find s.

0 \ne 3 + 1

Check z: L₁ gives z = 0, L₂ gives z = 4.

Answer: the directions ⟨1, 2, 1⟩ and ⟨−1, 1, 1⟩ aren’t parallel and the z-coordinates don’t match, so the lines are skew.

10.

200 - 0.5t = 0

Set the height equal to 0.

0.5t = 200

Add 0.5t to both sides.

t = 400

Divide both sides by 0.5.

(100 + 2 \cdot 400, \; 50 - 400, \; 0) = (900, -350, 0)

Substitute t = 400.

Answer: after 400 s, at (900, −350, 0)

Equations of lines in 3D FAQ

How do you find the equation of a line in 3D?

You need one point on the line and a direction vector. If you have two points, subtract them to get the direction. Then write x = x₀ + at, y = y₀ + bt and z = z₀ + ct.

What are the symmetric equations of a line?

They are (x − x₀)/a = (y − y₀)/b = (z − z₀)/c, found by solving each parametric equation for t. They describe the same line without a parameter.

How do you know if two lines in 3D are skew?

Check that the direction vectors are not parallel. Then set the coordinates equal with separate parameters. If no values of the parameters satisfy all three equations, the lines are skew.

What if a component of the direction vector is zero?

Then that coordinate never changes. For direction ⟨3, 0, 2⟩ through (1, 5, 0), write (x − 1)/3 = z/2 and y = 5.

Summary

  • A line needs a point (x₀, y₀, z₀) and a direction vector ⟨a, b, c⟩.
  • Vector form: r(t) = r₀ + tv. Parametric form: x = x₀ + at, y = y₀ + bt, z = z₀ + ct.
  • Symmetric form: (x − x₀)/a = (y − y₀)/b = (z − z₀)/c.
  • For two points, use their difference as the direction.
  • Lines in space can be parallel, intersecting or skew; use separate parameters to test.

Previous lesson: Vector Projections

Next lesson: Equation of a Plane

Back to the Calculus 3 Index