Math Lab
Home/Class XII/Ch 11/Equation of a line in 3D

Equation of a line in 3D

A line in three-dimensional space is determined by one point and one direction. Both data come together in the standard parametric / vector form.

Vector form

A line through the point with position vector a\vec a in the direction of the (non-zero) vector d\vec d consists of all points r=a+td,tR.\vec r = \vec a + t \vec d, \qquad t \in \mathbb R. The parameter tt traces the line: at t=0t = 0 you're at a\vec a; at t=1t = 1 you're at a+d\vec a + \vec d, etc.

The same line is described by many such equations. Replacing a\vec a by any other point a\vec a' on the line, or scaling d\vec d by any non-zero constant, gives an equally valid description.

Cartesian form

If a=(x0,y0,z0)\vec a = (x_0, y_0, z_0) and d=(d1,d2,d3)\vec d = (d_1, d_2, d_3), then writing r=(x,y,z)\vec r = (x, y, z): x=x0+td1,y=y0+td2,z=z0+td3.x = x_0 + t d_1, \quad y = y_0 + t d_2, \quad z = z_0 + t d_3. Eliminate tt: xx0d1=yy0d2=zz0d3.\frac{x - x_0}{d_1} = \frac{y - y_0}{d_2} = \frac{z - z_0}{d_3}. This is the symmetric or Cartesian form. It is valid only when no di=0d_i = 0; when some component of d\vec d vanishes, you write that coordinate as a constant equation. E.g., if d3=0d_3 = 0: xx0d1=yy0d2,z=z0\dfrac{x - x_0}{d_1} = \dfrac{y - y_0}{d_2}, z = z_0.

Line through two given points

A line through A=(x1,y1,z1)A = (x_1, y_1, z_1) and B=(x2,y2,z2)B = (x_2, y_2, z_2) has direction AB=(x2x1,y2y1,z2z1)\vec{AB} = (x_2 - x_1, y_2 - y_1, z_2 - z_1). So r=a+t(ba),\vec r = \vec a + t(\vec b - \vec a), or in Cartesian form xx1x2x1=yy1y2y1=zz1z2z1.\frac{x - x_1}{x_2 - x_1} = \frac{y - y_1}{y_2 - y_1} = \frac{z - z_1}{z_2 - z_1}. (With the same caveat about zero denominators.)

Converting between forms

Vector \to Cartesian: read off the point (x0,y0,z0)(x_0, y_0, z_0) and the direction (d1,d2,d3)(d_1, d_2, d_3), then write the symmetric form.

Cartesian \to Vector: from xx0d1=yy0d2=zz0d3\dfrac{x - x_0}{d_1} = \dfrac{y - y_0}{d_2} = \dfrac{z - z_0}{d_3}, the line is r=(x0,y0,z0)+t(d1,d2,d3)\vec r = (x_0, y_0, z_0) + t(d_1, d_2, d_3).

When is a given point on a line?

Substitute. In vector form: solve p=a+td\vec p = \vec a + t \vec d for tt. If a consistent tt exists in all three coordinates, p\vec p is on the line. In Cartesian form: plug into the symmetric equation and check that all three ratios are equal.

Worked examples

Example 1. Find the vector and Cartesian equations of the line through (2,1,3)(2, -1, 3) in the direction i^+2j^2k^\hat i + 2\hat j - 2\hat k.

Vector: r=(2,1,3)+t(1,2,2)\vec r = (2, -1, 3) + t(1, 2, -2), i.e. r=(2+t)i^+(1+2t)j^+(32t)k^\vec r = (2 + t)\hat i + (-1 + 2t)\hat j + (3 - 2t)\hat k.

Cartesian: x21=y+12=z32\dfrac{x - 2}{1} = \dfrac{y + 1}{2} = \dfrac{z - 3}{-2}.

Example 2. Find the equation of the line through (1,0,2)(1, 0, 2) and (4,3,8)(4, 3, 8).

Direction: (3,3,6)(3, 3, 6), or simplified (1,1,2)(1, 1, 2). Vector form: r=(1,0,2)+t(1,1,2)\vec r = (1, 0, 2) + t(1, 1, 2).

Cartesian: x11=y1=z22\dfrac{x - 1}{1} = \dfrac{y}{1} = \dfrac{z - 2}{2}.

Example 3. Find the equation of the xx-axis.

Point (0,0,0)(0, 0, 0), direction (1,0,0)(1, 0, 0). Vector form: r=ti^\vec r = t\hat i. Cartesian: y=0y = 0, z=0z = 0.

Example 4. Does the point (3,2,1)(3, 2, 1) lie on x11=y+13=z21\dfrac{x - 1}{1} = \dfrac{y + 1}{3} = \dfrac{z - 2}{-1}?

Check: 311=2\dfrac{3 - 1}{1} = 2; 2+13=1\dfrac{2 + 1}{3} = 1; 121=1\dfrac{1 - 2}{-1} = 1. Not all equal , so no.

Example 5. Find λ\lambda if the point (λ,1,2)(\lambda, 1, 2) lies on the line x12=y10=z23\dfrac{x - 1}{2} = \dfrac{y - 1}{0} = \dfrac{z - 2}{3}.

The middle ratio y10\dfrac{y - 1}{0} is interpreted as y1=0y - 1 = 0, i.e. y=1y = 1 , which is satisfied by our point. So the other two ratios must agree: λ12=223=0\dfrac{\lambda - 1}{2} = \dfrac{2 - 2}{3} = 0, so λ=1\lambda = 1.

Example 6. Find the foot of the perpendicular from (1,2,3)(1, 2, 3) to the line x1=y2=z3\dfrac{x}{1} = \dfrac{y}{2} = \dfrac{z}{3}.

Parametrise: r=t(1,2,3)\vec r = t(1, 2, 3). Foot F=(t,2t,3t)F = (t, 2t, 3t) on the line is the one where PF\vec{PF} \perp direction (1,2,3)(1, 2, 3). PF=(t1,2t2,3t3)\vec{PF} = (t - 1, 2t - 2, 3t - 3). Dot with (1,2,3)(1, 2, 3): (t1)+(4t4)+(9t9)=14t14=0(t - 1) + (4t - 4) + (9t - 9) = 14t - 14 = 0, so t=1t = 1. Foot: (1,2,3)(1, 2, 3). (Interesting , the point itself is on the line.)

Try it yourself

  1. Find the vector equation of the line through (0,1,2)(0, 1, 2) in direction i^+j^+k^\hat i + \hat j + \hat k.
  2. Find the Cartesian equation of the line through (1,2,3)(1, 2, 3) and (4,5,6)(4, 5, 6).
  3. Find direction ratios of the line x12=y+31=z5\dfrac{x - 1}{2} = \dfrac{y + 3}{-1} = \dfrac{z}{5}.
  4. Does the point (2,1,5)(2, -1, 5) lie on x11=y+21=z41\dfrac{x - 1}{1} = \dfrac{y + 2}{-1} = \dfrac{z - 4}{1}?
  5. Find the Cartesian equation of the line through (1,0,1)(1, 0, -1) parallel to the yy-axis.
  6. Find vector and Cartesian forms of the line through (0,0,0)(0, 0, 0) and (2,3,1)(2, 3, -1).
  7. Find the equation of the line through (2,1,4)(2, 1, 4) perpendicular to the lines r=t(1,1,0)\vec r = t(1, 1, 0) and r=s(0,1,1)\vec r = s(0, 1, 1).
  8. Find the foot of perpendicular from (1,2,1)(1, 2, 1) to the line x1=y12=z23\dfrac{x}{1} = \dfrac{y - 1}{2} = \dfrac{z - 2}{3}.
  9. Find α,β\alpha, \beta if (α,β,7)(\alpha, \beta, 7) lies on x1=y2=z7\dfrac{x}{1} = \dfrac{y}{2} = \dfrac{z}{7}.
  10. The line through (1,1,3)(1, -1, 3) with direction (2,1,2)(2, 1, 2) crosses the xyxy-plane at what point?
  11. Find the image of (1,2,3)(1, 2, 3) in the line x11=y12=z+11\dfrac{x - 1}{1} = \dfrac{y - 1}{2} = \dfrac{z + 1}{1}.
  12. Find the distance between (1,0,0)(1, 0, 0) and the line x1=y2=z3\dfrac{x}{1} = \dfrac{y}{2} = \dfrac{z}{3}.
  13. Convert vector form r=(1,2,1)+t(3,1,2)\vec r = (1, 2, -1) + t(3, 1, 2) to Cartesian.
  14. Convert Cartesian form x+11=y21=z2\dfrac{x + 1}{1} = \dfrac{y - 2}{-1} = \dfrac{z}{2} to vector.

Pitfalls and tricks

  • Both forms describe the same line. Pick whichever is convenient for the problem.
  • Zero denominators in Cartesian form are handled by writing the corresponding coordinate as a constant equation.
  • A line in 3D needs two equations (two simultaneous constraints) in Cartesian form , symmetric form packages them as one chain.
  • Parameter tt is arbitrary , it does not matter that it appears explicitly; eliminate it for Cartesian.
  • To check whether a point is on a line, plug into the parametric form and solve for tt.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Equation of a line
6 questions · pick the best answer
Q1

Vector form of a line through a\vec a with direction d\vec d

Q2

Cartesian form: xx0d1=yy0d2=zz0d3\frac{x-x_0}{d_1} = \frac{y-y_0}{d_2} = \frac{z-z_0}{d_3} requires

Q3

Line through (1,0,0)(1,0,0) and (0,1,0)(0,1,0)

Q4

Direction ratios from x12=y+31=z4\dfrac{x-1}{2} = \dfrac{y+3}{-1} = \dfrac{z}{4} are

Q5

Equation of the yy-axis

Q6

Line x1=y20=z+13\dfrac{x}{1} = \dfrac{y-2}{0} = \dfrac{z+1}{3} : what does middle '=.../0= ... /0' mean?