Skip to main content
Mathematics LibreTexts

4.2: Projections and Planes

  • Page ID
    58849
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Any student of geometry soon realizes that the notion of perpendicular lines is fundamental. As an illustration, suppose a point \(P\) and a plane are given and it is desired to find the point \(Q\) that lies in the plane and is closest to \(P\), as shown in Figure \(\PageIndex{1}\). Clearly, what is required is to find the line through \(P\) that is perpendicular to the plane and then to obtain \(Q\) as the point of intersection of this line with the plane. Finding the line perpendicular to the plane requires a way to determine when two vectors are perpendicular. This can be done using the idea of the dot product of two vectors.

    clipboard_eb63ea4f5c9d39439f91d92492daca4cb.png
    Figure \(\PageIndex{1}\)

    The Dot Product and Angles

    Definition \(\PageIndex{1}\): Dot Product in \(\mathbb{R}^3\)

    Given vectors \(\mathbf{v} = \left[ \begin{array}{c} x_{1} \\ y_{1}\\ z_{1} \end{array} \right]\) and \(\mathbf{w} = \left[ \begin{array}{c} x_{2} \\ y_{2}\\ z_{2} \end{array} \right]\), their dot product \(\mathbf{v} \cdot \mathbf{w}\) is a number defined

    \[\mathbf{v} \cdot \mathbf{w} = x_{1}x_{2} + y_{1}y_{2} + z_{1}z_{2} = \mathbf{v}^T\mathbf{w} \nonumber \]

    Because \(\mathbf{v} \cdot \mathbf{w}\) is a number, it is sometimes called the scalar product of \(\mathbf{v}\) and \(\mathbf{w}\).1

    Example \(\PageIndex{1}\)

    If \(\mathbf{v} = \left[ \begin{array}{r} 2 \\ -1 \\ 3 \end{array} \right]\) and \(\mathbf{w} = \left[ \begin{array}{r} 1 \\ 4\\ -1 \end{array} \right]\), then \(\mathbf{v} \cdot \mathbf{w} = 2 \cdot 1 + (-1) \cdot 4 + 3 \cdot (-1) = -5\).

    The next theorem lists several basic properties of the dot product.

    Theorem \(\PageIndex{1}\)

    Let \(\mathbf{u}\), \(\mathbf{v}\), and \(\mathbf{w}\) denote vectors in \(\mathbb{R}^3\) (or \(\mathbb{R}^2\)).

    1. \(\mathbf{v} \cdot \mathbf{w}\) is a real number.
    2. \(\mathbf{v} \cdot \mathbf{w} = \mathbf{w} \cdot \mathbf{v}\).
    3. \(\mathbf{v} \cdot \mathbf{0} = 0 = \mathbf{0} \cdot \mathbf{v}\).
    4. \(\mathbf{v} \cdot \mathbf{v} = \|\mathbf{v}\|^{2}\).
    5. \((k\mathbf{v}) \cdot \mathbf{w} = k(\mathbf{w} \cdot \mathbf{v}) = \mathbf{v} \cdot (k\mathbf{w})\) for all scalars \(k\).
    6. \(\mathbf{u} \cdot (\mathbf{v} \pm \mathbf{w}) = \mathbf{u} \cdot \mathbf{v} \pm \mathbf{u} \cdot \mathbf{w}\)
    Proof

    (1), (2), and (3) are easily verified, and (4) comes from Example 4.2.1. The rest are properties of matrix arithmetic (because \(\mathbf{w} \cdot \mathbf{v} = \mathbf{v}^{T}\mathbf{w}\)), and are left to the reader.

    The properties in Example 4.2.1 enable us to do calculations like

    \[3\mathbf{u} \cdot (2\mathbf{v} - 3\mathbf{w} + 4\mathbf{z}) = 6(\mathbf{u} \cdot \mathbf{v}) - 9(\mathbf{u} \cdot \mathbf{w}) + 12(\mathbf{u} \cdot \mathbf{z}) \nonumber \]

    and such computations will be used without comment below. Here is an example.

    Example \(\PageIndex{2}\)

    Verify that \(\|\mathbf{v} -3\mathbf{w}\|^{2} = 1\) when \(\|\mathbf{v}\| = 2\), \(\|\mathbf{w}\| = 1\), and \(\mathbf{v} \cdot \mathbf{w} = 2\).

    Solution

    We apply Example 4.2.1 several times:

    \[\begin{aligned} \| \mathbf{v} - 3\mathbf{w} \|^2 &= (\mathbf{v} - 3\mathbf{w}) \cdot (\mathbf{v} - 3\mathbf{w}) \\ &= \mathbf{v} \cdot (\mathbf{v} - 3\mathbf{w}) - 3\mathbf{w} \cdot (\mathbf{v} - 3\mathbf{w}) \\ &= \mathbf{v} \cdot \mathbf{v} - 3(\mathbf{v} \cdot \mathbf{w}) - 3(\mathbf{w} \cdot \mathbf{v}) + 9(\mathbf{w} \cdot \mathbf{w}) \\ &=\| \mathbf{v} \|^2 - 6(\mathbf{v} \cdot \mathbf{w}) + 9\| \mathbf{w} \|^2 \\ &= 4 - 12 + 9 = 1 \end{aligned} \nonumber \]

    There is an intrinsic description of the dot product of two nonzero vectors in \(\mathbb{R}^3\). To understand it we require the following result from trigonometry.

    Theorem: Law of Cosines

    If a triangle has sides \(a\), \(b\), and \(c\), and if \(\theta\) is the interior angle opposite \(c\) then

    \[c^2 = a^2 + b^2 -2ab \cos\theta \nonumber \]

    Proof

    We prove it when is \(\theta\) acute, that is \(0 \leq \theta < \frac{\pi}{2}\); the obtuse case is similar. In Figure \(\PageIndex{2}\) we have \(p = a \sin \theta\) and \(q = a \cos \theta\).

    clipboard_e6507b3e692416e90ea1704bcab778e8e.png
    Figure \(\PageIndex{2}\)

    Hence Pythagoras’ theorem gives

    \[\begin{aligned} c^2 = p^2 + (b - q)^2 &= a^2\sin^2\theta + (b - a\cos\theta)^2 \\ &= a^2(\sin^2\theta + \cos^2\theta) +b^2 - 2ab\cos\theta\end{aligned} \nonumber \]

    The law of cosines follows because \(\sin^{2} \theta + \cos^{2} \theta = 1\) for any angle \(\theta\).

    Note that the law of cosines reduces to Pythagoras’ theorem if \(\theta\) is a right angle (because \(\cos\frac{\pi}{2} = 0\)).

    Now let \(\mathbf{v}\) and \(\mathbf{w}\) be nonzero vectors positioned with a common tail as in Figure \(\PageIndex{3}\). Then they determine a unique angle \(\theta\) in the range

    \[0 \leq \theta \leq \pi \nonumber \]

    This angle \(\theta\) will be called the angle between \(\mathbf{v}\) and \(\mathbf{w}\). Figure \(\PageIndex{3}\) illustrates when \(\theta\) is acute (less than \(\frac{\pi}{2}\)) and obtuse (greater than \(\frac{\pi}{2}\)). Clearly \(\mathbf{v}\) and \(\mathbf{w}\) are parallel if \(\theta\) is either \(0\) or \(\pi\). Note that we do not define the angle between \(\mathbf{v}\) and \(\mathbf{w}\) if one of these vectors is \(\mathbf{0}\).

    clipboard_e4b377cc9291f794ff86df76fc283b47e.png
    clipboard_ecd94afa70d86aa223e303a77be19b392.png
    Figure \(\PageIndex{3}\)

    The next result gives an easy way to compute the angle between two nonzero vectors using the dot product.

    Theorem \(\PageIndex{2}\)

    Let \(\mathbf{v}\) and \(\mathbf{w}\) be nonzero vectors. If \(\theta\) is the angle between \(\mathbf{v}\) and \(\mathbf{w}\), then

    \[\mathbf{v} \cdot \mathbf{w} = \| \mathbf{v} \| \| \mathbf{w} \| \cos\theta \nonumber \]

    We calculate \(\|\mathbf{v} - \mathbf{w}\|^{2}\) in two ways. First apply the law of cosines to the triangle in Figure \(\PageIndex{4}\) to obtain:

    \[\| \mathbf{v} - \mathbf{w} \|^2 = \| \mathbf{v} \|^2 + \| \mathbf{w} \|^2 - 2\| \mathbf{v} \| \| \mathbf{w} \| \cos\theta \nonumber \]

    clipboard_ee56cffa989b9e77cceff8ef27a147d51.png
    Figure \(\PageIndex{4}\)

    On the other hand, we use Example 4.2.1:

    \[\begin{aligned} \| \mathbf{v} - \mathbf{w} \|^2 &= (\mathbf{v} - \mathbf{w}) \cdot (\mathbf{v} - \mathbf{w}) \\ &= \mathbf{v} \cdot \mathbf{v} - \mathbf{v} \cdot \mathbf{w} - \mathbf{w} \cdot \mathbf{v} + \mathbf{w} \cdot \mathbf{w} \\ &= \| \mathbf{v} \|^2 - 2(\mathbf{v} \cdot \mathbf{w}) + \| \mathbf{w} \|^2\end{aligned} \nonumber \]

    Comparing these we see that \(-2 \|\mathbf{v}\|\|\mathbf{w}\| \cos \theta = -2(\mathbf{v} \cdot \mathbf{w})\), and the result follows.

    If \(\mathbf{v}\) and \(\mathbf{w}\) are nonzero vectors, Theorem 4.2.2 gives an intrinsic description of \(\mathbf{v} \cdot \mathbf{w}\) because \(\|\mathbf{v}\|\), \(\|\mathbf{w}\|\), and the angle \(\theta\) between \(\mathbf{v}\) and \(\mathbf{w}\) do not depend on the choice of coordinate system. Moreover, since \(\|\mathbf{v}\|\) and \(\|\mathbf{w}\|\) are nonzero (\(\mathbf{v}\) and \(\mathbf{w}\) are nonzero vectors), it gives a formula for the cosine of the angle \(\theta\):

    \[\label{eq:costheta} \cos\theta = \frac{\mathbf{v} \cdot \mathbf{w}}{\| \mathbf{v} \| \| \mathbf{w} \|} \]

    Since \(0 \leq \theta \leq \pi\), this can be used to find \(\theta\).

    Example \(\PageIndex{3}\)

    Compute the angle between \(\mathbf{u} = \left[ \begin{array}{r} -1 \\ 1 \\ 2 \end{array} \right]\) and \(\mathbf{v} = \left[ \begin{array}{r} 2 \\ 1 \\ -1 \end{array} \right]\).

    Solution

    Compute \(\cos\theta = \frac{\mathbf{v} \cdot \mathbf{w}}{\| \mathbf{v} \| \| \mathbf{w} \|} = \frac{-2 + 1 -2}{\sqrt{6}\sqrt{6}} = -\frac{1}{2}\). Now recall that \(\cos\theta\) and \(\sin \theta\) are defined so that (\(\cos \theta\), \(\sin \theta\)) is the point on the unit circle determined by the angle \(\theta\) (drawn counterclockwise, starting from the positive \(x\) axis). In the present case, we know that \(\cos \theta = -\frac{1}{2}\) and that \(0 \leq \theta \leq \pi\). Because \(\cos\frac{\pi}{3} = \frac{1}{2}\), it follows that \(\theta = \frac{2\pi}{3}\) (see the diagram).

    clipboard_eded946e5b3f794744ea63b6d113f6016.png

    If \(\mathbf{v}\) and \(\mathbf{w}\) are nonzero, equation (\ref{eq:costheta}) shows that \(\cos \theta\) has the same sign as \(\mathbf{v} \cdot \mathbf{w}\), so

    \[\begin{array}{lll} \mathbf{v} \cdot \mathbf{w} > 0 & \mbox{if and only if } & \theta \mbox{ is acute } (0 \leq \theta < \frac{\pi}{2}) \\ \mathbf{v} \cdot \mathbf{w} < 0 & \mbox{if and only if } & \theta \mbox{ is obtuse } (\frac{\pi}{2} < \theta \leq 0) \\ \mathbf{v} \cdot \mathbf{w} = 0 & \mbox{if and only if } & \theta = \frac{\pi}{2} \end{array} \nonumber \]

    In this last case, the (nonzero) vectors are perpendicular. The following terminology is used in linear algebra:

    Definition \(\PageIndex{2}\): Orthogonal Vectors in \(\mathbb{R}^3\)

    Two vectors \(\mathbf{v}\) and \(\mathbf{w}\) are said to be orthogonal if \(\mathbf{v} = \mathbf{0}\) or \(\mathbf{w} = \mathbf{0}\) or the angle between them is \(\frac{\pi}{2}\).

    Since \(\mathbf{v} \cdot \mathbf{w} = 0\) if either \(\mathbf{v} = \mathbf{0}\) or \(\mathbf{w} = \mathbf{0}\), we have the following theorem:

    Theorem \(\PageIndex{3}\)

    Two vectors \(\mathbf{v}\) and \(\mathbf{w}\) are orthogonal if and only if \(\mathbf{v} \cdot \mathbf{w} = 0\).

    Example \(\PageIndex{4}\)

    Show that the points \(P(3, -1, 1)\), \(Q(4, 1, 4)\), and \(R(6, 0, 4)\) are the vertices of a right triangle.

    Solution

    The vectors along the sides of the triangle are

    \[\longvect{PQ} = \left[ \begin{array}{r} 1 \\ 2 \\ 3 \end{array} \right],\ \longvect{PR} = \left[ \begin{array}{r} 3 \\ 1 \\ 3 \end{array} \right], \mbox{ and } \longvect{QR} = \left[ \begin{array}{r} 2 \\ -1 \\ 0 \end{array} \right] \nonumber \]

    Evidently \(\longvect{PQ} \cdot \longvect{QR} = 2 - 2 + 0 = 0\), so \(\longvect{PQ}\) and \(\longvect{QR}\) are orthogonal vectors. This means sides \(PQ\) and \(QR\) are perpendicular—that is, the angle at \(Q\) is a right angle.

    Example 4.2.5 demonstrates how the dot product can be used to verify geometrical theorems involving perpendicular lines.

    Example \(\PageIndex{5}\)

    A parallelogram with sides of equal length is called a rhombus. Show that the diagonals of a rhombus are perpendicular.

    Solution

    Let \(\mathbf{u}\) and \(\mathbf{v}\) denote vectors along two adjacent sides of a rhombus, as shown in the diagram.

    clipboard_e8c446c83569e341b64b4325a778745d8.png

    Then the diagonals are \(\mathbf{u} - \mathbf{v}\) and \(\mathbf{u} + \mathbf{v}\), and we compute

    \[\begin{aligned} (\mathbf{u} - \mathbf{v}) \cdot (\mathbf{u} + \mathbf{v}) &= \mathbf{u} \cdot (\mathbf{u} + \mathbf{v}) - \mathbf{v} \cdot (\mathbf{u} + \mathbf{v})\\ &= \mathbf{u} \cdot \mathbf{u} + \mathbf{u} \cdot \mathbf{v} - \mathbf{v} \cdot \mathbf{u} - \mathbf{v} \cdot \mathbf{v} \\ &= \| \mathbf{u} \|^2 - \| \mathbf{v} \|^2 \\ &= 0\end{aligned} \nonumber \]

    because \(\|\mathbf{u}\| = \|\mathbf{v}\|\) (it is a rhombus). Hence \(\mathbf{u} - \mathbf{v}\) and \(\mathbf{u} + \mathbf{v}\) are orthogonal.

    Projections

    In applications of vectors, it is frequently useful to write a vector as the sum of two orthogonal vectors. Here is an example.

    Example \(\PageIndex{6}\)

    Suppose a ten-kilogram block is placed on a flat surface inclined \(30^{\circ}\) to the horizontal as in the diagram. Neglecting friction, how much force is required to keep the block from sliding down the surface?

    Solution

    Let \(\mathbf{w}\) denote the weight (force due to gravity) exerted on the block. Then \(\|\mathbf{w}\| = 10\) kilograms and the direction of \(\mathbf{w}\) is vertically down as in the diagram.

    clipboard_e58c3ff4038ea643fd534ec10c65c0c80.png

    The idea is to write \(\mathbf{w}\) as a sum \(\mathbf{w} = \mathbf{w}_{1} + \mathbf{w}_{2}\) where \(\mathbf{w}_{1}\) is parallel to the inclined surface and \(\mathbf{w}_{2}\) is perpendicular to the surface. Since there is no friction, the force required is \(-\mathbf{w}_{1}\) because the force \(\mathbf{w}_{2}\) has no effect parallel to the surface. As the angle between \(\mathbf{w}\) and \(\mathbf{w}_{2}\) is \(30^{\circ}\) in the diagram, we have \(\frac{\| \mathbf{w}_{1} \|}{\| \mathbf{w} \|} = \sin30^\circ = \frac{1}{2}\). Hence \(\| \mathbf{w}_{1} \| = \frac{1}{2} \| \mathbf{w} \| = \frac{1}{2}10 = 5\). Thus the required force has a magnitude of \(5\) kilograms weight directed up the surface.

    If a nonzero vector \(\mathbf{d}\) is specified, the key idea in Example 4.2.6 is to be able to write an arbitrary vector \(\mathbf{u}\) as a sum of two vectors,

    \[\mathbf{u} = \mathbf{u}_{1} + \mathbf{u}_{2} \nonumber \]

    where \(\mathbf{u}_{1}\) is parallel to \(\mathbf{d}\) and \(\mathbf{u}_{2} = \mathbf{u} - \mathbf{u}_{1}\) is orthogonal to \(\mathbf{d}\). Suppose that \(\mathbf{u}\) and \(\mathbf{d} \neq \mathbf{0}\) emanate from a common tail \(Q\) (see Figure \(\PageIndex{5}\)).

    clipboard_ee022055f0f0c08971e3af037e313ea82.png
    Figure \(\PageIndex{5}\)

    Let \(P\) be the tip of \(\mathbf{u}\), and let \(P_{1}\) denote the foot of the perpendicular from \(P\) to the line through \(Q\) parallel to \(\mathbf{d}\).

    Then \(\mathbf{u}_{1} = \longvect{QP}_{1}\) has the required properties:

    1. \(\mathbf{u}_{1}\) is parallel to \(\mathbf{d}\).
    2. \(\mathbf{u}_{2} = \mathbf{u} - \mathbf{u}_{1}\) is orthogonal to \(\mathbf{d}\).
    3. \(\mathbf{u} = \mathbf{u}_{1} + \mathbf{u}_{2}\).
    Definition \(\PageIndex{3}\): Projection in \(\mathbb{R}^3\)

    The vector \(\mathbf{u}_{1} = \longvect{QP}_{1}\) in Figure [fig:011945] is called the projection of \(\mathbf{u}\) on \(\mathbf{d}\). It is denoted

    \[\mathbf{u}_1 = \text{proj}{\mathbf{d}}{\mathbf{u}} \nonumber \]

    In Figure \(\PageIndex{5}\)(a) the vector \(\mathbf{u}_{1} = \text{proj}{\mathbf{d}}{\mathbf{u}}\) has the same direction as \(\mathbf{d}\); however, \(\mathbf{u}_{1}\) and \(\mathbf{d}\) have opposite directions if the angle between \(\mathbf{u}\) and \(\mathbf{d}\) is greater than \(\frac{\pi}{2}\) ( Figure \(\PageIndex{5}\)(b)). Note that the projection \(\mathbf{u}_1 = \text{proj}{\mathbf{d}}{\mathbf{u}}\) is zero if and only if \(\mathbf{u}\) and \(\mathbf{d}\) are orthogonal.

    Calculating the projection of \(\mathbf{u}\) on \(\mathbf{d} \neq \mathbf{0}\) is remarkably easy.

    Theorem \(\PageIndex{4}\)

    Let \(\mathbf{u}\) and \(\mathbf{d} \neq \mathbf{0}\) be vectors.

    1. The projection of \(\mathbf{u}\) on \(\mathbf{d}\) is given by \(\text{proj}{\mathbf{d}}{\mathbf{u}} = \frac{\mathbf{u} \cdot \mathbf{d}}{\| \mathbf{d} \|^2} \mathbf{d}\).
    2. The vector \(\mathbf{u} - \text{proj}{\mathbf{d}}{\mathbf{u}}\) is orthogonal to \(\mathbf{d}\).
    Proof

    The vector \(\mathbf{u}_{1} = \text{proj}{\mathbf{d}}{\mathbf{u}}\) is parallel to \(\mathbf{d}\) and so has the form \(\mathbf{u}_{1} = t\mathbf{d}\) for some scalar \(t\). The requirement that \(\mathbf{u} - \mathbf{u}_{1}\) and \(\mathbf{d}\) are orthogonal determines \(t\). In fact, it means that \((\mathbf{u} - \mathbf{u}_{1}) \cdot \mathbf{d} = 0\) by Theorem 4.2.3. If \(\mathbf{u}_{1} = t\mathbf{d}\) is substituted here, the condition is

    \[0 = (\mathbf{u} - t\mathbf{d}) \cdot \mathbf{d} = \mathbf{u} \cdot \mathbf{d} - t(\mathbf{d} \cdot \mathbf{d}) = \mathbf{u} \cdot \mathbf{d} - t\| \mathbf{d} \|^2 \nonumber \]

    It follows that \(t = \frac{\mathbf{u} \cdot \mathbf{d}}{\| \mathbf{d} \|^2}\), where the assumption that \(\mathbf{d} \neq \mathbf{0}\) guarantees that \(\| \mathbf{d} \|^{2} \neq 0\).

    \(\square\)

    Example \(\PageIndex{7}\)

    Find the projection of \(\mathbf{u} = \left[ \begin{array}{r} 2 \\ -3 \\ 1 \end{array} \right]\) on \(\mathbf{d} = \left[ \begin{array}{r} 1\\ -1 \\ 3 \end{array} \right]\) and express \(\mathbf{u} = \mathbf{u}_{1} + \mathbf{u}_{2}\) where \(\mathbf{u}_{1}\) is parallel to \(\mathbf{d}\) and \(\mathbf{u}_{2}\) is orthogonal to \(\mathbf{d}\).

    Solution

    The projection \(\mathbf{u}_{1}\) of \(\mathbf{u}\) on \(\mathbf{d}\) is

    \[\mathbf{u}_{1} = \text{proj}{\mathbf{d}}{\mathbf{u}} = \frac{\mathbf{u} \cdot \mathbf{d}}{\| \mathbf{d} \|^2}\mathbf{d} = \frac{2 + 3 + 3}{1^2 + (-1)^2 + 3^2} \left[ \begin{array}{r} 1\\ -1 \\ 3 \end{array} \right] = \frac{8}{11}\left[ \begin{array}{r} 1\\ -1 \\ 3 \end{array} \right] \nonumber \]

    Hence \(\mathbf{u}_{2} = \mathbf{u} - \mathbf{u}_{1} = \frac{1}{11}\left[ \begin{array}{r} 14\\ -25 \\ -13 \end{array} \right]\), and this is orthogonal to \(\mathbf{d}\) by Theorem 4.2.4 (alternatively, observe that \(\mathbf{d} \cdot \mathbf{u}_{2} = 0\)). Since \(\mathbf{u} = \mathbf{u}_{1} + \mathbf{u}_{2}\), we are done.

    Example \(\PageIndex{8}\)

    Find the shortest distance (see diagram) from the point \(P(1, 3, -2)\) to the line through \(P_{0}(2, 0, -1)\) with direction vector \(\mathbf{d} = \left[ \begin{array}{r} 1\\ -1 \\ 0 \end{array} \right]\). Also find the point \(Q\) that lies on the line and is closest to \(P\).

    clipboard_e3513a26ecc167bc4aa5454405583c57e.png
    Solution

    Let \(\mathbf{u} = \left[ \begin{array}{r} 1\\ 3 \\ -2 \end{array} \right] - \left[ \begin{array}{r} 2\\ 0 \\ -1 \end{array} \right] = \left[ \begin{array}{r} -1\\ 3 \\ -1 \end{array} \right]\) denote the vector from \(P_{0}\) to \(P\), and let \(\mathbf{u}_{1}\) denote the projection of \(\mathbf{u}\) on \(\mathbf{d}\). Thus

    \[\mathbf{u}_{1} = \frac{\mathbf{u} \cdot \mathbf{d}}{\| \mathbf{d} \|^2}\mathbf{d} = \frac{-1 - 3 + 0}{1^2 + (-1)^2 + 0^2}\mathbf{d} = -2\mathbf{d} = \left[ \begin{array}{r} -2\\ 2 \\ 0 \end{array} \right] \nonumber \]

    by Theorem 4.2.4. We see geometrically that the point \(Q\) on the line is closest to \(P\), so the distance is

    \[\| \longvect{QP} \| = \| \mathbf{u} - \mathbf{u}_{1} \| = \left\| \left[ \begin{array}{r} 1\\ 1 \\ -1 \end{array} \right] \right\| = \sqrt{3} \nonumber \]

    To find the coordinates of \(Q\), let \(\mathbf{p}_{0}\) and \(\mathbf{q}\) denote the vectors of \(P_{0}\) and \(Q\), respectively. Then \(\mathbf{p}_{0} = \left[ \begin{array}{r} 2\\ 0 \\ -1 \end{array} \right]\) and \(\mathbf{q} = \mathbf{p}_{0} + \mathbf{u}_{1} = \left[ \begin{array}{r} 0\\ 2 \\ -1 \end{array} \right]\). Hence \(Q(0, 2, -1)\) is the required point. It can be checked that the distance from \(Q\) to \(P\) is \(\sqrt{3}\), as expected.

    Planes

    It is evident geometrically that among all planes that are perpendicular to a given straight line there is exactly one containing any given point. This fact can be used to give a very simple description of a plane. To do this, it is necessary to introduce the following notion:

    Definition \(\PageIndex{4}\): Normal Vector in a Plane

    A nonzero vector \(\mathbf{n}\) is called a normal for a plane if it is orthogonal to every vector in the plane.

    For example, the coordinate vector \(\mathbf{k}\) is a normal for the \(x\)-\(y\) plane.

    clipboard_e1e7bd791766657945b621408ee4d1c2a.png
    Figure \(\PageIndex{6}\)

    Given a point \(P_{0} = P_{0}(x_{0}, y_{0}, z_{0})\) and a nonzero vector \(\mathbf{n}\), there is a unique plane through \(P_{0}\) with normal \(\mathbf{n}\), shaded in Figure \(\PageIndex{6}\). A point \(P = P(x, y, z)\) lies on this plane if and only if the vector \(\longvect{P_{0}P}\) is orthogonal to \(\mathbf{n}\)—that is, if and only if \(\mathbf{n} \cdot \longvect{P_{0}P} = 0\). Because \(\longvect{P_{0}P} = \left[ \begin{array}{c} x - x_{0}\\ y - y_{0}\\ z - z_{0} \end{array} \right]\) this gives the following result:

    Theorem: Scalar Equation of a Plane

    The plane through \(P_{0}(x_{0}, y_{0}, z_{0})\) with normal \(\mathbf{n} = \left[ \begin{array}{c} a\\ b\\ c \end{array} \right] \neq \mathbf{0}\) as a normal vector is given by

    \[a(x - x_{0}) + b(y - y_{0}) + c(z - z_{0}) = 0 \nonumber \]

    In other words, a point \(P(x, y, z)\) is on this plane if and only if \(x\), \(y\), and \(z\) satisfy this equation.

    Example \(\PageIndex{9}\)

    Find an equation of the plane through \(P_{0}(1, -1, 3)\) with \(\mathbf{n} = \left[ \begin{array}{r} 3\\ -1\\ 2 \end{array} \right]\) as normal.

    Solution

    Here the general scalar equation becomes

    \[3(x - 1) - (y + 1) + 2(z - 3) = 0 \nonumber \]

    This simplifies to \(3x - y + 2z = 10\).

    If we write \(d = ax_{0} + by_{0} + cz_{0}\), the scalar equation shows that every plane with normal \(\mathbf{n} = \left[ \begin{array}{r} a\\ b\\ c \end{array} \right]\) has a linear equation of the form

    \[\label{eq:linerformeq} ax + by + cz = d \]

    for some constant \(d\). Conversely, the graph of this equation is a plane with \(\mathbf{n} = \left[ \begin{array}{r} a\\ b\\ c \end{array} \right]\) as a normal vector (assuming that \(a\), \(b\), and \(c\) are not all zero).

    Example \(\PageIndex{10}\)

    Find an equation of the plane through \(P_{0}(3, -1, 2)\) that is parallel to the plane with equation \(2x - 3y = 6\).

    Solution

    The plane with equation \(2x -3y = 6\) has normal \(\mathbf{n} = \left[ \begin{array}{r} 2\\ -3\\ 0 \end{array} \right]\). Because the two planes are parallel, \(\mathbf{n}\) serves as a normal for the plane we seek, so the equation is \(2x - 3y = d\) for some \(d\) by Equation \ref{eq:linerformeq}. Insisting that \(P_{0}(3, -1, 2)\) lies on the plane determines \(d\); that is, \(d = 2 \cdot 3 - 3(-1) = 9\). Hence, the equation is \(2x - 3y = 9\).

    Consider points \(P_{0}(x_{0}, y_{0}, z_{0})\) and \(P(x, y, z)\) with vectors \(\mathbf{p}_{0} = \left[ \begin{array}{r} x_{0}\\ y_{0}\\ z_{0} \end{array} \right]\) and \(\mathbf{p}= \left[ \begin{array}{r} x\\ y\\ z \end{array} \right]\). Given a nonzero vector \(\mathbf{n}\), the scalar equation of the plane through \(P_{0}(x_{0}, y_{0}, z_{0})\) with normal \(\mathbf{n} = \left[ \begin{array}{r} a\\ b\\ c \end{array} \right]\) takes the vector form:

    Theorem: Vector Equation of a Plan

    The plane with normal \(\mathbf{n} \neq \mathbf{0}\) through the point with vector \(\mathbf{p}_{0}\) is given by

    \[\mathbf{n} \cdot (\mathbf{p} - \mathbf{p}_{0}) = 0 \nonumber \]

    In other words, the point with vector \(\mathbf{p}\) is on the plane if and only if \(\mathbf{p}\) satisfies this condition.

    Moreover, Equation \ref{eq:linerformeq} translates as follows:

    Every plane with normal \(\mathbf{n}\) has vector equation \(\mathbf{n} \cdot \mathbf{p} = d\) for some number \(d\).

    This is useful in the second solution of Example \(\PageIndex{11}\).

    Example \(\PageIndex{11}\)

    Find the shortest distance from the point \(P(2, 1, -3)\) to the plane with equation \(3x - y + 4z = 1\). Also find the point \(Q\) on this plane closest to \(P\).

    Solution

    The plane in question has normal \(\mathbf{n} = \left[ \begin{array}{r} 3\\ -1\\ 4 \end{array} \right]\). Choose any point \(P_{0}\) on the plane—say \(P_{0}(0, -1, 0)\)—and let \(Q(x, y, z)\) be the point on the plane closest to \(P\) (see the diagram).

    clipboard_ea47c766eaf0b8690d5e0d38fa46ad34d.png

    The vector from \(P_{0}\) to \(P\) is \(\mathbf{u} = \left[ \begin{array}{r} 2\\ 2\\ -3 \end{array} \right]\). Now erect \(\mathbf{n}\) with its tail at \(P_{0}\). Then \(\longvect{QP} = \mathbf{u}_{1}\) and \(\mathbf{u}_{1}\) is the projection of \(\mathbf{u}\) on \(\mathbf{n}\):

    \[\mathbf{u}_{1} = \frac{\mathbf{n} \cdot \mathbf{u}}{\| \mathbf{n} \|^2}\mathbf{n} = \frac{-8}{26} \left[ \begin{array}{r} 3\\ -1 \\ 4 \end{array} \right] = \frac{-4}{13} \left[ \begin{array}{r} 3\\ -1 \\ 4 \end{array} \right] \nonumber \]

    Hence the distance is \(\| \longvect{QP} \| = \| \mathbf{u}_{1} \| = \frac{4\sqrt{26}}{13}\). To calculate the point \(Q\), let \(\mathbf{q} = \left[ \begin{array}{r} x\\ y \\ z \end{array} \right]\) and \(\mathbf{p}_{0} = \left[ \begin{array}{r} 0\\ -1 \\ 0 \end{array} \right]\) be the vectors of \(Q\) and \(P_{0}\). Then

    \[\mathbf{q} = \mathbf{p}_{0} + \mathbf{u} - \mathbf{u}_{1} = \left[ \begin{array}{r} 0\\ -1 \\ 0 \end{array} \right] + \left[ \begin{array}{r} 2\\ 2 \\ -3 \end{array} \right] + \frac{4}{13} \left[ \begin{array}{r} 3\\ -1 \\ 4 \end{array} \right] = \left[ \def\arraystretch{1.5} \begin{array}{r} \frac{38}{13}\\ \frac{9}{13}\\ \frac{-23}{13} \end{array} \right] \nonumber \]

    This gives the coordinates of \(Q(\frac{38}{13}, \frac{9}{13}, \frac{-23}{13})\).

    Let \(\mathbf{q}= \left[ \begin{array}{c} x\\ y \\ z \end{array} \right]\) and \(\mathbf{p} = \left[ \begin{array}{r} 2\\ 1 \\ -3 \end{array} \right]\) be the vectors of \(Q\) and \(P\). Then \(Q\) is on the line through \(P\) with direction vector \(\mathbf{n}\), so \(\mathbf{q} = \mathbf{p} + t\mathbf{n}\) for some scalar \(t\). In addition, \(Q\) lies on the plane, so \(\mathbf{n} \cdot \mathbf{q} = 1\). This determines \(t\):

    \[1 = \mathbf{n} \cdot \mathbf{q} = \mathbf{n} \cdot (\mathbf{p} + t\mathbf{n}) = \mathbf{n} \cdot \mathbf{p} + t\| \mathbf{n} \|^2 = -7 + t(26) \nonumber \]

    This gives \(t = \frac{8}{26} = \frac{4}{13}\), so

    \[\left[ \begin{array}{c} x\\ y \\ z \end{array} \right] = \mathbf{q} = \mathbf{p} + t\mathbf{n} = \left[ \begin{array}{r} 2\\ 1 \\ -3 \end{array} \right] + \frac{4}{13} \left[ \begin{array}{r} 3\\ -1 \\ 4 \end{array} \right] = \frac{1}{13} \left[ \begin{array}{r} 38\\ 9 \\ -23 \end{array} \right] \nonumber \]

    as before. This determines \(Q\) (in the diagram), and the reader can verify that the required distance is \(\| \longvect{QP} \| = \frac{4}{13}\sqrt{26}\), as before.

    The Cross Product

    If \(P\), \(Q\), and \(R\) are three distinct points in \(\mathbb{R}^3\) that are not all on some line, it is clear geometrically that there is a unique plane containing all three. The vectors \(\longvect{PQ}\) and \(\longvect{PR}\) both lie in this plane, so finding a normal amounts to finding a nonzero vector orthogonal to both \(\longvect{PQ}\) and \(\longvect{PR}\). The cross product provides a systematic way to do this.

    Definition: Cross Product

    Given vectors \(\mathbf{v}_{1}= \left[ \begin{array}{c} x_{1}\\ y_{1} \\ z_{1} \end{array} \right]\) and \(\mathbf{v}_{2}= \left[ \begin{array}{c} x_{2}\\ y_{2} \\ z_{2} \end{array} \right]\), define the cross product \(\mathbf{v}_{1} \times \mathbf{v}_{2}\) by

    \[\mathbf{v}_{1} \times \mathbf{v}_{2} = \left[ \begin{array}{c} y_{1}z_{2} - z_{1}y_{2}\\ -(x_{1}z_{2} - z_{1}x_{2}) \\ x_{1}y_{2} - y_{1}x_{2} \end{array} \right] \nonumber \]

    (Because it is a vector, \(\mathbf{v}_{1} \times \mathbf{v}_{2}\) is often called the vector product.) There is an easy way to remember this definition using the coordinate vectors:

    \[\mathbf{i}= \left[ \begin{array}{c} 1\\ 0 \\ 0 \end{array} \right], \ \mathbf{j}= \left[ \begin{array}{c} 0\\ 1 \\ 0 \end{array} \right], \mbox{ and } \mathbf{k}= \left[ \begin{array}{c} 0\\ 0 \\ 1 \end{array} \right] \nonumber \]

    They are vectors of length \(1\) pointing along the positive \(x\), \(y\), and \(z\) axes, respectively, as in Figure \(\PageIndex{7}\).

    clipboard_ee0e776e41ae520dd56ea44eb67156b03.png
    Figure \(\PageIndex{7}\)

    The reason for the name is that any vector can be written as

    \[\left[ \begin{array}{c} x\\ y \\ z \end{array} \right] = x\mathbf{i} + y\mathbf{j} + z\mathbf{k} \nonumber \]

    With this, the cross product can be described as follows:

    Theorem: Determinant Form of the Cross Product

    If \(\mathbf{v}_{1}= \left[ \begin{array}{c} x_{1}\\ y_{1}\\ z_{1} \end{array} \right]\) and \(\mathbf{v}_{2}= \left[ \begin{array}{c} x_{2}\\ y_{2}\\ z_{2} \end{array} \right]\) are two vectors, then

    \[\mathbf{v}_{1} \times \mathbf{v}_{2} = \det \left[ \begin{array}{ccc} \mathbf{i} & x_{1} & x_{2}\\ \mathbf{j} & y_{1} & y_{2}\\ \mathbf{k} & z_{1} & z_{2} \end{array} \right] = \left| \begin{array}{cc} y_{1} & y_{2}\\ z_{1} & z_{2} \end{array} \right|\mathbf{i} - \left| \begin{array}{cc} x_{1} & x_{2}\\ z_{1} & z_{2} \end{array} \right|\mathbf{j} + \left| \begin{array}{cc} x_{1} & x_{2}\\ y_{1} & y_{2} \end{array} \right|\mathbf{k} \nonumber \]

    where the determinant is expanded along the first column.

    Example \(\PageIndex{12}\)

    If \(\mathbf{v} = \left[ \begin{array}{r} 2\\ -1\\ 4 \end{array} \right]\) and \(\mathbf{w} = \left[ \begin{array}{r} 1\\ 3\\ 7 \end{array} \right]\), then

    \[\begin{aligned} \mathbf{v}_{1} \times \mathbf{v}_{2} = \det \left[ \begin{array}{rrr} \mathbf{i} & 2 & 1\\ \mathbf{j} & -1 & 3\\ \mathbf{k} & 4 & 7 \end{array} \right] &= \left| \begin{array}{rr} -1 & 3\\ 4 & 7 \end{array} \right|\mathbf{i} - \left| \begin{array}{rr} 2 & 1\\ 4 & 7 \end{array} \right|\mathbf{j} + \left| \begin{array}{rr} 2 & 1\\ -1 & 3 \end{array} \right|\mathbf{k}\\ &= -19\mathbf{i} - 10\mathbf{j} + 7\mathbf{k}\\ &= \left[ \begin{array}{r} -19\\ -10\\ 7 \end{array} \right]\end{aligned} \nonumber \]

    Observe that \(\mathbf{v} \times \mathbf{w}\) is orthogonal to both \(\mathbf{v}\) and \(\mathbf{w}\) in Example 4.2.12. This holds in general as can be verified directly by computing \(\mathbf{v} \cdot (\mathbf{v} \times \mathbf{w})\) and \(\mathbf{w} \cdot (\mathbf{v} \times \mathbf{w})\), and is recorded as the first part of the following theorem. It will follow from a more general result which, together with the second part, will be proved in Section 4.3 where a more detailed study of the cross product will be undertaken.

    Theorem \(\PageIndex{5}\)

    Let \(\mathbf{v}\) and \(\mathbf{w}\) be vectors in \(\mathbb{R}^3\).

    1. \(\mathbf{v} \times \mathbf{w}\) is a vector orthogonal to both \(\mathbf{v}\) and \(\mathbf{w}\).
    2. If \(\mathbf{v}\) and \(\mathbf{w}\) are nonzero, then \(\mathbf{v} \times \mathbf{w} = \mathbf{0}\) if and only if \(\mathbf{v}\) and \(\mathbf{w}\) are parallel.

    It is interesting to contrast Theorem 4.2.5(2) with the assertion (in Theorem 4.2.3) that

    \[\mathbf{v} \cdot \mathbf{w} = 0 \quad \mbox{ if and only if }\mathbf{v}\mbox{ and }\mathbf{w}\mbox{ are orthogonal.} \nonumber \]

    Example \(\PageIndex{13}\)

    Find the equation of the plane through \(P(1, 3, -2)\), \(Q(1, 1, 5)\), and \(R(2, -2, 3)\).

    Solution

    The vectors \(\longvect{PQ} = \left[ \begin{array}{r} 0\\ -2\\ 7 \end{array} \right]\) and \(\longvect{PR} = \left[ \begin{array}{r} 1\\ -5\\ 5 \end{array} \right]\) lie in the plane, so

    \[\longvect{PQ} \times \longvect{PR} = \det \left[ \begin{array}{rrr} \mathbf{i} & 0 & 1\\ \mathbf{j} & -2 & -5\\ \mathbf{k} & 7 & 5 \end{array} \right] = 25\mathbf{i} + 7\mathbf{j} + 2\mathbf{k} = \left[ \begin{array}{r} 25\\ 7\\ 2 \end{array} \right] \nonumber \]

    is a normal for the plane (being orthogonal to both \(\longvect{PQ}\) and \(\longvect{PR}\)). Hence the plane has equation

    \[25x + 7y + 2z = d \quad \mbox{ for some number }d. \nonumber \]

    Since \(P(1, 3, -2)\) lies in the plane we have \(25 \cdot 1 + 7 \cdot 3 + 2(-2) = d\). Hence \(d = 42\) and the equation is \(25x + 7y + 2z = 42\). Incidentally, the same equation is obtained (verify) if \(\longvect{QP}\) and \(\longvect{QR}\), or \(\longvect{RP}\) and \(\longvect{RQ}\), are used as the vectors in the plane.

    Example \(\PageIndex{14}\)

    Find the shortest distance between the nonparallel lines

    \[\left[ \begin{array}{c} x\\ y\\ z \end{array} \right] = \left[ \begin{array}{r} 1\\ 0\\ -1 \end{array} \right] +t \left[ \begin{array}{r} 2\\ 0\\ 1 \end{array} \right] \quad \mbox{ and } \quad \left[ \begin{array}{c} x\\ y\\ z \end{array} \right] = \left[ \begin{array}{r} 3\\ 1\\ 0 \end{array} \right] +s \left[ \begin{array}{r} 1\\ 1\\ -1 \end{array} \right] \nonumber \]

    Then find the points \(A\) and \(B\) on the lines that are closest together.

    Solution

    Direction vectors for the two lines are \(\mathbf{d}_{1} = \left[ \begin{array}{r} 2\\ 0\\ 1 \end{array} \right]\) and \(\mathbf{d}_{2} = \left[ \begin{array}{r} 1\\ 1\\ -1 \end{array} \right]\), so

    \[\mathbf{n} = \mathbf{d}_{1} \times \mathbf{d}_{2} = \det \left[ \begin{array}{rrr} \mathbf{i} & 2 & 1\\ \mathbf{j} & 0 & 1\\ \mathbf{k} & 1 & -1 \end{array} \right] = \left[ \begin{array}{r} -1\\ 3\\ 2 \end{array} \right] \nonumber \]

    is perpendicular to both lines. Consider the plane shaded in the diagram containing the first line with \(\mathbf{n}\) as normal. This plane contains \(P_{1}(1, 0, -1)\) and is parallel to the second line. Because \(P_{2}(3, 1, 0)\) is on the second line, the distance in question is just the shortest distance between \(P_{2}(3, 1, 0)\) and this plane.

    clipboard_e1ac67ca311f58262e7aaa7fe5290ea65.png

    The vector \(\mathbf{u}\) from \(P_{1}\) to \(P_{2}\) is \(\mathbf{u} = \longvect{P_{1}P}_{2} = \left[ \begin{array}{r} 2\\ 1\\ 1 \end{array} \right]\) and so, as in Example \(\PageIndex{11}\), the distance is the length of the projection of \(\mathbf{u}\) on \(\mathbf{n}\).

    \[\mbox{distance }= \left\| \frac{\mathbf{u} \cdot \mathbf{n}}{\| \mathbf{n} \|^2}\mathbf{n} \right\| = \frac{|\mathbf{u} \cdot \mathbf{n}|}{\| \mathbf{n} \|} = \frac{3}{\sqrt{14}} = \frac{3\sqrt{14}}{14} \nonumber \]

    Note that it is necessary that \(\mathbf{n} = \mathbf{d}_{1} \times \mathbf{d}_{2}\) be nonzero for this calculation to be possible. As is shown later (Theorem 4.3.4), this is guaranteed by the fact that \(\mathbf{d}_{1}\) and \(\mathbf{d}_{2}\) are not parallel.

    The points \(A\) and \(B\) have coordinates \(A(1 + 2t, 0, t - 1)\) and \(B(3 + s, 1 + s, -s)\) for some \(s\) and \(t\), so \(\longvect{AB} = \left[ \begin{array}{c} 2 + s - 2t\\ 1 + s\\ 1 - s - t \end{array} \right]\). This vector is orthogonal to both \(\mathbf{d}_{1}\) and \(\mathbf{d}_{2}\), and the conditions \(\longvect{AB} \cdot \mathbf{d}_{1} = 0\) and \(\longvect{AB} \cdot \mathbf{d}_{2} = 0\) give equations \(5t - s = 5\) and \(t -3s = 2\). The solution is \(s = \frac{-5}{14}\) and \(t = \frac{13}{14}\), so the points are \(A(\frac{40}{14}, 0, \frac{-1}{14})\) and \(B(\frac{37}{14}, \frac{9}{14}, \frac{5}{14})\). We have \(\| \longvect{AB} \| = \frac{3\sqrt{14}}{14}\), as before.


    1. Similarly, if \(\mathbf{v} = \left[ \begin{array}{c} x_{1} \\ y_{1} \end{array} \right]\) and \(\mathbf{w} = \left[ \begin{array}{c} x_{2} \\ y_{2} \end{array} \right]\) in \(\mathbb{R}^2\), then \(\mathbf{v} \cdot \mathbf{w} = x_{1}x_{2} + y_{1}y_{2}\).

    This page titled 4.2: Projections and Planes is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by W. Keith Nicholson via source content that was edited to the style and standards of the LibreTexts platform.