To find the equation of a line in the $x$-$y$ plane, we need two pieces of information: a point and the slope. The slope conveys direction information. As vertical lines have an undefined slope, the following statement is more accurate:

This holds true for lines in space.

Let $P$ be a point in space, let $\vec p$ be the vector with initial point at the origin and terminal point at $P$ (i.e., $\vec p$ “points” to $P$), and let $\vec d$ be a vector. Consider the points on the line through $P$ in the direction of $\vec d\text{.}$

Clearly one point on the line is $P\text{;}$ we can say that the vector $\vec p$ lies at this point on the line. To find another point on the line, we can start at $\vec p$ and move in a direction parallel to $\vec d\text{.}$ For instance, starting at $\vec p$ and traveling one length of $\vec d$ places one at another point on the line. Consider Figure 10.5.1 where certain points along the line are indicated.

The figure illustrates how every point on the line can be obtained by starting with $\vec p$ and moving a certain distance in the direction of $\vec d\text{.}$ That is, we can define the line as a function of $t\text{:}$ \begin{equation} \vec\ell(t) = \vec p + t\ \vec d. \label{eq_lines1}\tag{10.5.1} \end{equation}

In many ways, this is not a new concept. Compare Equation (10.5.1) to the familiar “$y=mx+b$” equation of a line:

\captionof{figure}{Understanding the vector equation of a line.} The equations exhibit the same structure: they give a starting point, define a direction, and state how far in that direction to travel.

Equation (10.5.1) is an example of a vector–valued function; the input of the function is a real number and the output is a vector. We will cover vector–valued functions extensively in the next chapter.

There are other ways to represent a line. Let $\vec p = \la x_0,y_0,z_0\ra$ and let $\vec d = \la a,b,c\ra\text{.}$ Then the equation of the line through $\vec p$ in the direction of $\vec d$ is: \begin{align*} \vec\ell(t) \amp = \vec p + t\vec d\\ \amp = \la x_0,y_0,z_0\ra + t\la a,b,c\ra\\ \amp = \la x_0 + at, y_0+bt, z_0+ct\ra. \end{align*}

The last line states that the $x$ values of the line are given by $x=x_0+at\text{,}$ the $y$ values are given by $y = y_0+bt\text{,}$ and the $z$ values are given by $z = z_0 + ct\text{.}$ These three equations, taken together, are the parametric equations of the line through $\vec p$ in the direction of $\vec d\text{.}$

Finally, each of the equations for $x\text{,}$ $y$ and $z$ above contain the variable $t\text{.}$ We can solve for $t$ in each equation: \begin{align*} x = x_0+at \amp \Rightarrow t=\frac{x-x_0}{a},\\ y=y_0+bt \amp \Rightarrow t = \frac{y-y_0}{b},\\ z = z_0+ct \amp \Rightarrow t = \frac{z-z_0}{c}, \end{align*} assuming $a,b,c\neq 0\text{.}$ Since $t$ is equal to each expression on the right, we can set these equal to each other, forming the symmetric equations of the line through $\vec p$ in the direction of $\vec d\text{:}$ \begin{equation*} \frac{x-x_0}{a} = \frac{y-y_0}{b}=\frac{z-z_0}{c}. \end{equation*}

Each representation has its own advantages, depending on the context. We summarize these three forms in the following definition, then give examples of their use.

##### Definition10.5.2Equations of Lines in Space

Consider the line in space that passes through $\vec p = \la x_0,y_0,z_0\ra$ in the direction of $\vec d = \la a,b,c\ra\text{.}$

1. The vector equation of the line is \begin{equation*} \vec \ell(t) = \vec p+t\vec d. \end{equation*}

2. The parametric equations of the line are \begin{equation*} x = x_0+at, y=y_0+bt, z = z_0+ct . \end{equation*}

3. The symmetric equations of the line are \begin{equation*} \frac{x-x_0}{a} = \frac{y-y_0}{b}=\frac{z-z_0}{c}. \end{equation*}

##### Example10.5.3Finding the equation of a line

Give all three equations, as given in Definition 10.5.2, of the line through $P = (2,3,1)$ in the direction of $\vec d = \la -1,1,2\ra\text{.}$ Does the point $Q=(-1,6,6)$ lie on this line?

Solution
##### Example10.5.5Finding the equation of a line through two points

Find the parametric equations of the line through the points $P=(2,-1,2)$ and $Q = (1,3,-1)\text{.}$

Solution

Parallel, Intersecting and Skew Lines

In the plane, two distinct lines can either be parallel or they will intersect at exactly one point. In space, given equations of two lines, it can sometimes be difficult to tell whether the lines are distinct or not (i.e., the same line can be represented in different ways). Given lines $\vec\ell_1(t) = \vec p_1 + t\vec d_1$ and $\vec \ell_2(t) = \vec p_2+t\vec d_2\text{,}$ we have four possibilities: $\vec \ell_1$ and $\vec \ell_2$ are

The next two examples investigate these possibilities.

##### Example10.5.7Comparing lines

Consider lines $\ell_1$ and $\ell_2\text{,}$ given in parametric equation form: \begin{equation*} \ell_1: \begin{array}{ccc} x\amp =\amp 1+3t \\ y\amp =\amp 2-t\\z\amp =\amp t \end{array} \qquad\qquad \ell_2:\begin{array}{ccc} x\amp =\amp -2+4s\\y\amp =\amp 3+s\\z\amp =\amp 5+2s. \end{array} \end{equation*}

Determine whether $\ell_1$ and $\ell_2$ are the same line, intersect, are parallel, or skew.

Solution
##### Example10.5.9Comparing lines

Consider lines $\ell_1$ and $\ell_2\text{,}$ given in parametric equation form: \begin{equation*} \ell_1: \begin{array}{ccc} x\amp =\amp -0.7+1.6t \\ y\amp =\amp 4.2+2.72t\\z\amp =\amp 2.3-3.36t \end{array} \qquad\qquad \ell_2:\begin{array}{ccc} x\amp =\amp 2.8-2.9s\\y\amp =\amp 10.15-4.93s\\z\amp =\amp -5.05+6.09s. \end{array} \end{equation*}

Determine whether $\ell_1$ and $\ell_2$ are the same line, intersect, are parallel, or skew.

Solution

# Subsection10.5.1Distances

Given a point $Q$ and a line $\vec\ell(t) = \vec p+t\vec d$ in space, it is often useful to know the distance from the point to the line. (Here we use the standard definition of “distance,” i.e., the length of the shortest line segment from the point to the line.) Identifying $\vec p$ with the point $P\text{,}$ Figure 10.5.11 will help establish a general method of computing this distance $h\text{.}$

From trigonometry, we know $h = \norm{\vv{PQ}}\sin(\theta)\text{.}$ We have a similar identity involving the cross product: $\norm{\vv{PQ}\times \vec d} = \norm{\vv{PQ}}\, \vnorm{d}\sin(\theta)\text{.}$ Divide both sides of this latter equation by $\vnorm{d}$ to obtain $h\text{:}$ \begin{equation} h = \frac{\norm{\vv{PQ}\times \vec d}}{\vnorm{d}}. \label{eq_lines2}\tag{10.5.2} \end{equation}

It is also useful to determine the distance between lines, which we define as the length of the shortest line segment that connects the two lines (an argument from geometry shows that this line segments is perpendicular to both lines). Let lines $\vec\ell_1(t) = \vec p_1 + t\vec d_1$ and $\vec\ell_2(t) = \vec p_2 + t\vec d_2$ be given, as shown in Figure 10.5.12. To find the direction orthogonal to both $\vec d_1$ and $\vec d_2\text{,}$ we take the cross product: $\vec c = \vec d_1\times \vec d_2\text{.}$ The magnitude of the orthogonal projection of $\vv{P_1P_2}$ onto $\vec c$ is the distance $h$ we seek: \begin{align*} h\amp = \snorm{\text{ proj } \,_{\vec c}\,\vv{P_1P_2}}\\ \amp = \snorm{\frac{\vv{P_1P_2}\cdot\vec c}{\dotp cc}\vec c}\\ \amp =\frac{\abs{\vv{P_1P_2}\cdot \vec c}}{\vnorm c^2}\vnorm c\\ \amp =\frac{\abs{\vv{P_1P_2}\cdot \vec c}}{\vnorm c}. \end{align*}

A problem in the Exercise section is to show that this distance is 0 when the lines intersect. Note the use of the Triple Scalar Product: $\vv{P_1P_2}\cdot c = \vv{P_1P_2}\cdot (\vec d_1\times \vec d_2)\text{.}$

The following Key Idea restates these two distance formulas.

##### Key Idea10.5.13Distances to Lines
1. Let $P$ be a point on a line $\ell$ that is parallel to $\vec d\text{.}$ The distance $h$ from a point $Q$ to the line $\ell$ is: \begin{equation*} h =\frac{\norm{\vv{PQ}\times \vec d}}{\vnorm{d}}. \end{equation*}

2. Let $P_1$ be a point on line $\ell_1$ that is parallel to $\vec d_1\text{,}$ and let $P_2$ be a point on line $\ell_2$ parallel to $\vec d_2\text{,}$ and let $\vec c = \vec d_1\times \vec d_2\text{,}$ where lines $\ell_1$ and $\ell_2$ are not parallel. The distance $h$ between the two lines is: \begin{equation*} h=\frac{\abs{\vv{P_1P_2}\cdot \vec c}}{\vnorm c}. \end{equation*}

##### Example10.5.14Finding the distance from a point to a line

Find the distance from the point $Q=(1,1,3)$ to the line $\vec\ell(t) = \la 1,-1,1\ra+t\la 2,3,1\ra\text{.}$

Solution
##### Example10.5.15Finding the distance between lines

Find the distance between the lines \begin{equation*} \ell_1: \begin{array}{ccc} x\amp =\amp 1+3t \\ y\amp =\amp 2-t\\z\amp =\amp t \end{array} \qquad\qquad \ell_2:\begin{array}{ccc} x\amp =\amp -2+4s\\y\amp =\amp 3+s\\z\amp =\amp 5+2s. \end{array} \end{equation*}

Solution

One of the key points to understand from this section is this: to describe a line, we need a point and a direction. Whenever a problem is posed concerning a line, one needs to take whatever information is offered and glean point and direction information. Many questions can be asked (and are asked in the Exercise section) whose answer immediately follows from this understanding.

Lines are one of two fundamental objects of study in space. The other fundamental object is the plane, which we study in detail in the next section. Many complex three dimensional objects are studied by approximating their surfaces with lines and planes.

# Subsection10.5.2Exercises

Terms and Concepts

In the following exercises, write the vector, parametric and symmetric equations of the lines described.

In the following exercises, determine if the described lines are the same line, parallel lines, intersecting or skew lines. If intersecting, give the point of intersection.

In the following exercises, find the distance from the point to the line.

In the following exercises, find the distance between the two lines.

The following exercises explore special cases of the distance formulas found in Key Idea 10.5.13.