Table of Contents
Chapter 3: Vectors and geometry
Recall that a $2\times 1$ column vector such as $\def\m#1{\begin{bmatrix}#1\end{bmatrix}}\m{4\\3}$ is a pair of numbers written in a column. We are also used to writing points in the plane $\mathbb R^2$ as a pair of numbersl; for example $(4,3)$ is the point obtained by starting from the origin, and moving $4$ units to the right and $3$ units up.
We think of a (column) vector like $\vec v=\m{4\\3}$ as an instruction to move $4$ units to the right and $3$ units up. This movement is called “translation by $\vec v$”.
Examples
The vector $\vec v=\m{4\\3}$ moves:
- $(0,0)$ to $(4,3)$
- $(-2,6)$ to $(2,9)$
- $(x,y)$ to $(x+4,y+3)$.
It is convenient to not be too fussy about the difference between a point like $(4,3)$ and the vector $\m{4\\3}$. If we agree to write points as column vectors, then we can perform algebra (addition, subtraction, scalar multiplication) as discussed in Chapter 2, using points and column vectors.
For example, we could rewrite the examples above by saying that $\vec v=\m{4\\3}$ moves:
- $\m{0\\0}$ to $\m{0\\0}+\m{4\\3}=\m{4\\3}$
- $\m{-2\\6}$ to $\m{-2\\6}+\m{4\\3}=\m{2\\9}$
- $\m{x\\y}$ to $\m{x\\y}+\m{4\\3}=\m{x+4\\y+3}$.
More generally: a column vector $\vec v$ moves a point $\vec x$ to $\vec x+\vec v$.
Example
Which vector moves the point $A=(-1,3)$ to $B=(5,-4)$?
Answer: we need a vector $\vec v$ with $A+\vec v=B$, so $\vec v=B-A = \m{5\\-4}-\m{-1\\3}=\m{6\\-7}$. We write $\vec{AB}=\m{6\\-7}$, since this is the vector which moves $A$ to $B$.
Definition of $\vec{AB}$
If $A$ and $B$ are any points in $\mathbb{R}^n$, then the vector $\vec{AB}$ is defined by \[ \vec{AB}=B-A\] (where on the right hand side, we interpret the points as column vectors so we can subtract them to get a column vector).
Thus $\vec{AB}$ is the vector which moves the point $A$ to the point $B$.
Example
In $\mathbb{R}^3$, the points $A=(3,-4,5)$ and $B=(11,6,-2)$ have $\vec{AB}=\m{11\\6\\-2}-\m{3\\-4\\5}=\m{8\\10\\-7}$.
The uses of vectors
Vectors are used in geometry and science to represent quantities with both a magnitude (size/length) and a direction. For example:
- displacements (in geometry)
- velocities
- forces
Recall that a column vector moves points. Its magnitude, or length, is how far it moves points.
Definition: the length of a vector
If $\vec v=\m{v_1\\v_2\\\vdots\\v_n}$ is a column vector in $\mathbb{R}^n$, then its magnitude, or length, or norm, is the number \[ \|\vec v\|=\sqrt{v_1^2+v_2^2+\dots+v_n^2}.\]
Examples
- $\left\|\m{4\\3}\right\|=\sqrt{4^2+3^2}=\sqrt{16+9}=\sqrt{25}=5$
- $\left\|\m{1\\0\\-2\\3}\right\|=\sqrt{1^2+0^2+(-2)^2+3^2}=\sqrt{1+0+4+9}=\sqrt{14}$
Exercise
Prove that if $c\in \mathbb{R}$ is a scalar and $\vec v$ is a vector in $\mathbb{R}^n$, then \[ \|c\vec v\|=|c|\,\|\vec v\|.\] That is, multiplying a vector by a scalar $c$ scales its length by $|c|$, the absolute value of $c$.
The dot product
Definition of the dot product
Let $\def\m#1{\left[\begin{smallmatrix}#1\end{smallmatrix}\right]}\vec v=\m{v_1\\v_2\\\vdots\\v_n}$ and $\vec w=\m{w_1\\w_2\\\vdots\\w_n}$ be two vectors in $\mathbb{R}^n$.
The dot product of $\vec v$ and $\vec w$ is the number $\vec v\cdot \vec w$ given by \[ \color{red}{\vec v\cdot\vec w=v_1w_1+v_2w_2+\dots+v_nw_n}.\]
Note that while $\vec v$ and $\vec w$ are vectors, their dot product $\vec v\cdot \vec w$ is a scalar.
Example
If $\vec v=\m{3\\5}$ and $\vec w=\m{4\\-7}$, then $\vec v\cdot \vec w=\m{3\\5}\cdot \m{4\\-7} = 3(4)+5(-7)=-23$.
Properties of the dot product
For any vectors $\vec v$, $\vec w$ and $\vec u$ in $\mathbb{R}^n$, and any scalar $c\in \mathbb{R}$:
- $\def\dp#1#2{\vec #1\cdot \vec #2}\dp vw=\dp wv$ (the dot product is commutative)
- $\vec u\cdot(\vec v+\vec w)=\dp uv+\dp uw$
- $(c\vec v)\cdot \vec w=c(\dp vw)$
- $\dp vv=\|\vec v\|^2\ge 0$, and $\dp vv=0 \iff \vec v=0_{n\times 1}$
The proofs of these properties are exercises.
Angles and the dot product
Theorem: the relationship between angle and the dot product
If $\vec v$ and $\vec w$ are non-zero vectors in $\mathbb{R}^n$, then \[ \dp vw=\|\vec v\|\,\|\vec w\|\,\cos\theta\] where $\theta$ is the angle between $\vec v$ and $\vec w$.
The proof will be given soon, but for now here is an example.
Example
If $\vec v=\m{1\\2}$ and $\vec w=\m{-2\\1}$, then $\dp vw=1(-2)+2(1)=-2+2=0$. On the other hand, we have $\|\vec v\|=\sqrt5=\|\vec w\|$, so the angle $\theta$ between $\vec v$ and $\vec w$ satisfies \[ 0=\dp vw=\sqrt 5\times \sqrt 5 \times \cos\theta\] so $5\cos\theta=0$, so $\cos\theta=0$, so $\theta=\pi/2$ or $\theta=3\pi/2$ (measuring angles in radians). This tells us that the angle between $\vec v$ and $\vec w$ is a right angle. We say that these vectors are orthogonal. We can draw a convincing picture which indicates that these vectors are indeed at right angles:
Proof of the Theorem
We wish to show that $\def\vv{\vec v} \def\ww{\vec w}\vv\cdot\ww=\|\vv\|\,\|\ww\|\cos\theta$ where $\theta$ is the angle between $\vv$ and $\ww$.
Recall the cosine rule:
Consider a triangle with two sides $\vv$ and $\ww$. By the triangle rule for vector addition, the third side $\vec x$ has $\ww+\vec x=\vv$, so $\vec x=\vv-\ww$:
Applying the cosine rule gives \[ \|\vv-\ww\|^2=\|\vv\|^2+\|\ww\|^2-2\|\vv\|\,\|\ww\|\,\cos\theta.\] On the other hand, we know that $\|\vec x\|^2=\vec x\cdot\vec x$, so \begin{align*}\|\vv-\ww\|^2&=(\vv-\ww)\cdot(\vv-\ww)\\&=\vv\cdot\vv+\ww\cdot\ww-\ww\cdot\vv-\vv\cdot\ww\\&=\|\vv\|^2+\|\ww\|^2-2\vv\cdot\ww.\end{align*} So \[\|\vv\|^2+\|\ww\|^2-2\|\vv\|\,\|\ww\|\,\cos\theta=\|\vv\|^2+\|\ww\|^2-2\vv\cdot\ww\cos\theta.\] Subtracting $\|\vv\|^2+\|\ww\|^2$ from both sides and dividing by $-2$ gives $\vv\cdot\ww=\|\vv\|\,\|\ww\|\cos\theta$. ■
Corollary
If $\vv$ and $\ww$ are non-zero vectors and $\theta$ is the angle between them, then $\cos\theta=\displaystyle\frac{\vv\cdot\ww}{\|\vv\|\,\|\ww\|}$.
Corollary
If $\vv$ and $\ww$ are non-zero vectors with $\vv\cdot\ww=0$, then $\vv$ and $\ww$ are orthogonal: they are at right-angles.
Examples
- The angle $\theta$ between $\def\c#1#2{\begin{bmatrix}#1\\#2\end{bmatrix}}\c12$ and $\c3{-4}$ has \[ \cos\theta=\frac{\c12\cdot\c3{-4}}{\left\|\c12\right\|\,\left\|\c3{-4}\right\|} =\frac{3-8}{\sqrt5\sqrt{25}}=-\frac1{\sqrt5},\] so $\theta=\cos^{-1}(-1/\sqrt5) \approx 2.03\,\text{radians}\approx 116.57^\circ$.
- The points $A=(2,3)$, $B=(3,6)$ and $C=(-4,5)$ are the vertices of a right-angled triangle. Indeed, we have $\vec{AB}=\c36-\c23=\c13$ and $\vec{AC}=\c{-4}5-\c23=\c{-6}2$, so $\vec{AB}\cdot\vec{AC}=\c13\cdot\c{-6}2=1(-6)+3(2)=0$, so the sides $AB$ and $AC$ are at right-angles.
- To find a unit vector orthogonal to the vector $\vv=\c12$, we can first observe that $\ww=\c{-2}1$ has $\vv\cdot\ww=0$, so $\vv$ and $\ww$ are orthogonal; and then consider the vector $\vec u=\frac1{\|\ww\|}\ww$, which is a unit vector in the same direction as $\ww$, so is also orthogonal to $\vv$. Hence $\vec u=\frac1{\sqrt5}\c{-2}1=\c{-2/\sqrt5}{1/\sqrt5}$ is a unit vector orthogonal to $\vv=\c12$.
The orthogonal projection of one vector onto another
Let $\def\ww{\vec{w}}\def\vv{\vec{v}}\def\uu{\vec{u}}\ww$ be a non-zero vector, and let $\vv$ be any vector. We call a vector $\def\pp{\vec p}\def\nn{\vec{n}}\pp$ the orthogonal projection of $\vv$ onto $\ww$, and write $\pp=\def\ppp{\text{proj}_{\ww}\vv}\ppp$, if
- $\pp$ is in the same direction as $\ww$; and
- the vector $\nn=\vv-\pp$ joining the end of $\pp$ to the end of $\vv$ is orthogonal to $\ww$.
We can use these properties of $\pp$ to find a formula for $\pp$ in terms of $\vv$ and $\ww$.
- Since $\pp$ is in the same direction as $\ww$, we have $\pp=c\ww$ for some scalar $c\in \mathbb{R}$.
- Since $\nn=\vv-\pp$ is orthogonal to $\ww$, we have $\nn\cdot \ww=0$. Hence \begin{align*}&&(\vv-\pp)\cdot \ww&=0\\&\implies& \vv\cdot\ww-\pp\cdot\ww&=0\\&\implies& \pp\cdot\ww&=\vv\cdot\ww\\&\implies& c\ww\cdot \ww&=\vv\cdot\ww\\&\implies& c\|\ww\|^2&=\vv\cdot\ww\\&\implies& c&=\frac{\vv\cdot\ww}{\|\ww\|^2}.\end{align*}
So we obtain the orthogonal projection formula: \[ \pp=\ppp=\frac{\vv\cdot\ww}{\|\ww\|^2}\ww.\]
We call $\nn=\vv-\ppp$ the component of $\vv$ orthogonal to $\ww$.
Example
If $\def\vv{\vec v}\def\pp{\vec p}\def\ppp{\text{proj}_{\ww}\vv}\def\ww{\vec w}\def\nn{\vec n}\vv=\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c12{-1}$ and $\ww=\c2{-1}4$, then \begin{align*}\ppp&=\frac{\vv\cdot\ww}{\|\ww\|^2}\ww\\&=\frac{2-2-4}{2^2+(-1)^2+4^2}\c2{-1}4\\&=-\frac4{21}\c2{-1}4\end{align*} and the component of $\vv$ orthogonal to $\ww$ is \begin{align*}\nn&=\vv-\ppp\\&=\c12{-1}-\left(-\frac4{21}\right)\c2{-1}4\\&=\c12{-1}+\c{8/21}{-4/21}{16/21}\\&=\c{29/21}{38/21}{-5/21}.\end{align*}
The cross product of vectors in $\mathbb{R}^3$
Definition: the standard basis vectors
We define $\def\i{\vec \imath}\i=\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c100$, $\def\j{\vec \jmath}\j=\c010$ and $\def\k{\vec k}\k=\c001$. These are the standard basis vectors of $\mathbb{R}^3$.
Note that any vector $\vec v=\c{v_1}{v_2}{v_3}$ may be written as a linear combination of these vectors (that is, a sum of scalar multiplies of $\i$, $\j$ and $\k$), since \[ \def\vc#1{\c{#1_1}{#1_2}{#1_3}}\vec v=\vc v=\c{v_1}{0}{0}+\c{0}{v_2}{0}+\c{0}{0}{v_3} = v_1\i+v_2\j+v_3\k.\]
Definition: the cross product
If $\vec v=\vc v$ and $\vec w=\vc w$ are vectors in $\mathbb{R}^3$, then we define $\def\vv{\vec v}\vv\times\def\ww{\vec w}\ww$ to be the vector given by the determinant \[ \vv\times\ww=\def\cp#1#2#3#4#5#6{\begin{vmatrix}\i&\j&\k\\#1\\#4\end{vmatrix}}\def\cpc#1#2{\cp{#1_1}{#1_2}{#1_3}{#2_1}{#2_2}{#2_3}}\cpc vw.\] We interpret this determinant by expanding along the first row: \[\vv\times\ww=\cpc vw=\def\vm#1{\begin{vmatrix}#1\end{vmatrix}}\vm{v_2&v_3\\w_2&w_3}\i-\vm{v_1&v_3\\w_1&w_3}\j+\vm{v_1&v_2\\w_1&w_2}\k=\c{v_2w_3-v_3w_2}{-(v_1w_3-v_3w_1)}{v_1w_2-v_2w_1}\]
Example
Let $\vv=\c13{-1}$ and $\ww=\c21{-2}$. We have \[ \vv\times\ww=\cp13{-1}21{-2}=\c{3(-2)-1(-1)}{-(1(-2)-(-1)2)}{1(1)-3(2)}=\c{-5}0{-5}\] and \[ \ww\times\vv=\cp21{-2}13{-1}=\c{1(-1)-(-2)3}{-(2(-1)-(-2)1)}{2(3)-1(1)}=\c{5}0{5}.\] Observe that $\vv\times\ww=-\ww\times \vv$. Moreover, \[ \vv\times \vv=\cp13{-1}13{-1}=\c000=\vec0\] and \[ \ww\times\ww=\cp21{-2}21{-2}=\c000=\vec0.\]
Example: cross products of standard basis vectors
We have \[ \i\times\j=\cp100010=\c001=\k,\] \[ \j\times\k=\cp010001=\c100=\i\] \[ \k\times\i=\cp001100=\c010=\j\]
Proposition: properties of the cross product
For any vectors $\def\uu{\vec u}\uu$, $\vv$ and $\ww$ in $\mathbb{R}^3$ and any scalar $c\in\mathbb{R}$, we have:
- $\uu\times(\vv+\ww)=\uu\times\vv+\uu\times\ww$
- $\vv\times\ww=-\ww\times\vv$
- $(c\vv)\times \ww=c(\vv\times\ww)=\vv\times(c\ww)$
- $\vv\times\vv=\vec0$
- $\vv\times \vec0=\vec0$
- $\vv\times \ww$ is orthogonal to both $\vv$ and $\ww$
Proof
- This is a tedious (but easy) bit of algebra.
- Swapping two rows in a determinant changes the sign, so \[ \vv\times\ww=\cpc vw=-\cpc wv=-\ww\times\vv.\]
- Scaling one row in a determinant scales the determinant in the same way, so \[ (c\vv)\times\ww=\cpc {cv}w=c\cpc vw=c\vv\times\ww.\]
- The determinant of a matrix with a repeated row is zero.
- The determinant of a matrix with a zero row is zero.
- Observe that $\uu\cdot (\vv\times \ww)=\vm{u_1&u_2&u_3\\v_1&v_2&v_3\\w_1&w_2&w_3}$. The determinant of a matrix with a repeated row is zero, so \[\vv\cdot (\vv\times \ww)=\vm{v_1&v_2&v_3\\v_1&v_2&v_3\\w_1&w_2&w_3}=0\] so $\vv$ is orthogonal to $\vv\times\ww$; and similarly, \[\ww\cdot(\vv\times \ww)=\vm{w_1&w_2&w_3\\v_1&v_2&v_3\\w_1&w_2&w_3}=0\] so $\ww$ is orthogonal to $\vv\times\ww$. ■
Theorem: the dot product/cross product length formula
For any vectors $\vv$ and $\ww$ in $\mathbb{R}^3$, we have \[ \|\vv\times\ww\|^2+(\vv\cdot\ww)^2=\|\vv\|^2\,\|\ww\|^2.\]
Proof
Let $D$ be the sum of $v_i^2w_j^2$ over all $i,j\in\{1,2,3\}$ with $i=j$. (So $D=v_1^2w_1^2+v_2^2w_2^2+v_3^2w_3^2$.)
Let $F$ be the sum of $v_i^2w_j^2$ over all $i,j\in\{1,2,3\}$ with $i\ne j$. (So $F=v_1^2w_2^2+v_2^2w_1^2+\dots+v_3^2w_2^2$, with 6 terms on the right hand side.)
Let $C$ be the sum of $v_iw_iv_jw_j$ over all $i,j\in\{1,2,3\}$ with $i<j$. (So $C=v_1w_1v_2w_2+v_1w_1v_3w_3+v_2w_2v_3w_3$.)
Then $D+F$ is the sum of $v_i^2w_j^2$ over all $i,j\in \{1,2,3\}$.
Expanding the formulae for $\|\vv\|^2$ and $\|\ww\|^2$, we get $\|\vv\|^2\|\ww\|^2=D+F$.
Expanding the formula for the cross product, we get $\|\vv\times\ww\|^2=F-2C$.
Expanding the formula for the dot product, we get $(v\cdot w)^2=D+2C$.
So $\|\vv\times\ww\|^2+(v\cdot w)^2=F-2C+D+2C=F+D=\|\vv\|^2\|\ww\|^2.■$
Corollary: the length of $\vec v\times\vec w$
For any vectors $\vv$ and $\ww$ in $\mathbb{R}^3$, we have \[ \|\vv\times\ww\|=\|\vv\|\,\|\ww\|\,\sin\theta\] where $\theta$ is the angle between $\vv$ and $\ww$ (with $0\le\theta\le\pi$).
Proof
Recall that $\vv\cdot\ww=\|\vv\|\,\|\ww\|\cos\theta$. Now \begin{align*}\|\vv\times\ww\|^2&= \|\vv\|^2\,\|\ww\|^2-(\vv\cdot\ww)^2\\ &=\|\vv\|^2\,\|\ww\|^2-\|\vv\|^2\|\ww\|^2\cos^2\theta\\ &=\|\vv\|^2\,\|\ww\|^2(1-\cos^2\theta)\\ &=\|\vv\|^2\,\|\ww\|^2\sin^2\theta.\end{align*} Since $\sqrt {a^2}=a$ if $a\ge0$ and $\sin\theta\ge0$ for $0\le\theta\le\pi$, taking square roots of both sides gives \[ \|\vv\times\ww\|=\|\vv\|\,\|\ww\|\,\sin\theta. ■ \]
Geometry of the cross product
Let $\def\vv{\vec v}\vv$ and $\def\ww{\vec w}\ww$ be vectors in $\def\bR{\mathbb{R}}\bR^3$.
The area of a triangle
Consider a triangle with sides $\vv$ and $\ww$ (and a third vector, namely $\vv-\ww$). Thinking of $\vv$ as the base, the length of the base is $b=\|\vv\|$ and the height of this triangle (measured at right angles to the base) is $h=\|\ww\|\sin \theta$ where $\theta$ is the angle between $\vv$ and $\ww$.
Hence the area of this triangle is $\tfrac12 bh=\tfrac12\|\vv\|\,\|\ww\|\sin\theta$, which is equal to $\tfrac12\|\vv\times\ww\|$ (by the formula for $\|\vv\times\ww\|$ which appears above).
The area of a parallelogram
Consider a parallelogram, two of whose sides are $\def\bR{\mathbb{R}}\def\vv{\vec v}\def\ww{\vec w}\vv$ and $\ww$.
This has double the area of the triangle considered above, so its area is $\|\vv\times\ww\|$.
Example
A triangle with two sides $\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\vv=\c13{-1}$ and $\ww=\c21{-2}$ has area $\tfrac12\|\vv\times\ww\|=\tfrac12\left\|\c13{-1}\times\c21{-2}\right\|=\tfrac12\left\|\c{-5}0{-5}\right\|=\tfrac52\left\|\c{-1}0{-1}\right\|=\tfrac52\sqrt2$, and the parallelogram with sides $\vv$ and $\ww$ has area $\|\vv\times\ww\|=5\sqrt2$.
The volume of a parallelepiped in $\mathbb R^3$
Let $\def\uu{\vec u}\uu$, $\vv$ and $\ww$ be vectors in $\bR^3$.
Consider a parallelepiped, with three sides given by $\uu$, $\vv$ and $\ww$.
Call the face with sides $\vv$ and $\ww$ the base of the parallelpiped. The area of the base is $A=\|\vv\times\ww\|$, and the volume of the parallelpiped is $Ah$ where $h$ is the height, measured at right-angles to the base.
One vector which is at right-angles to the base is $\vv\times\ww$. It follows that $h$ is the length of $\vec p=\text{proj}_{\vv\times\ww}\uu$, so \[ h=\|\text{proj}_{\vv\times\ww}\uu\|=\left\|\frac{\uu\cdot(\vv\times\ww)}{\|\vv\times\ww\|^2}\vv\times\ww\right\| = \frac{\uu\cdot(\vv\times\ww)}{\|\vv\times\ww\|^2}\|\vv\times\ww\| = \frac{|\uu\cdot(\vv\times\ww)|}{\|\vv\times\ww\|}\] so the volume is \[ V=Ah=\|\vv\times\ww\|\frac{|\uu\cdot(\vv\times\ww)|}{\|\vv\times\ww\|}\] or \[ V=|\uu\cdot(\vv\times\ww)|.\] Now $\uu\cdot(\vv\times \ww)=\det\left(\begin{bmatrix}u_1&u_2&u_3\\v_1&v_2&v_3\\w_1& w_2&w_3\end{bmatrix}\right)$, so $V$ is the absolute value of this determinant: \[ V=\left|\quad\det\left( \begin{bmatrix}u_1&u_2&u_3\\v_1&v_2&v_3\\w_1& w_2&w_3\end{bmatrix}\right)\quad \right|.\]
Example
Find volume of a parallelepiped whose vertices include $A=(1,1,1)$, $B=(2,1,3)$, $C=(0,2,2)$ and $D=(3,4,1)$, where $A$ is an adjacent vertex to $B$, $C$ and $D$.
Solution
The vectors $\vec{AB}=\c102$, $\vec{AC}=\c{-1}11$ and $\vec{AD}=\c230$ are all edges of this parallepiped, so the volume is \[ V=\left|\quad \begin{vmatrix}1&0&2\\-1&1&1\\2&3&0\end{vmatrix}\quad \right| = | 1(0-3)-0+2(-3-2)| = |-13| = 13.\]
Planes and lines in $\mathbb{R}^3$
Recall that a typical plane in $\bR^3$ has equation
\[ ax+by+cz=d\]
where $a,b,c,d$ are constants. If we write
\[ \def\nn{\vec n}\nn=\c abc\]
then we can rewrite the equation of this plane in the form
\[ \nn\cdot \c xyz=d.\]
If $A=\def\cc#1{(x_{#1},y_{#1},z_{#1})}\cc1$ and $B=\cc2$ are both points in this plane, then the vector $\vec{AB}$ is said to be in the plane, or to be parallel to the plane. Observe that
\[ \vec n\cdot \vec{AB}=\nn\cdot\def\cp#1{\c{x_{#1}}{y_{#1}}{z_{#1}}}\left(\cp2-\cp1\right) = \nn\cdot\cp2-\nn\cdot\cp1=d-d=0,\]
so \[\nn\cdot\vv=0\]
for every vector $\vv$ in the plane. In other words: the vector $\nn$ is orthogonal to every vector in the plane.
We call a vector with this property a normal vector to the plane.
Examples
1. Find a unit normal vector to the plane $x+y-3z=4$.
Solution: The vector $\nn=\c11{-3}$ is a normal vector to this plane, so $\vv=\frac1{\|\nn\|}\nn=\frac1{\sqrt{11}}\c11{-3}$ is a unit normal vector to this plane. Indeed, $\vv$ is a unit vector and it's in the same direction as the normal vector $\nn$, so $\vv$ is also a normal vector.
2. Find the equation of the plane with normal vector $\def\nn{\vec n}\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c1{-3}2$ which contains the point $(1,-2,1)$. Then find three other points in this plane.
Solution: the equation is $x-3y+2z=d$, and we can find $d$ by subbing in $(x,y,z)=(1,-2,1)$: $1-3(-2)+2(1)=d$, so $d=9$ and the equation of the plane is \[ x-3y+2z=9.\] Some other points in this plane are $(9,0,0)$, $(0,1,6)$, $(1,1,\tfrac{11}2)$. (We can find these by inspection).
3. Find the equation of the plane parallel to the vectors $\c111$ and $\c1{-1}1$ containing the point $(3,0,1)$.
Solution: a normal vector is $\nn=\c111\times\c1{-1}1=\cp1111{-1}1=\c{2}0{-2}$, so the equation is $2x+0y-2z=2(3)-2(1)=4$, or $2x-2z=4$, or $x-z=2$.
4. Find the equation of the plane containing the points $A=(1,2,0)$, $B=(3,0,1)$ and $C=(4,3,-2)$.
Solution: $\def\nn{\vec n}\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\vec{AB}=\c2{-2}1$ and $\vec{AC}=\c31{-2}$ are both vectors in this plane. We want to find a normal vector $\nn$ which is be orthogonal to both of these. The cross product of two vectors is orthogonal to both, so we can take the cross product of $\vec{AB}$ and $\vec{AC}$: \[ \nn=\vec{AB}\times\vec{AC}=\def\cp#1#2#3#4#5#6{\begin{vmatrix}\vec\imath&\vec\jmath&\vec k\\#1\\#4\end{vmatrix}}\cp2{-2}131{-2}=\c378\] so the equation of the plane is $3x+7y+8z=d$, and we find $d$ by subbing in a point in the plane, say $A=(1,2,0)$, which gives $d=3(1)+7(2)+8(0)=17$. So the equation is \[ 3x+7y+8z=17.\]
Orthogonal planes and parallel planes
Let $\Pi_1$ be a plane with normal vector $\nn_1$, and let $\Pi_2$ be a plane with normal vector $\nn_2$.
- $\Pi_1$ and $\Pi_2$ are orthogonal or perpendicular planes if they meet at right angles. The following conditions are equivalent:
- $\Pi_1$ and $\Pi_2$ are orthogonal planes;
- $\nn_1\cdot\nn_2=0$;
- $\nn_1$ is a vector in $\Pi_2$;
- $\nn_2$ is a vector in $\Pi_1$.
- $\Pi_1$ and $\Pi_2$ are parallel planes if they have the same normal vectors. In other words, if $\Pi_1$ has equation $ax+by+cz=d_1$ then any parallel plane $\Pi_2$ has an equation with the same left hand side: $ax+by+cz=d_2$.
Examples
1. Find the equation of the plane $\Pi$ passing through $A=(1,3,-3)$ and $B=(4,-2,1)$ which is orthogonal to the plane $x-y+z=5$.
Solution: The plane $x-y+z=5$ has normal vector $\c1{-1}1$, so this is a vector in $\Pi$. Moreover, $\vec{AB}=\c3{-5}4$ is also a vector in $\Pi$, so it has normal vector \[ \nn=\c1{-1}1\times\c3{-5}4=\cp1{-1}13{-5}4=\c1{-1}{-2}.\] So the equation of $\Pi$ is $x-y-2z=d$ and subbing in $A=(1,3,-3)$ gives $d=1-3-2(-3)=4$, so the equation of $\Pi$ is \[ x-y-2z=4.\]
2. The plane parallel to $2x-4y+5z=8$ passing through $(1,2,3)$ is $2x-4y+5z=2(1)-4(2)+5(3) = 10$, or $2x-4y+5z=10$.
3. Find the equation of the plane $\Pi$ which contains the line of intersection of the planes \[ \Pi_1: x-y+2z=1\quad\text{and}\quad \Pi_2: 3x+2y-z=4,\] and is perpendicular to the plane $\Pi_3:2x+y+z=3$.
Solution: To find the line of intersection of $\Pi_1$ and $\Pi_2$, we must solve the system of linear equations \begin{gather}x-y+2z=1\\3x+2y-z=4.\end{gather} We can solve this linear system in the usual way, by applying EROs to the matrix $\begin{bmatrix}1&-1&2&1\\3&2&-1&4\end{bmatrix}$: \begin{align*} \def\go#1#2{\begin{bmatrix}#1\\#2\end{bmatrix}} \def\ar#1{\\[6pt]\xrightarrow{#1}&} &\go{1&-1&2&1}{3&2&-1&4} \ar{R2\to R2-3R1} \go{1&-1&2&1}{0&5&-7&1} \ar{R1\to 5R1+R2} \go{5&0&3&6}{0&5&-7&1} \ar{R1\to\tfrac15R1,\,R2\to\tfrac15R2} \go{1&0&3/5&6/5}{0&1&-7/5&1/5} \end{align*} So the line $L$ of intersection is given by \[ L: \c xyz=\c{\tfrac65}{\tfrac15}0+t\c{-\tfrac35}{\tfrac75}1,\quad t\in\mathbb{R}.\] So $\c{-\tfrac35}{\tfrac75}1$ is a direction vector along $L$, and also $5\c{-\tfrac35}{\tfrac75}1=\c{-3}75$ is a vector along $L$. So $\c{-3}75$ is a vector in the plane $\Pi$. Moreover, taking $t=2$ gives the point $(0,3,2)$ in the line $L$, so this is a point in $\Pi$.
Since $\Pi$ is perpendicular to $\Pi_3$, which has normal vector $\nn_3=\c211$, the vector $\c211$ is in $\Pi$.
So a normal vector for $\Pi$ is \[ \nn=\c211\times\c{-3}75 = \cp211{-3}75=\c{-2}{-13}{17}\] hence $\Pi$ has equation $-2x-13y+17z=d$, and subbing in the point $(0,3,2)$ gives $d=0-13(3)+17(2)=-39+34=-5$, so $\Pi$ has equation $-2x-13y+17z=-5$, or \[ 2x+13y-17z=5.\]
The distance to a plane
The distance from a point to a plane
Let $\Pi$ be a plane in $\def\rt{\mathbb{R}^3}\rt$ with equation $ax+by+cz=d$, so that $\def\nn{\vec n}\nn=\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c abc$ is a normal vector to $\Pi$. Also let $A$ be any point in $\rt$.
The shortest path from $A$ to a point in $\Pi$ goes in the same direction as $\nn$. Let $B$ be any point in the plane $\Pi$.
From the diagram, we see that the shortest distance from $A$ to $\Pi$ is given by \[ \text{dist}(A,\Pi)=\|\def\pp{\vec p}\pp\|\] where \[ \pp=\text{proj}_{\nn}{\vec{AB}}.\] Using the formula for $\text{proj}_{\vec w}\vec v$ and the fact that $\|c\vec v\|=|c|\,\|\vec v\|$ where $c$ is a scalar and $\vec v$ is a vector, we obtain the formula \[ \text{dist}(A,\Pi)=\frac{|\nn\cdot\vec{AB}|}{\|\nn\|}.\]
Example
To find the distance from $A=(1,-4,3)$ to the plane $\Pi:2x-3y+6z=1$, choose any point $B$ in $\Pi$; for example, let $B=(2,1,0)$. Then $\nn=\c2{-3}6$ and $\vec{AB}=\c15{-3}$, so \[ \def\dist{\text{dist}}\dist(A,\Pi)=\frac{|\nn\cdot\vec{AB}|}{\|\nn\|}=\frac{|2(1)+(-3)5+6(-3)|}{\sqrt{2^2+(-3)^2+6^2}}=\frac{|-31|}{\sqrt{49}}=\frac{31}7.\]
Remark: the distance from the origin to a plane
If we write $\def\rt{\mathbb{R}^3}\def\dist{\text{dist}}\def\cp#1#2#3#4#5#6{\begin{vmatrix}\vec\imath&\vec\jmath&\vec k\\#1\\#4\end{vmatrix}}\def\nn{\vec n}\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}0=(0,0,0)$ for the origin in $\rt$ and apply the formula above to the plane $\Pi:ax+by+cz=d$ with $B=(d/a,0,0)$ (assuming that $a\ne 0$) then we obtain \[ \dist(0,\Pi)=\frac{|d|}{\|\nn\|}\] where $\nn$ is the normal vector $\nn=\c abc$.
So as $d$ varies (with the normal vector $\nn$ fixed), we obtain parallel planes at different distances to the origin $0$; the larger $d$ is, the further the plane is from $0$.
The distance between parallel planes
If $\Pi_1$ and $\Pi_2$ are parallel planes, then the shortest distance between them is given by \[ \dist(\Pi_1,\Pi_2)=\dist(A,\Pi_2)\] for any point $A$ is $\Pi_1$. The reason is that for parallel planes, changing $A$ to a different point in $\Pi_1$ does not change $\dist(A,\Pi_2)$.
Of course, if the planes $\Pi_1$ and $\Pi_2$ are not parallel, then they intersect (in many points: in a whole line). So for non-parallel planes we always have $\dist(\Pi_1,\Pi_2)=0$.
Example
The distance between the planes $3x+4y-2z=5$ and $3x+4y-3z=1$ is $0$, since the normal vectors $\c34{-2}$ and $\c34{-3}$ are not scalar multiples of one another, so they are in different directions, so the planes are not parallel.
Example
The planes $\Pi_1:3x+4y-2z=5$ and $\Pi_2:3x+4y-2z=1$ have the same normal vector $\c34{-2}$, so they are parallel. Their distance is given by $\dist(A,\Pi_2)$ where $A$ is any point in $\Pi_1$, and to find this we also need a point $B$ in $\Pi_2$.
We can choose $A=(1,0,-1)\in \Pi_1$ and $B=(1,0,1)\in \Pi_2$. (Of course, there are lots of different possible choices here, but they should all give the same answer!) Then $\vec {AB}=\c002$ and \[ \dist(\Pi_1,\Pi_2)=\dist(A,\Pi_2) = \frac{|\nn\cdot \vec{AB}|}{\|n\|}=\frac{|0+0+(-2)2|}{\sqrt{3^2+4^2+(-2)^2}} = \frac4{\sqrt{29}}.\]
Exercise: a formula for the distance between parallel planes
Show that the distance between the parallel planes $\Pi_1:ax+by+cz=d_1$ and $\Pi_2:ax+by+cz=d_2$ is \[\dist(\Pi_1,\Pi_2)=\frac{|d_2-d_1|}{\|\nn\|},\] where $\nn=\c abc$.
Example
To find the distance between $x+3y-5z=4$ and $2x+6y-10z=11$ we can rewrite the second equation as $x+3y-5z=11/2$ to see that this is a parallel plane to the first, with common normal vector $\nn=\c13{-5}$. By the formula in the exercise the distance between these planes is \[ \frac{|\tfrac{11}2-4|}{\|\nn\|} = \frac{|\tfrac 32|}{\sqrt{1^2+3^2+(-5)^2}} = \frac3{2\sqrt{35}}.\]
Lines in $\mathbb{R}^3$
A line $L$ in $\rt$ has an equation of the form \[ L: \c xyz=\c abc+t\c def, \quad t\in \mathbb R\] where $a,b,c,d,e,f$ are fixed numbers.
The variable $t$ is called a “free parameter”: it's “free” because it can take any value, and it's a “parameter” because this is just another name for a variable.
The equation above is called a parametric equation for the line $L$, because of the free parameter $t$.
What do $a,b,c,d,e,f$ mean?
- Set $t=0$: $A=(a,b,c)$ is a point in $L$
- Set $t=1$: $B=(a+d,b+e,c+f)$ is another
- So $\vec {AB}=\c def$ is a direction along $L$.
Example
Find the parametric equation of the line $L$ in $\rt$ which passes through $A=(2,1,-3)$ and $B=(4,-1,5)$.
- Note that $\vec{AB}=\c 2{-2}{8}$
- So this is a direction vector along the line $L$
- So the equation is $ L: \c xyz=\c 21{-3}+t\c 2{-2}8,\quad t\in \mathbb{R}$.
- (Same as $ L: \c xyz=\c 4{-1}5+t\c 2{-2}8,\quad t\in \mathbb{R}$).
The distance from a point to a line
Cross product method
Suppose $L$ is a line in $\def\rt{\mathbb{R}^3}\def\rn{\mathbb{R}^n}\rt$. Let $A$ be a point on $L$ and let $\def\vv{\vec v}\vv$ be a direction vector along $L$.
Given a point $B$, how can we find $d=\text{dist}(B,L)$, the (shortest) distance from the point $B$ to the line $L$?
Let $A$ be any point in $L$ and let $\theta$ be the angle between $AB$ and $\vv$. We have \[ d=\|\vec{AB}\|\,\sin \theta = \frac{\|\vec{AB}\|\,\|\vv\|\sin \theta}{\|\vv\|} = \frac{\|\vec{AB}\times \vv\|}{\|\vv\|}.\] So \[ \text{dist}(B,L) = \frac{\|\vec{AB}\times \vv\|}{\|\vv\|}\] where $A$ is any point in $L$.
Example
To find the distance from the point $B=(1,2,3)$ to the line \[L:\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c xyz=\c10{-1}+t\c41{-5},\quad t\in\mathbb{R}\] we can choose $A=(1,0,{-1})$ so that $\vec{AB}=\c024$ and taking $\vv=\c41{-5}$, we obtain \[ \vec{AB}\times \vv = \begin{vmatrix}\vec\imath&\vec\jmath&\vec k\\0&2&4\\4&1&-5\end{vmatrix}=\c{-14}{16}{-8}=2\c{-7}{8}{-4}\] so \[ \def\dist{\text{dist}}\dist(B,L)=\frac{\|\vec{AB}\times\vv\|}{\|\vv\|}=\frac{2\sqrt{7^2+8^2+4^2}}{\sqrt{4^2+1^2+5^2}} = \frac{2\sqrt{129}}{\sqrt{42}} \approx 3.5051.\]
Dot product method
The method above relies on the cross product, so only works in $\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\def\rt{\mathbb{R}^3}\def\rn{\mathbb{R}^n}\def\vv{\vec v}\def\dist{\text{dist}}\rt$. The following alternative method works in $\rn$ for any $n$.
Observe that $\dist(B,L)$ is the length of the vector $\def\nn{\vec n}\nn=\vec{AB}-\def\pp{\vec p}\pp$ where $\pp=\def\proj{\text{proj}}\proj_{\vv}\vec{AB}$.
Example
Let's redo the previous example using this method.
We have $\vec{AB}=\c024$ and $\vv=\c41{-5}$, so \[\pp=\proj_{\vv}\vec{AB} = \left(\frac{\vec{AB}\cdot \vv}{\|\vv\|^2}\right)\vv = \frac{0(4)+2(1)+4(-5)}{4^2+1^2+5^2}\c41{-5} = -\frac{18}{42}\c41{-5}=-\frac{3}{7}\c41{-5},\] so \[ \nn=\vec{AB}-\pp=\c024-(-\frac37)\c41{-5}=\c024+\frac37\c41{-5}=\frac17\c{12}{17}{13}\] so \[ \dist(B,L)=\|\nn\|=\frac17\sqrt{12^2+17^2+13^2} = \frac17\sqrt{602} \approx 3.5051.\]
The distance between lines in $\mathbb{R}^3$
Skew lines
Suppose that $L_1$ and $L_2$ are skew lines in $\rt$: lines which are not parallel and do not cross.
Let $\vv_1$ be a direction vector along $L_1$, and let $\vv_2$ be a direction vector along $L_2$.
The shortest distance from $L_1$ and $L_2$ is measured along the direction orthogonal to both $\vv_1$ and $\vv_2$, namely the direction of $\nn=\vv_1\times\vv_2$.
Let $\Pi$ be the plane with normal vector $\nn$ which contains $L_1$.
For any point $B$ in $L_2$, we have \[\dist(L_1,L_2)=\dist(B,\Pi) = \frac{|\vec{AB}\cdot \nn|}{\|\nn\|}\] where $A$ is any point in $\Pi$; for example, we can take $A$ to be any point in $L_1$.
To summarise: for skew lines $L_1$ and $L_2$ with direction vectors $\vv_1$ and $\vv_2$, we have \[ \dist(L_1,L_2)=\frac{|\vec{AB}\cdot \nn|}{\|\nn\|}\] where $\nn=\vv_1\times\vv_2$ and $A$ and $B$ are points with one in $L_1$ and the other in $L_2$.
Remark
What about the distance between lines which are not skew? This means that either they are non-parallel and they intersect (so that the distance between them will be zero), or they are parallel lines.
- The same method and formula work if $L_1$ and $L_2$ are non-parallel lines which intersect, and you get $\dist(L_1,L_2)=0$ in this case. The reason is that in this case $L_1$ and $L_2$ will lie in one plane, $\Pi$, and $\vec{AB}$ will also be in $\Pi$, and $\vec n$ will be orthogonal to $\Pi$. So $\frac{\vec{AB}\cdot \vec n}{\|\vec n\|}=\frac{0}{\|\vec n\|}=0=\dist(L_1,L_2)$.
- If $L_1$ and $L_2$ are parallel lines (i.e., if the vectors $\vec v_1$ and $\vec v_2$ along the lines are in the same direction), then $\vv_1\times \vv_2=0$ which isn't helpful, so this method won't work here. In this case, observe that $\dist(L_1,L_2)=\dist(A,L_2)$ where $A$ is any point in $L_1$ (because the lines are parallel), so you can use one of the formulae above for the distance from a point to a line.
Example
Consider the skew lines \begin{align*} x&=1+t_1\\L_1:\quad y&=2t_1\qquad (t_1\in \mathbb{R})\\z&=1+3t_1 \end{align*} and \[ L_2:\c xyz=\c 321+t_2\c1{-1}1,\quad t_2\in\mathbb{R}.\]
Note that we can rewrite the equation of $L_1$ in “vector form”, which is easier to digest: \[ L_1:\c xyz=\c 101+t_1\c123,\quad t_1\in\mathbb{R}\] The direction vectors are $\c123$ and $\c1{-1}1$, so we take $\nn$ to be their cross product: \[ \nn=\c123\times\c1{-1}1=\begin{vmatrix}\vec\imath&\vec\jmath&\vec k\\1&2&3\\1&-1&1\end{vmatrix}=\c52{-3}\] and if $A=(1,0,1)$ and $B=(3,2,1)$ then $A$ and $B$ are points with one in $L_1$ and the other in $L_2$, and $\vec{AB}=\c 220$. Hence \[\dist(L_1,L_2)=\frac{|\vec{AB}\cdot \nn|}{\|\nn\|}=\frac{2(5)+2(2)+0(-3)}{\sqrt{5^2+2^2+3^2}} = \frac{14}{\sqrt{38}}.\]
Distance between lines in $\mathbb{R}^3$ in general
The formula $\dist(L_1,L_2)=\frac{|\vec{AB}\cdot \nn|}{\|\nn\|}$ where $\nn=\vec v_1\times \vec v_2$ works for
- skew lines (not parallel, not intersecting), as we saw above,
- and actually: any non-parallel lines $L_1$, $L_2$. We can see this by noticing that if the lines above intersect, then $L_1$ lies in $\Pi$, so the formula gives $\dist(L_1,L_2)=\dist(B,\Pi)=0$ which is the correct answer.
What about parallel lines?
- The formula can't work because we'd have $\vec v_1=\vec v_2$ so $\vec n=\vec v_1\times \vec v_2=\vec 0$
- Instead: observe that when $L_1$ and $L_2$ are parallel, we have $\dist(L_1,L_2)=\dist(A,L_2)$ for any point $A$ in $L_1$
- So we can use one of of the point-to-line distance formulae we saw earlier.
The distance from a point to a line
Suppose $L$ is a line in $\def\rt{\mathbb{R}^3}\def\rn{\mathbb{R}^n}\rt$. Let $A$ be a point on $L$ and let $\def\vv{\vec v}\vv$ be a direction vector along $L$.
Given a point $B$, how can we find $d=\text{dist}(B,L)$, the (shortest) distance from the point $B$ to the line $L$?
Let $A$ be any point in $L$ and let $\theta$ be the angle between $AB$ and $\vv$. We have \[ d=\|\vec{AB}\|\,\sin \theta = \frac{\|\vec{AB}\|\,\|\vv\|\sin \theta}{\|\vv\|} = \frac{\|\vec{AB}\times \vv\|}{\|\vv\|}.\] So \[ \text{dist}(B,L) = \frac{\|\vec{AB}\times \vv\|}{\|\vv\|}\] where $A$ is any point in $L$.
Example
To find the distance from the point $B=(1,2,3)$ to the line \[L:\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c xyz=\c10{-1}+t\c41{-5},\quad t\in\mathbb{R}\] we can choose $A=\c10{-1}$ so that $\vec{AB}=\c024$ and taking $\vv=\c41{-5}$, we obtain \[ \vec{AB}\times \vv = \begin{vmatrix}\vec\imath&\vec\jmath&\vec k\\0&2&4\\4&1&-5\end{vmatrix}=\c{-14}{16}{-8}=2\c{-7}{8}{-4}\] so \[ \def\dist{\text{dist}}\dist(B,L)=\frac{\|\vec{AB}\times\vv\|}{\|\vv\|}=\frac{2\sqrt{7^2+8^2+4^2}}{\sqrt{4^2+1^2+5^2}} = \frac{2\sqrt{129}}{\sqrt{42}} \approx 3.5051.\]
Alternative method
The method above relies on the cross product, so only works in $\rt$. The following alternative method works in $\rn$ for any $n$.
Observe that $\dist(B,L)$ is the length of the vector $\def\nn{\vec n}\nn=\vec{AB}-\def\pp{\vec p}\pp$ where $\pp=\def\proj{\text{proj}}\proj_{\vv}\vec{AB}$.
Example
Let's redo the previous example using this method.
We have $\vec{AB}=\c024$ and $\vv=\c41{-5}$, so \[\pp=\proj_{\vv}\vec{AB} = \left(\frac{\vec{AB}\cdot \vv}{\|\vv\|^2}\right)\vv = \frac{0(4)+2(1)+4(-5)}{4^2+1^2+5^2}\c41{-5} = -\frac{18}{42}\c41{-5}=-\frac{3}{7}\c41{-5},\] so \[ \nn=\vec{AB}-\pp=\c024-(-\frac37)\c41{-5}=\c024+\frac37\c41{-5}=\frac17\c{12}{17}{13}\] so \[ \dist(B,L)=\|\nn\|=\frac17\sqrt{12^2+17^2+13^2} = \frac17\sqrt{602} \approx 3.5051.\]
The distance between skew lines in $\mathbb{R}^3$
Suppose that $L_1$ and $L_2$ are skew lines in $\rt$: lines which are not parallel and do not cross.
Let $\vv_1$ be a direction vector along $L_1$, and let $\vv_2$ be a direction vector along $L_2$.
The shortest distance from $L_1$ and $L_2$ is measured along the direction orthogonal to both $\vv_1$ and $\vv_2$, namely the direction of $\nn=\vv_1\times\vv_2$.
Let $\Pi$ be the plane with normal vector $\nn$ which contains $L_1$.
For any point $B$ in $L_2$, we have \[\dist(L_1,L_2)=\dist(B,\Pi) = \frac{|\vec{AB}\cdot \nn|}{\|\nn\|}\] where $A$ is any point in $\Pi$; for example, we can take $A$ to be any point in $L_2$.
To summarise: for skew lines $L_1$ and $L_2$ with direction vectors $\vv_1$ and $\vv_2$, we have \[ \dist(L_1,L_2)=\frac{|\vec{AB}\cdot \nn|}{\|\nn\|}\] where $\nn=\vv_1\times\vv_2$ and $A$ and $B$ are points with one in $L_1$ and the other in $L_2$.
Example
Consider the skew lines \[ L_1:\c xyz=\c 101+t_1\c123,\quad t_1\in\mathbb{R}\] and \[ L_2:\c xyz=\c 321+t_2\c1{-1}1,\quad t_2\in\mathbb{R}.\] The direction vectors are $\c123$ and $\c1{-1}1$, so we take $\nn$ to be their cross product: \[ \nn=\c123\times\c1{-1}1=\begin{vmatrix}\vec\imath&\vec\jmath&\vec k\\1&2&3\\1&-1&1\end{vmatrix}=\c52{-3}\] and if $A=(1,0,1)$ and $B=(3,2,1)$ then $A$ and $B$ are points with one in $L_1$ and the other in $L_2$, and $\vec{AB}=\c 220$. Hence \[\dist(L_1,L_2)=\frac{|\vec{AB}\cdot \nn|}{\|\nn\|}=\frac{2(5)+2(2)+0(-3)}{\sqrt{5^2+2^2+3^2}} = \frac{14}{\sqrt{38}}.\]

