Equations of lines in 3D (HL)

Direction vectors are analogous to gradients.

In vector geometry, a line is identified by a point (x0,y0,z0)(x_0, y_0, z_0) on the line, and a direction vector l,m,n\rvec{l,m,n} of the line.

The direction vector can be replaced by any non-zero scalar multiple. The point can be replaced by any other point on the line.

Last edited: 2026-06-21 make equations of lines more consistent

Contents

Vector equation of a line

The position vector r\bm r of any point on the line is

r=x1y1z1+λlmn\bm r = \cvec{x_1}{y_1}{z_1} + \lambda \cvec lmn

The vector multiplied by a parameter λ\lambda is the direction vector.

Different points on the line are associated with different parameters.

For example, the line

r=321+λ401\bm r = \cvec32{-1} + \lambda \cvec{-4}01

contains the position vector 3,2,1\rvec{3, 2, -1} and is in the direction 4,0,1\rvec{-4, 0, 1}.

Often, we are given two points on a line, the difference between the two position vectors is used as the direction.

Parametric equation of a line

x=x0+λlx = x_0 + \lambda l
y=y0+λmy = y_0 + \lambda m
z=z0+λnz = z_0 + \lambda n

For example, the previous line can be expressed as

x=34λx = 3 - 4\lambda
y=2y = 2
z=1+λz = -1 + \lambda

Symmetric (Cartesian) equation of a line

This solves for λ\lambda and equate the expressions.

xx0l=yy0m=zz0n\frac{x - x_0}{l} = \frac{y - y_0}{m} = \frac{z - z_0}{n}

Where the component of the direction vector is 00, for example the aforementioned line is

3x4=z+1, y=2\frac{3 - x}{4} = z + 1, \ y = 2

Note, when there is not a denominator, it is 11. Beware of a potentially reversed numerator, because of dividing by a negative.

Checking if a point is on a line

Suppose we have

r^=256+λ314\bm{\hat r} = \cvec2{-5}6 + \lambda \cvec3{-1}{-4}

We want to verify if (7,2,6)(-7, -2, 6) is on the line.

If the direction vector has all non-zero components, then the parameter must be the same value for xx, yy, zz.

x:λ=7(2)3=3x: \lambda = \frac{-7 - (2)}{3} = -3
y:λ=2(5)1=3y: \lambda = \frac{-2 - (-5)}{-1} = -3
z:λ=6(6)4=03z: \lambda = \frac{6- (6)}{-4} = 0\neq -3

So (7,2,6)(-7, -2, 6) is not on the line. Note that we simply substituted values into the symmetric (Cartesian) equation of a line.

Applications

The equations of a 3D line can be interpreted to represent the path of some object or particle, with initial position x0,y0,z0\rvec{x_0, y_0, z_0}, constant velocity l,m,n\rvec {l,m,n}, time traveled λ\lambda (or tt), and final position r\bm r.

Tips

  1. All forms of a line (using vectors) are accepted. Vector equation is probably the easiest.
  2. Use different parameters for different lines.