Equation of a line

A line in three-dimensional space is fixed the moment you know one point on it and the direction it runs in — everything else is bookkeeping. This section builds the equation of a line, first as a vector sweeping out points with a parameter λ\lambda, then as the equivalent Cartesian symmetric form, and finally for the special case where the line is given by two points instead of a point-and-direction. It closes with the equations of the coordinate axes and lines parallel to them. This is Section B (optional) material in ISC Class 12 Mathematics, part of the Three-Dimensional Geometry unit, and it leans directly on direction cosines and direction ratios from the previous topic. Getting the point-and-direction skeleton solid here is what makes the later topics of this chapter — coplanarity, angle between lines, and shortest distance between two skew lines — fall into place with almost no new ideas.

The core insight

A line through a known point, running along a known direction, is r⃗=a⃗+λb⃗\vec r = \vec a + \lambda\vec b in vector form and x−x1a=y−y1b=z−z1c\dfrac{x-x_1}{a}=\dfrac{y-y_1}{b}=\dfrac{z-z_1}{c} in Cartesian form, with λ\lambda a free real parameter sweeping out every point on the line.

The core idea

Vector form. Fix a point AA on the line with position vector a⃗\vec a, and let b⃗\vec b be any vector parallel to the line (its direction vector, not necessarily a unit vector). Every point r⃗\vec r on the line is reached by walking from AA some multiple of b⃗\vec b:

r⃗=a⃗+λb⃗,λ∈R.\vec r = \vec a + \lambda \vec b, \qquad \lambda \in \mathbb{R}.

where: r⃗\vec r is the position vector of a general point on the line, a⃗\vec a is the position vector of one known point on the line, b⃗\vec b is a direction vector of the line, and λ\lambda is a scalar parameter — as it ranges over all real numbers, r⃗\vec r traces out the whole line, one point at a time.

Cartesian (symmetric) form. Write a⃗\vec a as the point (x1,y1,z1)(x_1,y_1,z_1) and b⃗\vec b as direction ratios (a,b,c)(a,b,c). Substituting r⃗=xi^+yj^+zk^\vec r = x\hat i+y\hat j+z\hat k into the vector equation and comparing i^,j^,k^\hat i,\hat j,\hat k components in turn gives x−x1=λax-x_1=\lambda a, y−y1=λby-y_1=\lambda b, z−z1=λcz-z_1=\lambda c. Eliminating λ\lambda between the three ties the coordinates together:

x−x1a=y−y1b=z−z1c (=λ).\frac{x-x_1}{a}=\frac{y-y_1}{b}=\frac{z-z_1}{c}\ (=\lambda).

where: (x,y,z)(x,y,z) is a general point on the line, (x1,y1,z1)(x_1,y_1,z_1) is the known point, and (a,b,c)(a,b,c) are direction ratios of the line — they need not be normalised into direction cosines; any scalar multiple of a valid (a,b,c)(a,b,c) is an equally valid final answer.

Two points instead of point-and-direction. If the line passes through P(x1,y1,z1)P(x_1,y_1,z_1) and Q(x2,y2,z2)Q(x_2,y_2,z_2), the direction ratios are simply the difference of coordinates, x2−x1, y2−y1, z2−z1x_2-x_1,\ y_2-y_1,\ z_2-z_1, so

x−x1x2−x1=y−y1y2−y1=z−z1z2−z1,r⃗=a⃗+λ(b⃗−a⃗),\frac{x-x_1}{x_2-x_1}=\frac{y-y_1}{y_2-y_1}=\frac{z-z_1}{z_2-z_1}, \qquad \vec r=\vec a+\lambda(\vec b-\vec a),

where the second form uses a⃗,b⃗\vec a,\vec b as the position vectors of P,QP,Q themselves — the parenthesis (b⃗−a⃗)(\vec b - \vec a) is the direction vector PQPQ.

Axes and lines parallel to axes. The xx-axis is the line through the origin with direction ratios (1,0,0)(1,0,0), written x1=y0=z0\dfrac{x}{1}=\dfrac{y}{0}=\dfrac{z}{0} and understood as the constraint pair y=0, z=0y=0,\ z=0 with xx free; the yy- and zz-axes follow the same pattern. A line through (x1,y1,z1)(x_1,y_1,z_1) parallel to the xx-axis is simply y=y1, z=z1y=y_1,\ z=z_1 with xx free, and similarly for lines parallel to the yy- or zz-axis — these are the degenerate cases where one or two of the "denominators" in the symmetric form are zero, and the fraction notation is only shorthand, not literal division.

Figure
A line in three dimensional space through a point A with position vector a running along direction vector b, and a general point r on the line reached as a plus lambda b
r = a + lambda b — a point and a direction fix the whole line O (origin) A (x1,y1,z1) a r = a + lambda b lambda b (direction) As lambda ranges over all real numbers, r sweeps out every point on the line
Derivation AFrom a vector equation to the Cartesian symmetric form

The goal is to start from the vector equation r⃗=a⃗+λb⃗\vec r = \vec a + \lambda \vec b of a line through a known point with a known direction, and show step by step how eliminating the single parameter λ\lambda between its three coordinate equations produces the Cartesian symmetric form used in every worked problem in this chapter, so that the two forms can be converted into each other on demand rather than memorised as separate facts.

Step 1. Write both sides of r⃗=a⃗+λb⃗\vec r = \vec a + \lambda\vec b in component form. Let a⃗=x1i^+y1j^+z1k^\vec a = x_1\hat i+y_1\hat j+z_1\hat k, b⃗=ai^+bj^+ck^\vec b = a\hat i+b\hat j+c\hat k, and the general point r⃗=xi^+yj^+zk^\vec r = x\hat i+y\hat j+z\hat k. The vector equation becomes

xi^+yj^+zk^=(x1+λa)i^+(y1+λb)j^+(z1+λc)k^.x\hat i+y\hat j+z\hat k = (x_1+\lambda a)\hat i+(y_1+\lambda b)\hat j+(z_1+\lambda c)\hat k.

Step 2. Two vectors are equal only if their i^\hat i, j^\hat j, k^\hat k components match separately, so this single vector equation splits into three scalar equations:

x=x1+λa,y=y1+λb,z=z1+λc.x = x_1+\lambda a, \qquad y = y_1+\lambda b, \qquad z = z_1+\lambda c.

Step 3. Isolate λ\lambda in each of the three equations: λ=x−x1a\lambda = \dfrac{x-x_1}{a}, λ=y−y1b\lambda = \dfrac{y-y_1}{b}, λ=z−z1c\lambda = \dfrac{z-z_1}{c} (assuming a,b,ca,b,c are all nonzero — the degenerate cases are handled by stating a coordinate directly, as with lines parallel to an axis).

Step 4. Since all three expressions equal the same λ\lambda for any point on the line, they must equal each other:

x−x1a=y−y1b=z−z1c.\frac{x-x_1}{a}=\frac{y-y_1}{b}=\frac{z-z_1}{c}.

This is exactly the Cartesian symmetric form. The derivation also shows why the numerators must be x−x1x-x_1 and not x1−xx_1-x — they come directly from isolating λ\lambda, so reversing the sign would silently flip which direction λ\lambda increases along the line.

Worked example

Find the vector and Cartesian equations of the line passing through the point (1,2,−3)(1,2,-3) and parallel to the vector 2i^−j^+4k^2\hat i-\hat j+4\hat k. Then find the coordinates of the point on the line at λ=2\lambda=2, and verify it satisfies the Cartesian form.

Step 1. Identify a⃗\vec a and b⃗\vec b. The given point gives a⃗=i^+2j^−3k^\vec a = \hat i+2\hat j-3\hat k, and the given direction gives b⃗=2i^−j^+4k^\vec b = 2\hat i-\hat j+4\hat k.

Step 2. Write the vector equation directly from the point-and-direction template: r⃗=(i^+2j^−3k^)+λ(2i^−j^+4k^)\vec r = (\hat i+2\hat j-3\hat k)+\lambda(2\hat i-\hat j+4\hat k), λ∈R\lambda\in\mathbb R.

Step 3. Convert to Cartesian form using (x1,y1,z1)=(1,2,−3)(x_1,y_1,z_1)=(1,2,-3) and direction ratios (2,−1,4)(2,-1,4):

x−12=y−2−1=z+34.\frac{x-1}{2}=\frac{y-2}{-1}=\frac{z+3}{4}.

Step 4. Substitute λ=2\lambda=2 into the vector form: r⃗=(1+4)i^+(2−2)j^+(−3+8)k^=5i^+0j^+5k^\vec r = (1+4)\hat i+(2-2)\hat j+(-3+8)\hat k = 5\hat i+0\hat j+5\hat k, i.e. the point (5,0,5)(5,0,5).

Step 5. Check against the Cartesian form: 5−12=2\dfrac{5-1}{2}=2, 0−2−1=2\dfrac{0-2}{-1}=2, 5+34=2\dfrac{5+3}{4}=2 — all three fractions equal 22, confirming (5,0,5)(5,0,5) lies on the line. The vector equation is r⃗=(i^+2j^−3k^)+λ(2i^−j^+4k^)\vec r = (\hat i+2\hat j-3\hat k)+\lambda(2\hat i-\hat j+4\hat k), the Cartesian form is x−12=y−2−1=z+34\dfrac{x-1}{2}=\dfrac{y-2}{-1}=\dfrac{z+3}{4}, and the point at λ=2\lambda=2 is (5,0,5)(5,0,5).

Competitive stretch

For the line through A(3,−2,1)A(3,-2,1) and B(1,4,−3)B(1,4,-3), the direction ratios are 1−3=−2, 4−(−2)=6, −3−1=−41-3=-2,\ 4-(-2)=6,\ -3-1=-4, giving the Cartesian equation x−3−2=y+26=z−1−4\dfrac{x-3}{-2}=\dfrac{y+2}{6}=\dfrac{z-1}{-4}; taking λ=2\lambda=2 in r⃗=(3i^−2j^+k^)+λ(−2i^+6j^−4k^)\vec r=(3\hat i-2\hat j+\hat k)+\lambda(-2\hat i+6\hat j-4\hat k) lands on (−1,10,−7)(-1,10,-7), and back-substitution confirms −1−3−2=10+26=−7−1−4=2\dfrac{-1-3}{-2}=\dfrac{10+2}{6}=\dfrac{-7-1}{-4}=2.

Common traps

  • Writing the symmetric form with the numerator flipped — it is x−x1x-x_1, not x1−xx_1-x; a sign slip here silently reverses which way λ\lambda increases along the line.
  • Treating λ\lambda (or tt) as a fixed unknown to "solve for," rather than a free parameter labelling a whole family of points on the line.
  • Writing an illegal division by zero in the symmetric form when a direction ratio is 00 (line parallel to a coordinate plane), instead of stating that coordinate directly as a constant, e.g. y=y1y=y_1.
  • When a line is given by two points, mixing the base point from one point with direction ratios computed the other way round — either point works as the base, but it must stay paired consistently with the direction ratios computed from it.

Ask the tutor: if your equation of a line isn't matching the answer key, share whether you were given a point-and-direction or two points, and the tutor will walk through the setup with you.

Why doesn't the direction vector b need to be a unit vector?

Because λ\lambda is free to take any real value, scaling b⃗\vec b just rescales how λ\lambda maps to distance along the line — it does not change which points the equation reaches. If you double b⃗\vec b, the same physical point is now hit at half the λ\lambda value, but the set of points r⃗=a⃗+λb⃗\vec r=\vec a+\lambda\vec b traces out is identical. Direction cosines (a unit vector) are only needed when you specifically want λ\lambda to measure actual distance from AA, which most equation-of-a-line questions do not ask for.

If I use point B instead of point A as the base point, is my answer wrong?

No — both are equally correct, just different-looking. The line through two points has infinitely many valid vector and Cartesian equations, one for every choice of base point and every nonzero scalar multiple of the direction ratios. What you must not do is mix them: use BB's coordinates as (x1,y1,z1)(x_1,y_1,z_1) but keep the direction ratios computed as (coordinates of AA) minus (coordinates of BB) rather than the reverse — that inconsistency is the actual error, not the choice of base point itself.

How is this different from finding the equation of a line in 2D coordinate geometry?

The idea is the same — a point plus a direction fixes the line — but 2D collapses it into a single equation like y=mx+cy=mx+c because two coordinates leave only one degree of freedom once the slope is fixed. In 3D, a direction is a vector with three components, and you cannot compress the relationship into one equation without losing information, so the symmetric form uses two equalities chained together (x−x1a=y−y1b=z−z1c\frac{x-x_1}{a}=\frac{y-y_1}{b}=\frac{z-z_1}{c}) — it is really two simultaneous equations describing the intersection of two planes, which is exactly what a line in 3D is.

Before this

Where this leads