11.2 Equation of a Line in Space
In space a line has no slope-and-intercept equation. Instead, one point and one direction vector do the job: r = a + ฮปb, where the single number ฮป slides a point along the whole line.
A delivery drone takes off and flies in a straight line towards a rooftop. Its flight computer must know, at every instant, exactly where the drone is: its east, north and height coordinates. In two-dimensional coordinate geometry you described a straight line by one equation such as $y=2x+3$. In space that cannot work: a single equation in $x,y,z$ describes a whole surface, not a line. What does fix a line in space is what the drone's computer actually stores โ a starting point and a direction. Every point of the line is reached by starting at the point and moving some multiple $\lambda$ of the direction vector.
This section turns that idea into the vector equation of a line, $\vec r=\vec a+\lambda\vec b$, and its coordinate version, the Cartesian equation of a line. You will learn to write both forms for a line through a point in a given direction and for a line through two points, to switch between the forms, to find points on a line at a given distance, and to drop a perpendicular from a point to a line. The vector algebra of Chapter 10 โ position vectors, collinear vectors and the scalar product โ is all you need.
The Vector Equation of a Line
Through a given point there is exactly one line parallel to a given non-zero vector. Any vector along the line will do to describe its direction, so we give such vectors a name.
Proof. Let $P$ be any point, with position vector $\vec r$. Then $\overrightarrow{AP}=\vec r-\vec a$. The point $P$ lies on the line through $A$ parallel to $\vec b$ exactly when $P=A$ or $\overrightarrow{AP}$ is parallel to $\vec b$, that is, exactly when $\overrightarrow{AP}$ is a scalar multiple of $\vec b$ (Theorem 10.5 in Section 10.2): $\vec r-\vec a=\lambda\vec b$ for some $\lambda$. This is $\vec r=\vec a+\lambda\vec b$. If $\vec a+\lambda_1\vec b=\vec a+\lambda_2\vec b$, then $(\lambda_1-\lambda_2)\vec b=\vec 0$, and since $\vec b\ne\vec 0$, $\lambda_1=\lambda_2$. $\square$
Read the equation as a recipe: start at $A$, then move $\lambda$ copies of $\vec b$. Positive $\lambda$ moves you along $\vec b$, negative $\lambda$ against it, and $\lambda=0$ gives $A$ itself. The distance moved is $AP=|\lambda|\,|\vec b|$.
The Cartesian Equation of a Line
Write the vector equation in components. With $\vec r=x\hat i+y\hat j+z\hat k$, $\vec a=x_1\hat i+y_1\hat j+z_1\hat k$ and $\vec b=a\hat i+b\hat j+c\hat k$, the equation $\vec r=\vec a+\lambda\vec b$ says, by equality of vectors, $$x=x_1+\lambda a,\qquad y=y_1+\lambda b,\qquad z=z_1+\lambda c.$$ These are the parametric equations of the line. Solving each for $\lambda$ and equating the results removes the parameter.
Zero direction ratios. If, say, $a=0$, the parametric equation is simply $x=x_1$ for every point; the line is then written $x=x_1,\ \dfrac{y-y_1}{b}=\dfrac{z-z_1}{c}$. (You may meet the shorthand $\dfrac{x-x_1}{0}$; it means only โ$x-x_1=0$โ, never division by $0$.)
- Make each numerator of the form $x-x_1$, $y-y_1$, $z-z_1$ with coefficient $+1$: rewrite $(3-x)$ as $-(x-3)$, and $(2y+1)$ as $2\left(y+\tfrac12\right)$.
- Move any factor into the denominator: $\dfrac{-(x-3)}{5}=\dfrac{x-3}{-5}$ and $\dfrac{2(y+\frac12)}{4}=\dfrac{y+\frac12}{2}$.
- Read off the point $(x_1,y_1,z_1)$ from the numerators and the direction ratios from the denominators.
- Write the vector form $\vec r=(x_1\hat i+y_1\hat j+z_1\hat k)+\lambda(a\hat i+b\hat j+c\hat k)$ if it is asked for.
The Line through Two Points
If a line is given by two of its points $A$ and $B$, the vector $\overrightarrow{AB}=\vec b-\vec a$ is a direction vector of it (here $\vec b$ is the position vector of $B$). Theorem 11.5 then gives the equation at once.
(If one of the differences, say $x_2-x_1$, is $0$, the Cartesian form reads $x=x_1$ together with the other two fractions, as before.)
The Foot of the Perpendicular from a Point to a Line
How far is a point $P$ from a line $L$? The shortest segment from $P$ to $L$ is the one that meets $L$ at right angles; its end $F$ on $L$ is called the foot of the perpendicular, and $PF$ is the perpendicular distance of $P$ from $L$. (By Pythagoras, any other segment $PQ$ to the line is the hypotenuse of the right triangle $PFQ$, so it is longer.) The scalar product finds $F$ in one step.
- General point. Write the point of the line with parameter $\lambda$: $Q=(x_1+\lambda a,\ y_1+\lambda b,\ z_1+\lambda c)$.
- Join. Find $\overrightarrow{PQ}$ in terms of $\lambda$.
- Perpendicular. Solve $\overrightarrow{PQ}\cdot\vec b=0$ โ one linear equation in $\lambda$.
- Substitute that $\lambda$ to get the foot $F$; the perpendicular distance is $|\overrightarrow{PF}|$.
- Check $\overrightarrow{PF}\cdot\vec b=0$. For the image (reflection) $P'$ of $P$ in the line, use that $F$ is the mid-point of $PP'$: $P'=2F-P$.
1. Reading off the wrong point or ratios. In $\dfrac{x+2}{3}$ the point has $x_1=-2$, not $2$. In $\dfrac{4-y}{5}$ the direction ratio is $-5$, and in $\dfrac{3z-1}{6}$ it is $2$ (with $z_1=\tfrac13$). Always rewrite to the standard form first.
2. Mixing up $\vec a$ and $\vec b$. In $\vec r=\vec a+\lambda\vec b$, $\vec a$ is the position vector of a point and $\vec b$ is a direction. The line $\vec r=\vec b+\lambda\vec a$ is a different line.
3. Using different parameters. To test whether a point is on a line, all three coordinates must give the same $\lambda$ (Example 1(c)).
4. Distance along a line. The point with parameter $\lambda$ is at distance $|\lambda|\,|\vec b|$ from $A$, not $|\lambda|$ โ unless $\vec b$ is a unit vector.
5. The foot condition. The condition is $\overrightarrow{PF}\cdot\vec b=0$ with the direction vector of the line โ not $\overrightarrow{PF}\cdot\vec a=0$.
In JEE Advanced 2026; not in the CBSE Class 12 syllabus or JEE Main. Just as a point and a direction fix a line, a point and a perpendicular direction fix a flat surface called a plane. If $A$ has position vector $\vec a$ and $\vec n=a\hat i+b\hat j+c\hat k\ne\vec 0$, the points $P$ with $\overrightarrow{AP}\perp\vec n$ form the plane through $A$ with normal $\vec n$: $$(\vec r-\vec a)\cdot\vec n=0,$$ $$a(x-x_1)+b(y-y_1)+c(z-z_1)=0.$$ Worked example. The plane through $(2,-1,3)$ with normal $\hat i+2\hat j-2\hat k$ is $(x-2)+2(y+1)-2(z-3)=0$, that is $x+2y-2z+6=0$. Check: $2-2-6+6=0$ โ. A line $\vec r=\vec a+\lambda\vec b$ is perpendicular to this plane exactly when $\vec b$ is parallel to $\vec n$ โ for example, the line through $(2,-1,3)$ with direction ratios $1,2,-2$.
Exercises
- 1 Find the vector equation of the line through $(1,-2,3)$ parallel to $2\hat i+\hat j-5\hat k$.
- 2 Find the vector equation of the line through the origin parallel to $3\hat i-\hat j+2\hat k$.
- 3 Find the vector equation of the line through $(4,0,-1)$ parallel to the $z$-axis.
- 4 Find the vector equation of the line through $(-1,2,0)$ parallel to the line $\vec r=(\hat i+\hat j)+\mu(2\hat i-3\hat j+6\hat k)$.
- 5 For the line $\vec r=(3\hat i-\hat j+2\hat k)+\lambda(\hat i+2\hat j-2\hat k)$, find the points with $\lambda=-1$, $0$ and $2$.
- 6 Do the points $(6,5,-4)$ and $(1,-5,5)$ lie on the line of part 5?
- 7 Find the point of the line of part 5 at which $z=0$.
Numbers such as 4, โ2.5 or 3/4. The lab solves each coordinate equation for $\lambda$ and compares.
- 1 Write the line of Exercise I.1 in Cartesian form.
- 2 Write $\dfrac{x+3}{2}=\dfrac{y-1}{-4}=\dfrac{z-6}{5}$ in vector form.
- 3 Find a point, the direction ratios and the direction cosines of $\dfrac{2x-1}{4}=\dfrac{3-y}{2}=\dfrac{z+2}{3}$.
- 4 Find the direction cosines of the line $\dfrac{x-4}{2}=\dfrac{y}{6}=\dfrac{1-z}{3}$.
- 5 Write the Cartesian and vector equations of the line through $(2,-1,4)$ with direction ratios $0,3,-2$.
- 6 Write vector and Cartesian equations of the $x$-axis.
- 7 Find $k$ so that $(k,-1,7)$ lies on $\dfrac{x-1}{2}=\dfrac{y+3}{1}=\dfrac{z-3}{2}$.
- 8 Show that $\dfrac{x-1}{2}=\dfrac{y-2}{3}=\dfrac{z-3}{4}$ and $\dfrac{x-3}{-4}=\dfrac{y-5}{-6}=\dfrac{z-7}{-8}$ describe the same line.
- 1 Find the vector and Cartesian equations of the line through $(2,-1,1)$ and $(5,3,-1)$.
- 2 Find the vector and Cartesian equations of the line through $(1,0,-2)$ and $(1,4,1)$.
- 3 Find the points of the line of part 2 at a distance of $10$ units from $(1,0,-2)$.
- 4 Find the equations of the line through the origin and $(-2,6,-3)$, and the points on it at a distance of $14$ from the origin.
- 5 Find the point at which the line through $(2,3,-1)$ and $(4,7,3)$ reaches $z=0$.
- 6 Does $(8,7,-3)$ lie on the line of part 1?
- 7 For $\vec r=\vec a+\lambda(\vec b-\vec a)$ through $A$ and $B$, which values of $\lambda$ give: $A$; $B$; the mid-point of $AB$; the point dividing $AB$ internally in the ratio $1:2$; points beyond $B$?
- 1 Find the foot of the perpendicular from $P(6,3,0)$ to the line $\vec r=\lambda(\hat i+2\hat j+2\hat k)$, and the perpendicular distance.
- 2 Find the foot of the perpendicular from $P(7,0,-1)$ to the line $\dfrac x2=\dfrac{y-1}{-2}=\dfrac{z+3}{1}$, and the perpendicular distance.
- 3 Find the image of the point $P$ of part 2 in that line.
- 4 Pipeline. In an illustrative site plan (metres), a straight pipeline runs from $O(0,0,0)$ to $B(12,6,4)$, and a pump stands at $P(8,-1,2)$. A connecting pipe from $P$ must meet the pipeline at right angles. Where does it join, and how long is it?
- 5 A ball moves so that its position after $t$ seconds is $\vec r=(\hat i+2\hat j)+t(2\hat i-\hat j+2\hat k)$ metres. Find its speed, and its position when it has travelled $12$ m.
- 6 Show that $x-1=2(y+3)=z$ is the equation of a line, and find a point on it and its direction cosines.
How this is examined: Board papers ask you to read the direction ratios or a point from a Cartesian equation (1 mark, often with a $1-x$ trap), to write the vector and Cartesian equations of a line through two points (2 marks), and to find the foot of a perpendicular and a perpendicular distance (3 marks); case studies put a line into a drone, laser or pipeline story. JEE favours images of points in lines.
E1. Board ยท 1 mark The direction ratios of the line $\dfrac{x-3}{2}=\dfrac{1-y}{4}=\dfrac{z+2}{-1}$ are (A) $2,4,-1$ (B) $2,-4,-1$ (C) $3,1,-2$ (D) $3,-1,-2$
E2. Board ยท 1 mark AssertionโReason. Assertion (A): the line $\vec r=(\hat i-\hat j)+\lambda(2\hat i+\hat k)$ passes through $(3,-1,1)$. Reason (R): a point with position vector $\vec r$ lies on the line $\vec r=\vec a+\lambda\vec b$ if and only if $\vec r-\vec a$ is a scalar multiple of $\vec b$. (A) Both A and R are true and R is the correct explanation of A (B) Both A and R are true but R is not the correct explanation of A (C) A is true but R is false (D) A is false but R is true
E3. Board ยท 2 marks Find the vector and Cartesian equations of the line through $(-1,0,2)$ and $(3,4,6)$.
E4. Board ยท 3 marks Find the coordinates of the foot of the perpendicular from $P(4,1,1)$ to the line $\dfrac{x-1}{1}=\dfrac{y+2}{2}=\dfrac{z-1}{-2}$, and the perpendicular distance of $P$ from the line.
E5. Board ยท Case study In a physics lab (illustrative set-up, lengths in cm), a laser source at $S(1,-2,0)$ sends a straight beam in the direction $2\hat i+2\hat j+\hat k$. (i) Write the vector and Cartesian equations of the beam. (2 marks) (ii) Find the point the beam reaches after travelling $9$ cm. (1 mark) (iii) Will the beam hit a sensor placed at $(5,2,3)$? (1 mark)
E6. JEE Main The image of the point $P(9,1,-1)$ in the line $\dfrac{x-2}{3}=\dfrac{y+1}{2}=\dfrac{z-3}{-6}$ is (A) $(1,1,-5)$ (B) $(5,1,-3)$ (C) $(1,-1,-5)$ (D) $(13,1,1)$
Research question. If you know two points of a stretched string, can the equation of the line predict exactly where the string passes over any chosen spot in the room โ and how accurate is the prediction?
Why it matters. Builders lay out cables, ducts and conveyor belts from a few surveyed points; robot arms and 3-D printers move their tools along straight segments described by $\vec r=\vec a+\lambda\vec b$. Predicting intermediate points from the equation, and measuring how far reality differs, is everyday engineering.
What to do.
- Choose one corner of the classroom floor as the origin, with $x$ and $y$ along two walls and $z$ up. Stretch a string tightly between two points $A$ and $B$ at different heights (for example, a hook on one wall and a chair leg across the room). Measure the coordinates of $A$ and $B$ with a tape measure, in cm.
- Write the vector and Cartesian equations of the line $AB$.
- Predict, from the equations, the point of the string at height $z=100$ cm, and the point of the string directly above a mark on the floor of your choice (pick its $x$ and work out $\lambda$).
- Measure where the string actually is at those places and record the differences. Repeat with the string less tight.
Tools: Tape measure, string, masking tape, plumb line (a weight on a thread), spreadsheet.
Hand in: A labelled sketch with coordinates, your equations, a table of predicted and measured points with their differences, and a paragraph explaining the main sources of error (sag of the string, measuring errors).
Going further. Find the foot of the perpendicular from a ceiling light to your string: where would a short vertical cord from the light not meet the string at right angles, and why?
๐งช Self-check quiz
Q1. The vector equation of the line through $(1,0,-2)$ parallel to $3\hat i-\hat j+\hat k$ is
Q2. Which point lies on $\dfrac{x-2}{3}=\dfrac{y+1}{-2}=\dfrac{z}{5}$?
Q3. Direction ratios of the line $\dfrac{1-x}{2}=\dfrac{y-3}{1}=\dfrac{2z+1}{4}$ are
Q4. On the line $\vec r=\vec a+\lambda\vec b$, the point with $\lambda=0$ is
Q5. $F$ is the foot of the perpendicular from $P$ to the line $\vec r=\vec a+\lambda\vec b$. Which condition determines $F$?