# Equation of Line in 3D

If you have ever played video games, you may not know it, but under the hood is a heap of 3D geometry being used to give you the best experience. Just one example of this is ray tracing: a method of simulating light within video games to make it seem natural. Ray tracing is done by modelling lots of rays of light coming in a straight line from the light source, and seeing which targets they hit. This allows the positions of shadows and reflections to be calculated accurately, to make an immersive, realistic-looking world. This is just one example of how 3D geometry, and in particular 3D lines, are used in everyday life.

#### Create learning materials about Equation of Line in 3D with our free learning app!

• Flashcards, notes, mock-exams and more
• Everything you need to ace your exams

## Parametric and Vector Equations for a Line in 3D

Before you tackle the parametric and vector forms of a line in 3D, it is important to fully understand how vectors work.

### Position and Direction Vectors

A vector is a mathematical object that has both direction and magnitude. They can be written in two forms:

• Column vector form: $$\begin{bmatrix} x \\ y \\ z \end{bmatrix}.$$

• Unit vector form: $$x \vec{i} + y \vec{j} + z \vec{k}.$$

Fig. 1. A vector can be thought of as an arrow, pointing from one place to another.

A position vector is a vector representing a point in space, just like coordinates, while a direction vector represents a movement. If you move by a direction vector from the origin, you will reach the point of its corresponding position vector.

Vectors can be added and subtracted by adding or subtracting the individual components. In column form, that means adding the first entries in each vector for the first entry in the new vector, and adding the second entries in each vector for the second entry in the new vector, and so on. In unit vector form, this just means adding and subtracting the like terms as you would with any other algebraic equation.

Vectors can also be multiplied by scalars, by multiplying each of the individual components by the scalar. For a column vector, this just means multiplying each entry by the scalar. For a vector in unit vector form, this just means expanding the brackets in the usual way. For more information, see Core Vectors.

### Parametric Equation of a Line in 3D

The parametric equations for a straight line in 3 dimensions are:\begin{align} x & = a_1 + t b_1 \\ y & = a_2 + t b_2 \\ z & = a_3 + t b_3 \end{align}

where

$\begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix}$

is the position vector for a point on the line, and

$\begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix}$

is the direction vector of the line, and $$t$$ is a scalar variable.

From this parametric definition, a vector form for a straight line in 3D can be obtained.

### Vector Equation of a Line in 3D

If you define

$\vec{r} = \begin{bmatrix} x \\ y\\ z\end{bmatrix}, \vec{a} = \begin{bmatrix} a_1 \\ a_2 \\a_3 \end{bmatrix}, \vec{b} = \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix}$

then the parametric form can be written in one simple vector equation, known as the vector form of a line in 3D:

$\vec{r} = \vec{a} + t \vec{b},$

which can be written in column vector form as:

$\begin{bmatrix} x \\ y\\ z \end{bmatrix} = \begin{bmatrix} a_1\\a_2\\a_3 \end{bmatrix} + t \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix}.$

## Cartesian Equation of a Line in 3D

There is also a Cartesian Equation for a line in 3 dimensions. With the same parameters as for the parametric definition, the Cartesian Equation for a line in 3D is:

$\frac{ x - a_1}{b_1} = \frac{y-a_2}{b_2} = \frac{z-a_3}{b_3}.$

This formula only works if the components of the direction vector are non-zero.

The Cartesian Equation for a line in 3D can be derived using the parametric form of the line in 3D. The parametric form of a line in 3D is:

\begin{align} x & = a_1 + t b_1 \\ y & = a_2 + t b_2 \\ z & = a_3 + t b_3. \end{align}

Subtract the $$a$$ term from each of the equations to get:

\begin{align} x - a_1 & = t b_1 \\ y - a_2 & = t b_2 \\ z - a_3 & = t b_3. \end{align}

Now, assuming that all the $$b$$ terms are non zero, divide by the $$b$$ term in each equation:

\begin{align} \frac{x-a_1}{b_1} &= t \\ \frac{y-a_2}{b_2} &= t \\ \frac{z - a_3}{b_3} &= t. \end{align}

By setting all of these equations as equal to each other, you will get the Cartesian form:

$\frac{ x - a_1}{b_1} = \frac{y-a_2}{b_2} = \frac{z-a_3}{b_3}.$

This method allows you to see a pair of Cartesian Equations defines a straight line in 3D. This occurs if one of the $$b$$ values is 0. If, for example, $$b_1$$ is 0, the equations:

$\frac{y-a_2}{b_2} = \frac{z-a_3}{b_3},\quad x = a_1$

will define the line. This method does not work if two of the $$b$$ values are 0 though, as then only one equation has $$t$$ left in it, so you cannot set the equations equal to each other. In this case, a Cartesian form does not exist.

## Equation of a Straight Line in 3D Passing Through Two Points

Given two points $$\vec{a}$$ and $$\vec{b},$$ the vector form of a straight line between them will be:

$\vec{r} = \vec{a} + t (\vec{a} - \vec{b}).$

This is because the direction vector between two position vectors is the subtraction of one of the vectors from the other. It doesn't matter which vector you use as the position vector, nor which order you take the subtraction in for the direction vector side. All this will affect is which values of $$t$$ correspond to which points on the line.

### Skew, Parallel and Intersecting Lines

In 2D space, if two different lines do not intersect, they must be parallel. In 3D space, it is possible for non-parallel lines to not intersect as well: these lines are called Skew lines.

Two lines are skewed if they are non-parallel and non-intersecting.

Fig. 2. These 2 lines do not intersect but are also not parallel. This means they must be skew.

Above is an example of skewed lines. Two lines in 3D will be parallel if their direction vectors are scalar multiples of one another.

Fig. 3. These lines do not intersect but are going in the same direction, so they must be parallel.

To see if lines intersect, you can set them as equal to each other, giving three simultaneous equations in two variables. If all of these equations are solved for the same values, the lines intersect. If there are any contradictions, the lines do not intersect and must be parallel or skew.

Fig. 4. These lines intersect.

Let's see some examples, where you must determine whether lines are skewed, parallel, or intersecting. The first example gives the lines in Euclidean form.

Determine whether the following lines intersect. If they intersect, find the point of intersection. If they do not intersect, determine whether they are skewed or parallel.

\begin{align} \vec{r}_1: \frac{x-2}{2} & = \frac{y+4}{3} = z-8 \\ \vec{r}_2: \frac{x+1}{6} & = \frac{y}{9} = \frac{z-9}{3} \end{align}

Solution

The first step is to determine if these are parallel. This is because it's much quicker to determine whether lines are parallel than it is to determine whether the lines intersect or not. To determine if they are parallel, you must find the direction vectors, or the $$\vec{b}$$ vector from your formulas.

If you look at the Euclidean formula for a line, you'll see that the direction vectors make up the denominator of the fractions, so $$b_1$$ is the denominator of the $$x$$ term, $$b_2$$ is the denominator of the $$y$$ term, and $$b_3$$ is the denominator of the $$z$$ term. Hence, the direction vector for the first line is:

$\begin{bmatrix} 2 \\ 3\\ 1 \end{bmatrix}$

and the direction vector the the second line is:

$\begin{bmatrix} 6 \\9\\3 \end{bmatrix}.$

You can see that if you multiply the first direction vector by 3, you will get the second direction vector. This means that the two lines must be parallel, since the direction vectors are pointing in the same direction.

This next example will give the lines in vector form.

Determine whether the following lines intersect. If they intersect, find the point of intersection. If they do not intersect, determine whether they are skewed or parallel.

\begin{align} \vec{r}_1 & = \begin{bmatrix} 2 \\ -4 \\ 3 \end{bmatrix} + t \begin{bmatrix} 3 \\ 11 \\ -2 \end{bmatrix} \\ \vec{r}_2 & = \begin{bmatrix} 1 \\ 6 \\ 3 \end{bmatrix} + s \begin{bmatrix} 4 \\ 1\\ -2 \end{bmatrix}. \end{align}

Solution

Firstly, you can tell the lines are not parallel since the direction vectors are not multiples of one another. This means that they must either intersect or be skewed. To determine this, first set the equations equal to one another:

$\begin{bmatrix} 2 \\ -4 \\ 3 \end{bmatrix} + t \begin{bmatrix} 3 \\ 11 \\ -2 \end{bmatrix} = \begin{bmatrix} 1 \\ 6 \\ 3 \end{bmatrix} + s \begin{bmatrix}4 \\ 1\\ -2 \end{bmatrix}.$

This will give you three equations:

\begin{align} 2 + 3t = 1 + 4s & \quad \implies\quad 3t - 4s = -1 \\ -4 + 11t = 6 + s & \quad \implies \quad 11t - s = 10 \\ 3 -2t = 3 -2s & \quad \implies \quad t = s. \end{align}

You have to decide on which two equations you are going to solve first. Here, it looks easiest to use the third equation since it is already in a very simple form. So for this example, let's use the second and third equations. Plugging the third equation into the second equation will give you:

\begin{align} 11t - t &= 10 \\ 10 t &= 10 \\ t &= 1.\end{align}

Since you have from the third equation that $$t = s,$$ it must be that $$s = 1$$ as well. So the solution to your simultaneous equations are $$t = s = 1.$$

Now, to check whether the lines intersect, plug these values into the first equation. If the equation is true, the lines intersect. If it is not true, the lines do not intersect. Checking, you see that

\begin{align} 3t - 4 s &= 3 - 4 \\ &= -1, \end{align}

which is the required result. Hence, the lines must intersect. To find the point of intersection, simply plug $$t$$ or $$s$$ into their corresponding vector line equations. Plugging $$t=1$$ into the first equation will get:

\begin{align} \vec{r_1} & = \begin{bmatrix} 2 \\ -4 \\ 3 \end{bmatrix} + 1 \cdot \begin{bmatrix} 3 \\ 11 \\ -2 \end{bmatrix} \\ & = \begin{bmatrix} 5 \\ 7 \\ 1 \end{bmatrix} .\end{align}

So the lines intersect at the point $$(5, 7, 1).$$

Let's look at one final example of a question like this, this time with the line in parametric form.

Determine whether the following lines intersect. If they intersect, find the point of intersection. If they do not intersect, determine whether they are skewed or parallel.

Line 1:

\begin{align} x & = 11 - 10t \\ y & = 2 - 7t \\ z & = 3. \end{align}

Line 2:

\begin{align} x & = 1 + 2s \\ y & = 1 + 6s \\ z & = 1 - 2 s. \end{align}

Solution

First, determine if the lines are parallel. Since this isn't in vector form, you need to create the direction vectors to be able to check this. The direction vectors here will be made using the coefficient of the scalar terms $$t$$ and $$s$$.

The direction vector for Line 1 is:

$\begin{bmatrix} -10 \\ -7 \\ 0 \end{bmatrix},$

and the direction vector for Line 2 is:

$\begin{bmatrix} 2 \\ 6 \\ -2 \end{bmatrix}.$

There is no way that these could be parallel because no scalar is able to make the $$0$$ in the last position of the first direction vector become $$-2$$. Since these lines are not parallel, they must either be skewed or intersect. To find this out, start by setting each of the parametric equations equal:

\begin{align} 11 - 10t = 1 + 2s & \quad \implies \quad -10t - 2s = -10 \\ 2 - 7t = 1 + 6s & \quad \implies \quad -7t -6s = -1 \\ 3 = 1 - 2s & \quad \implies\quad s = -1. \end{align}

Again, you must decide which two equations to solve first. Again, let's use the second and third equations. Substituting the third equation into the second equation will get:

\begin{align} -7t + 6 &= -1\\ t &= \frac{5}{7}. \end{align}

Now that you have both $$t$$ and $$s$$, you can substitute these back into the equation $$-10t - 2s = -10$$. If it is true, the lines intersect, and if it is false, the lines must be skewed, since you showed that they are not parallel. Since

\begin{align} -10t - 2s &= -10 \cdot \frac{5}{7} - 2 \cdot -1 \\ &= -\frac{50}{7} + 2 \\ &= \frac{64}{7} \\ & \neq -10, \end{align}

the lines must be skewed.

## Equation of a Line Parallel to the $$x$$-axis in 3D

To create a line parallel to the $$x$$-axis, you need a direction vector parallel to the $$x$$-axis. This is simply the standard unit vector, $$\vec{i}.$$ Hence, for any position vector $$\vec{a},$$ the vector equation for a line passing through $$\vec{a}$$ that is parallel to the $$x$$-axis is:

$\vec{r} = \vec{a} + t \vec{i}.$

The parametric equations of this line will be:

\begin{align} x & = a_1 + t \\ y & = a_2 \\ z & = a_3. \end{align}

Since both the $$y$$ and $$z$$ components of the direction vector are $$0$$, there is no Cartesian form of this line.

## Equation of a Line Parallel to the $$z$$-axis in 3D

Finding a line parallel to the $$z$$-axis in 3D works exactly the same way as the line parallel to the $$x$$-axis from the previous section, but replacing $$\vec{i}$$ with $$\vec{k}.$$ Hence, for any position vector $$\vec{a},$$ the vector equation for a line passing through $$\vec{a}$$ that is parallel to the $$z$$-axis is:

$\vec{r} = \vec{a} + t \vec{k}.$

The parametric equations of this line will be:

\begin{align} x& = a_1 \\ y & = a_2 \\ z& = a_3+t. \end{align}

Since both the $$x$$ and $$y$$ components of the direction vector are $$0$$, there is no Cartesian form of this line.

## Equation of Line in 3D - Key takeaways

• A line in 3D can be defined in 3 different ways:
• Parametric Form: \begin{align} x & = a_1 + t b_1 \\ y & = a_2 + t b_2 \\ z & = a_3 + t b_3 \end{align}
• Vector Form: $$\begin{bmatrix} x \\ y\\ z \end{bmatrix} = \begin{bmatrix} a_1\\a_2\\a_3 \end{bmatrix} + t \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix}.$$
• Cartesian Form: $$\dfrac{ x - a_1}{b_1} = \dfrac{y-a_2}{b_2} = \dfrac{z-a_3}{b_3},$$ assuming none of the $$\vec{b}$$ values are $$0$$.
• Two lines are parallel if one of the direction vectors is a scalar multiple of the other.
• Two lines intersect If you can set the parametric equations of two lines equal to each other, solve them simultaneously and get no contradictions.
• Two lines are skew if they are not parallel and do not intersect.

#### Flashcards in Equation of Line in 3D 15

###### Learn with 15 Equation of Line in 3D flashcards in the free StudySmarter app

We have 14,000 flashcards about Dynamic Landscapes.

What is the equation of a line in 3D?

A line in 3D can be defined in vector form or Cartesian form. If the line goes through the point = a1i + a2j + a3k with direction vector b = b1i + b2j+ b3k, then the line can be written:

Vector Form: = + t b, where r = xi + yj + ck,

Cartesian Form: (x - a1)/b1 = (y - a2)/b2 = (z - a3)/b3.

How do you find the equation of a line with 2 points in 3D?

If a and b are the position vectors of the 2 points, then the straight line connecting them can be defined in vector form as:

= + t (B).

What is parametric equation of line in 3D?

The parametric equations for a straight line in 3D that passes through the point a = (a1, a2, a3) and has direction vector b = b1i + b2j+ b3k are:

x = a1 + t b1

y = a2 + t b2

z = a3 + t b3.

Can a line exist in 3D?

Yes, a line can exist in 3. A line passing through through the point = a1i + a2j + a3k with direction vector b = b1i + b2j+ b3k, then the line can be written as:

Vector Form: = + t b, where r = xi + yj + ck,

Cartesian Form: (x - a1)/b1 = (y - a2)/b2 = (z - a3)/b3.

What is the slope of a line in 3D?

In 3D, there is no exact "slope" of a straight line, so instead the direction vector determines which direction the line is going.

StudySmarter is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.

##### StudySmarter Editorial Team

Team Math Teachers

• Checked by StudySmarter Editorial Team