Equation of a Line in Three Dimensions

Equation of a Line in Three Dimensions

Komal MiglaniUpdated on 02 Jul 2025, 07:49 PM IST

The equation of a line is an algebraic way to represent a line in terms of the coordinates of the points it joins. The equation of the straight line in 3D requires two points that are located in space. The point in three coordinates is expressed as ( $\mathrm{x}, \mathrm{y}, \mathrm{z}$ ). In real life, we use equations for a line in space to calculate the speed, distance and time of a moving object.

This Story also Contains

  1. What is the Equation of a Line?
  2. Equation of line in 2D
  3. Equation of a line through a given point and parallel to a given vector in Vector Form
  4. Equation of a line through a given point and parallel to a given vector in Cartesian Form
  5. Equation of a line passing through two given points in vector form
  6. Solved Examples Based on Equations for a Line in 3D Space
Equation of a Line in Three Dimensions
Equation of a Line in Three Dimensions

In this article, we will cover the concept of Equations for a Line in Space. This topic falls under the broader category of 3-dimensional geometry, which is an important chapter in Class 12 Mathematics. This is very important not only for board exams but also for the competitive exams, which even include the Joint Entrance Examination Main and other entrance exams: SRM Joint Engineering Entrance, BITSAT, WBJEE, and BCECE. A total of 11 questions have been asked on this topic in JEE Main from 2013 to 2023 including one in 2014, one in 2019, two in 2021, two in 2022, and five in 2023.

What is the Equation of a Line?

The equation of a line is an algebraic way to express a line in terms of the coordinates of the points it joins. The equation of a line will always be a linear equation.

A line is uniquely determined if:

  1. It passes through a given point and has given direction, or

  2. It passes through two given points.

Equation of line in 2D

1) Point Slope Form

Using the Point Slope Form we represent a line using the slope $(m)$ and a point on the line $\left(x_1, y_1\right)$.

$
y-y_1=m\left(x-x_1\right)
$

2) Slope Intercept Form

In Slope Intercept Form we represent a line using the slope $(\mathrm{m})$ and the $y$ intercept $(b)$.

$
y=m x+b
$

3) Intercept Form

Using the Intercept Form we represent a line where it intersects the x -axis at $(a, 0)$ and the $y$-axis at $(0, b)$.

$
x / a+y / b=1
$
4) Normal Form

Represents a line using the angle $(\theta)$ the line makes with the positive $x$ axis and the perpendicular distance (p) from the origin to the line.

$
x \cos \theta+y \sin \theta=p
$

Equation of Line in 3D

The equation of the straight line in 3D requires two points that are located in space. The point in three coordinates is expressed as ( $x, y, z)$.

Equation of a line through a given point and parallel to a given vector in Vector Form

Let $L$ be $a$ line in space passing through point $P\left(x_0, y_0, z_0\right)$. Let $\overrightarrow{\mathbf{b}}=a \hat{\mathbf{i}}+b \hat{\mathbf{j}}+c \hat{\mathbf{k}}$ be a vector parallel to $L$ . Then, for any point on line $\mathrm{Q}(\mathrm{x}, \mathrm{y}, \mathrm{z})$, we know that vector $P Q$ is parallel to vector $b$ . Thus, there is a scalar, $\lambda$, such that $\overrightarrow{P Q}=\lambda \overrightarrow{\mathbf{b}}$, which gives,

$
\begin{gathered}
\overrightarrow{P Q}=\lambda \tilde{\mathbf{b}} \\
\left(x-x_0\right) \hat{i}+\left(y-y_0\right) \hat{j}+\left(z-z_0\right) \hat{k}=\lambda(a \hat{i}+b \hat{j}+c \hat{k})
\end{gathered}
$

Using vector operations, we can rewrite,

$
\begin{aligned}
(x \hat{i}+y \hat{j}+z \hat{k})-\left(x_0 \hat{i}+y_0 \hat{j}+z_0 \hat{k}\right) & =\lambda(a \hat{i}+b \hat{j}+c \hat{k}) \\
(x \hat{i}+y \hat{j}+z \hat{k}) & =\left(x_0 \hat{i}+y_0 \hat{j}+z_0 \hat{k}\right)+\lambda(a \hat{i}+b \hat{j}+c \hat{k})
\end{aligned}
$

Setting $\overrightarrow{\mathbf{r}}=x \hat{i}+y \hat{j}+z \hat{k}$ and $\overrightarrow{\mathbf{r}}_0=x_0 \hat{i}+y_0 \hat{j}+z_0 \hat{k}$ we now have the vector equation of a line:

$
\overrightarrow{\mathbf{r}}=\overrightarrow{\mathbf{r}}_0+\lambda \overrightarrow{\mathbf{b}}
$


Equation of a line through a given point and parallel to a given vector in Cartesian Form

The Equation of a line through a given point and parallel to a given vector in Cartesian Form is

$
\frac{x-x_0}{a}=\frac{y-y_0}{b}=\frac{z-z_0}{c}
$


Derivation

The vector equation of a line $\overrightarrow{\mathbf{r}}=\overrightarrow{\mathbf{r}}_0+\lambda \overrightarrow{\mathbf{b}}$ shows that the following equations are simultaneously true:

$
x=x_0+\lambda a ; y=y_0+\lambda b ; z=z_0+\lambda c
$

If we solve each of these equations for the component variables $x, y$, and $z$, we get a set of equations in which each variable is defined in terms of the parameter $\lambda$ and that, together, describe the line. This set of three equations forms a set of parametric equations of a line:

If we solve each of the equations for $\lambda$ assuming $\mathrm{a}, \mathrm{b}$, and $c$ are non-zero, we get a different description of the same line:

$
\frac{x-x_0}{a}=\lambda, \quad \frac{y-y_0}{b}=\lambda, \quad \frac{z-z_0}{c}=\lambda
$

|These are parametric equations of the line. Eliminating the parameter $\lambda$ from the above equation, we get,

$
\frac{x-x_0}{a}=\frac{y-y_0}{b}=\frac{z-z_0}{c}
$

This is the Cartesian equation of the line.

NOTE:
If $\mathrm{I}, \mathrm{m}, \mathrm{n}$ are the direction cosines of the line, the equation of the line is

$
\frac{x-x_0}{l}=\frac{y-y_0}{m}=\frac{z-z_0}{n}
$

Equation of a line passing through two given points in vector form

Let $\overrightarrow{\mathbf{p}}=x_0 \hat{i}+y_0 \hat{j}+z_0 \hat{k} \text { and } \overrightarrow{\mathbf{q}}=x_1 \hat{i}+y_1 \hat{j}+z_1 \hat{k} \text {. }\\$
$\overrightarrow{\mathbf{r}}=\overrightarrow{\mathbf{p}}+\lambda(\overrightarrow{\mathbf{q}}-\overrightarrow{\mathbf{p}})$

Derivation

Let $P\left(x_0, y_0, z_0\right)$ and $Q\left(x_1, y_1, z_1\right)$ be the points on a line, and let $\overrightarrow{\mathbf{p}}=x_0 \hat{i}+y_0 \hat{j}+z_0 \hat{k}$ and $\overrightarrow{\mathbf{q}}=x_1 \hat{i}+y_1 \hat{j}+z_1 \hat{k}$

Let $\overrightarrow{\mathbf{r}}$ be the position vector of an arbitrary point $R(x, y, z)$ lying on this line We want to find a vector equation for the line PQ.

Using P as our known point on the line, and $\overrightarrow{P Q}=\left(x_1-x_0\right) \hat{i}+\left(y_1-y_0\right) \hat{j}+\left(z_1-z_0\right) \hat{k}$ as the direction vector, the equation $\overrightarrow{\mathbf{r}}=\overrightarrow{\mathbf{r}}_0+\lambda \overrightarrow{\mathbf{b}}$ gives

$
\begin{aligned}
\overrightarrow{\mathbf{r}} & =\overrightarrow{\mathbf{p}}+\lambda(\overrightarrow{P Q}) \\
\overrightarrow{\mathbf{r}} & =\overrightarrow{\mathbf{p}}+\lambda(\overrightarrow{\mathbf{q}}-\overrightarrow{\mathbf{p}})
\end{aligned}
$


Equation of a line passing through two given points in Cartesian Form

We can also find parametric equations for the line segment $\overrightarrow{\mathbf{r}}=\overrightarrow{\mathbf{p}}+\lambda(\overrightarrow{\mathbf{q}}-\overrightarrow{\mathbf{p}})$

As the position vector of point $\mathrm{R}(\mathrm{x}, \mathrm{y}, \mathrm{z})$ is $\overrightarrow{\mathbf{r}}=(x \hat{i}+y \hat{j}+z \hat{k})$.

Recommended Video Based on Equations for a Line in 3D Space


Solved Examples Based on Equations for a Line in 3D Space

Example 1: Consider the lines $L_1$ and $L_2$ given by

$
L_1: \frac{x-1}{2}=\frac{y-3}{1}=\frac{z-2}{2} L_2: \frac{x-2}{1}=\frac{y-2}{2}=\frac{z-3}{3}
$

line $L_3$ having direction ratios $1,-1,-2$, intersects $L_1$ and $L_2$ at the points $P$ and $Q$ respectively. Then the length of the line segment $P Q$ is
[JEE MAINS 2023]

Solution

D R's of $P Q$ are $=(2 \lambda-\mu-1, \lambda-2 \mu+1,2 \lambda-3 \mu-1)$ given D.R's are $=(1,-1,-2)$

$
\begin{aligned}
& \frac{2 \lambda-\mu-1}{1}=\frac{\lambda-2 \mu+1}{-1}=\frac{2 \lambda-3 \mu-1}{-2} \\
& \lambda=\mu=3 \\
& \mathrm{P}=(7,6,8) \\
& \mathrm{Q}=(5,8,12) \\
& \mathrm{PQ}=2 \sqrt{6}
\end{aligned}
$

Hence, the answer is $2 \sqrt{6}$

Example 2: Let the line $L$ pass through the point $(0,1,2)$, intersect the line $\frac{\mathrm{x}-1}{2}=\frac{\mathrm{y}-2}{3}=\frac{\mathrm{z}-3}{4}$ and be parallel to the plane $2 x+y-3 z=4$. Then the distance of the point $P(1,-9,2)$ from the line $L$ is :
[JEE MAINS 2023]

Solution

$\begin{aligned}
& \overrightarrow{\mathrm{PQ}}=(2 \lambda+1,3 \lambda+1,4 \lambda+1) \\
& \overrightarrow{\mathrm{PQ}} \cdot \overrightarrow{\mathrm{n}}=0 \quad \Rightarrow(2 \lambda+1) \cdot(2)+(3 \lambda+1)(1)+(4 \lambda+1)(-3)=0 \\
& \Rightarrow-5 \lambda=0 \\
& \Rightarrow \lambda=0 \\
& Q=(1,2,3) \\
& \mathrm{eq}^{\mathrm{n}} \text { of line } \\
& \frac{x-0}{1}=\frac{y-1}{1}=\frac{z-2}{1}=\mu \\
& \text { distance of line from }(1,-9,2) \\
& \left(P^{\prime} \mathrm{Q}\right) \cdot(1,1,1)=0 \\
& \Rightarrow[\mu-1, \mu+10, \mu] \cdot[1,1,1]=0 \\
& \Rightarrow \mu-1+\mu+10+\mu=0 \\
& \mu=-3 \\
& Q^{\prime}=(-3,-2,1) \\
& P^{\prime} Q^{\prime}=\sqrt{16+49+9}=\sqrt{74}
\end{aligned}$

Hence, the answer is $\sqrt{74}$

Example 3: Let a line having direction ratios $1,-4,2$ intersect the lines $\frac{\mathrm{x}-7}{3}=\frac{\mathrm{y}-1}{-1}=\frac{\mathrm{z}+2}{1}$ and $\frac{\mathrm{x}}{2}=\frac{\mathrm{y}-7}{3}=\frac{\mathrm{z}}{1}$ at the points A and B . Then $(\mathrm{AB})^2$ is equal to $\qquad$ [JEE MAINS 2022]

Solution

Direction ratio of AB:

$
\frac{3 \mu-2 \lambda+7}{1}=\frac{-\mu-3 \lambda-6}{-4}=\frac{\mu-\lambda-2}{2}
$

On solving $\mu=-5$

$
\lambda=-3
$

$
\begin{aligned}
\therefore(\mathrm{AB})^2 & =(-15+6+7)^2+(5+9-6)^2+(-5+3-2)^2 \\
& =4+64+16 \\
& =84
\end{aligned}
$

Hence, the answer is 84

Example 4: The equation of the line through the point $(0,1,2)$ and perpendicular to the line $\frac{x-1}{2}=\frac{x+1}{3}=\frac{z-1}{-2}$ is: [JEE MAINS 2022]

Solution


$\begin{aligned}
& \frac{x-1}{2}=\frac{y+1}{3}=\frac{z-1}{-2}=r \\
& \Rightarrow P(x, y, z)=(2 r+1,3 r-1,-2 r+1)
\end{aligned}$

Since, $\overrightarrow{Q P} \perp(2 \hat{i}+3 \hat{j}-2 \hat{k})$

$
\begin{aligned}
& \Rightarrow 4 r+2+9 r-6+4 r+2=0 \\
& \Rightarrow \mathrm{r}=\frac{2}{17} \\
& \Rightarrow \mathrm{P}\left(\frac{21}{17}, \frac{-11}{17}, \frac{13}{17}\right) \\
& \Rightarrow \overrightarrow{\mathrm{PQ}}=\frac{21 \hat{\mathrm{i}}-28 \hat{\mathrm{j}}-21 \hat{\mathrm{k}}}{17}
\end{aligned}
$

So, $\overrightarrow{\mathrm{QP}}: \frac{\mathrm{x}}{-3}=\frac{\mathrm{y}-1}{4}=\frac{\mathrm{z}-2}{3}$
Hence, the answer is $\frac{x}{-3}=\frac{y-1}{4}=\frac{z-2}{3}$

Example 5 : The equation of the line passing through $(-4,3,1)$, parallel to the plane $x+2 y-z-5=0$ and intersecting the line $\frac{x+1}{-3}=\frac{y-3}{2}=\frac{z-2}{-1}$ is :

[JEE Mains 2021]
Solution: The normal vector of the plane containing two intersecting lines is parallel to the vector

$
\overrightarrow{v_1}=\left|\begin{array}{ccc}
\hat{i} & \hat{\hat{j}} & \hat{k} \\
3 & 0 & 1 \\
-3 & 2 & -1
\end{array}\right|=-2 \hat{i}+6 \hat{k}
$

$\therefore$ The required line is parallel to the vector

$
\left(\overrightarrow{v_2}\right)=\left|\begin{array}{ccc}
\hat{i} & \hat{j} & \hat{k} \\
1 & 2 & -1 \\
-2 & 0 & 6
\end{array}\right|=3 \hat{i}-\hat{j}+\hat{k}
$

$\therefore$ The required equation of the line is

$
\frac{x+4}{3}=\frac{y-3}{-1}=\frac{z-1}{1}
$

Frequently Asked Questions (FAQs)

Q: How does the concept of a position vector relate to the equation of a line in 3D?
A:
The position vector r of any point on a line can be expressed as r = r₀ + tv, where r₀ is the position vector of a fixed point on the line, v is the direction vector, and t is a parameter. This vector equation directly translates to the parametric form of the line equation.
Q: How does the concept of linear independence relate to lines in 3D?
A:
Two lines are linearly independent if their direction vectors are not parallel (i.e., not scalar multiples of each other). Three lines are linearly independent if their direction vectors are not coplanar. Linear independence is crucial for spanning 3D space with lines.
Q: What is the significance of the vector triple product in relation to lines in 3D?
A:
The vector triple product a × (b × c) can be used to determine if three direction vectors a, b, and c are coplanar. If the result is the zero vector, the vectors (and thus the lines they represent) are coplanar.
Q: How can you find the equation of a line that is equidistant from two given points in 3D?
A:
The line equidistant from two points A and B is the perpendicular bisector of the line segment AB. Its equation can be found by:
Q: How does the concept of a normal vector relate to lines in 3D?
A:
While lines themselves don't have normal vectors, the concept is important when considering the relationship between lines and planes. Any vector perpendicular to the direction vector of a line is a normal vector to that line, and it's also normal to any plane containing the line.
Q: What is the geometric interpretation of the symmetric form of a line equation in 3D?
A:
The symmetric form (x - x₀)/a = (y - y₀)/b = (z - z₀)/c represents the line as the intersection of two planes. Each equality in the equation represents a plane, and the line is where these planes intersect.
Q: How can you find the equation of a line that is the intersection of two planes?
A:
To find the line of intersection:
Q: How can you determine if a line is parallel to a coordinate plane?
A:
A line is parallel to a coordinate plane if its direction vector is perpendicular to the normal vector of that plane. For example, a line is parallel to the xy-plane if its direction vector has a z-component of zero.
Q: How can you find the foot of the perpendicular from a point to a line in 3D?
A:
To find the foot of the perpendicular from point P to line L:
Q: What is the significance of the vector cross product in relation to lines in 3D?
A:
The cross product of two vectors is perpendicular to both vectors. In the context of 3D lines, the cross product of two direction vectors gives a normal vector to the plane containing both lines, which is useful in determining if lines are skew or coplanar.