4.10: Orthogonal Projections
( \newcommand{\kernel}{\mathrm{null}\,}\)
- Find the orthogonal projection of a vector onto a subspace.
- Find the orthogonal complement of a subspace.
In this section, we compute orthogonal projections of vectors onto subspaces.
An important use of the Gram-Schmidt Process is in orthogonal projections, the focus of this section.
You may recall that a subspace of Rn is a set of vectors which contains the zero vector, and is closed under addition and scalar multiplication. Let’s call such a subspace W. In particular, a plane in Rn which contains the origin, (0,0,⋯,0), is a subspace of Rn.
Suppose a point Y in Rn is not contained in W, then what point Z in W is closest to Y? Using the Gram-Schmidt Process, we can find such a point. Let →y,→z represent the position vectors of the points Y and Z respectively, with →y−→z representing the vector connecting the two points Y and Z. It will follow that if Z is the point on W closest to Y, then →y−→z will be perpendicular to W (can you see why?); in other words, →y−→z is orthogonal to W (and to every vector contained in W) as in the following diagram.

The vector →z is called the orthogonal projection of →y on W. The definition is given as follows.
Let W be a subspace of Rn, and Y be any point in Rn. Then the orthogonal projection of Y onto W is given by →z=projW(→y)=(→y⋅→w1‖→w1‖2)→w1+(→y⋅→w2‖→w2‖2)→w2+⋯+(→y⋅→wm‖→wm‖2)→wm where {→w1,→w2,⋯,→wm} is any orthogonal basis of W.
Therefore, in order to find the orthogonal projection, we must first find an orthogonal basis for the subspace. Note that one could use an orthonormal basis, but it is not necessary in this case since as you can see above the normalization of each vector is included in the formula for the projection.
Before we explore this further through an example, we show that the orthogonal projection does indeed yield a point Z (the point whose position vector is the vector →z above) which is the point of W closest to Y.
Let W be a subspace of Rn and Y any point in Rn. Let Z be the point whose position vector is the orthogonal projection of Y onto W.
Then, Z is the point in W closest to Y.
- Proof
-
First Z is certainly a point in W since it is in the span of a basis of W.
To show that Z is the point in W closest to Y, we wish to show that |→y−→z1|>|→y−→z| for all →z1≠→z∈W. We begin by writing →y−→z1=(→y−→z)+(→z−→z1). Now, the vector →y−→z is orthogonal to W, and →z−→z1 is contained in W. Therefore these vectors are orthogonal to each other. By the Pythagorean Theorem, we have that ‖→y−→z1‖2=‖→y−→z‖2+‖→z−→z1‖2>‖→y−→z‖2 This follows because →z≠→z1 so ‖→z−→z1‖2>0.
Hence, ‖→y−→z1‖2>‖→y−→z‖2. Taking the square root of each side, we obtain the desired result.
Consider the following example.
Let W be the plane through the origin given by the equation x−2y+z=0.
Find the point in W closest to the point Y=(1,0,3).
Solution
We must first find an orthogonal basis for W. Notice that W is characterized by all points (a,b,c) where c=2b−a. In other words, W=[ab2b−a]=a[10−1]+b[012],a,b∈R
We can thus write W as W=span{→u1,→u2}=span{[10−1],[012]}
Notice that this span is a basis of W as it is linearly independent. We will use the Gram-Schmidt Process to convert this to an orthogonal basis, {→w1,→w2}. In this case, as we remarked it is only necessary to find an orthogonal basis, and it is not required that it be orthonormal.
→w1=→u1=[10−1] →w2=→u2−(→u2⋅→w1‖→w1‖2)→w1=[012]−(−22)[10−1]=[012]+[10−1]=[111]
Therefore an orthogonal basis of W is {→w1,→w2}={[10−1],[111]}
We can now use this basis to find the orthogonal projection of the point Y=(1,0,3) on the subspace W. We will write the position vector →y of Y as →y=[103]. We compute the projection as follows: →z=projW(→y)=(→y⋅→w1‖→w1‖2)→w1+(→y⋅→w2‖→w2‖2)→w2=(−22)[10−1]+(43)[111]=[134373]
Therefore the point Z on W closest to the point (1,0,3) is (13,43,73).
Recall that the vector →y−→z is perpendicular (orthogonal) to all the vectors contained in the plane W. Using a basis for W, we can in fact find all such vectors which are perpendicular to W. We call this set of vectors the orthogonal complement of W and denote it W⊥.
Let W be a subspace of Rn. Then the orthogonal complement of W, written W⊥, is the set of all vectors →x such that →x⋅→z=0 for all vectors →z in W. W⊥={→x∈Rnsuch that→x⋅→z=0for all→z∈W}
The orthogonal complement is defined as the set of all vectors which are orthogonal to all vectors in the original subspace. It turns out that it is sufficient that the vectors in the orthogonal complement be orthogonal to a spanning set of the original space.
Let W be a subspace of Rn such that W=span{→w1,→w2,⋯,→wm}. Then W⊥ is the set of all vectors which are orthogonal to each →wi in the spanning set.
The following proposition demonstrates that the orthogonal complement of a subspace is itself a subspace.
Let W be a subspace of Rn. Then the orthogonal complement W⊥ is also a subspace of Rn.
Consider the following proposition.
The complement of Rn is the set containing the zero vector: (Rn)⊥={→0} Similarly, {→0}⊥=(Rn).
- Proof
-
Here, →0 is the zero vector of Rn. Since →x⋅→0=0 for all →x∈Rn, Rn⊆{→0}⊥. Since {→0}⊥⊆Rn, the equality follows, i.e., {→0}⊥=Rn.
Again, since →x⋅→0=0 for all →x∈Rn, →0∈(Rn)⊥, so {→0}⊆(Rn)⊥. Suppose →x∈Rn, →x≠→0. Since →x⋅→x=||→x||2 and →x≠→0, →x⋅→x≠0, so →x∉(Rn)⊥. Therefore (Rn)⊥⊆{→0}, and thus (Rn)⊥={→0}.
In the next example, we will look at how to find W⊥.
Let W be the plane through the origin given by the equation x−2y+z=0. Find a basis for the orthogonal complement of W.
Solution
From Example 4.10.1 we know that we can write W as W=span{→u1,→u2}=span{[10−1],[012]}
In order to find W⊥, we need to find all →x which are orthogonal to every vector in this span.
Let →x=[x1x2x3]. In order to satisfy →x⋅→u1=0, the following equation must hold. x1−x3=0
In order to satisfy →x⋅→u2=0, the following equation must hold. x2+2x3=0
Both of these equations must be satisfied, so we have the following system of equations. x1−x3=0x2+2x3=0
To solve, set up the augmented matrix.
[10−100120]
Using Gaussian Elimination, we find that W⊥=span{[1−21]}, and hence {[1−21]} is a basis for W⊥.
The following results summarize the important properties of the orthogonal projection.
Let W be a subspace of Rn, Y be any point in Rn, and let Z be the point in W closest to Y. Then,
- The position vector →z of the point Z is given by →z=projW(→y)
- →z∈W and →y−→z∈W⊥
- |Y−Z|<|Y−Z1| for all Z1≠Z∈W
Consider the following example of this concept.
Let →x1=[1010],→x2=[1011],→x3=[1100], and →v=[43−25]. We want to find the vector in W=span{→x1,→x2,→x3} closest to →y.
Solution
We will first use the Gram-Schmidt Process to construct the orthogonal basis, B, of W: B={[1010],[0001],[12−10]}.
By Theorem 4.10.2, projU(→v)=22[1010]+51[0001]+126[12−10]=[34−15] is the vector in U closest to →y.
Consider the next example.
Let W be a subspace given by W=span{[1010],[0102]}, and Y=(1,2,3,4).
Find the point Z in W closest to Y, and moreover write →y as the sum of a vector in W and a vector in W⊥.
Solution
From Theorem 4.10.3 the point Z in W closest to Y is given by →z=projW(→y).
Notice that since the above vectors already give an orthogonal basis for W, we have:
→z=projW(→y)=(→y⋅→w1‖→w1‖2)→w1+(→y⋅→w2‖→w2‖2)→w2=(42)[1010]+(105)[0102]=[2224]
Therefore the point in W closest to Y is Z=(2,2,2,4).
Now, we need to write →y as the sum of a vector in W and a vector in W⊥. This can easily be done as follows: →y=→z+(→y−→z) since →z is in W and as we have seen →y−→z is in W⊥.
The vector →y−→z is given by →y−→z=[1234]−[2224]=[−1010] Therefore, we can write →y as \left[ \begin{array}{c} 1 \\ 2 \\ 3 \\ 4 \end{array} \right] = \left[ \begin{array}{c} 2 \\ 2 \\ 2 \\ 4 \end{array} \right] + \left[ \begin{array}{r} -1 \\ 0 \\ 1 \\ 0 \end{array} \right]\nonumber
Find the point Z in the plane 3x+y-2z=0 that is closest to the point Y=(1,1,1).
Solution
The solution will proceed as follows.
- Find a basis X of the subspace W of \mathbb{R}^3 defined by the equation 3x+y-2z=0.
- Orthogonalize the basis X to get an orthogonal basis B of W.
- Find the projection on W of the position vector of the point Y.
We now begin the solution.
- 3x+y-2z=0 is a system of one equation in three variables. Putting the augmented matrix in reduced row-echelon form: \left[\begin{array}{rrr|r} 3 & 1 & -2 & 0 \end{array}\right] \rightarrow \left[\begin{array}{rrr|r} 1 & \frac{1}{3} & -\frac{2}{3} & 0 \end{array}\right]\nonumber gives general solution x=\frac{1}{3}s+\frac{2}{3}t, y=s, z=t for any s,t\in\mathbb{R}. Then W=\mathrm{span} \left\{ \left[\begin{array}{r} -\frac{1}{3} \\ 1 \\ 0 \end{array}\right], \left[\begin{array}{r} \frac{2}{3} \\ 0 \\ 1 \end{array}\right]\right\}\nonumber Let X=\left\{ \left[\begin{array}{r} -1 \\ 3 \\ 0 \end{array}\right], \left[\begin{array}{r} 2 \\ 0 \\ 3 \end{array}\right]\right\}. Then X is linearly independent and \mathrm{span}(X)=W, so X is a basis of W.
- Use the Gram-Schmidt Process to get an orthogonal basis of W: \vec{f}_1=\left[\begin{array}{r} -1\\3\\0\end{array}\right]\mbox{ and }\vec{f}_2=\left[\begin{array}{r}2\\0\\3\end{array}\right]-\frac{-2}{10}\left[\begin{array}{r}-1\\3\\0\end{array}\right]=\frac{1}{5}\left[\begin{array}{r}9\\3\\15\end{array}\right].\nonumber Therefore B=\left\{\left[\begin{array}{r}-1\\3\\0\end{array}\right], \left[\begin{array}{r}3\\1\\5 \end{array}\right]\right\} is an orthogonal basis of W.
- To find the point Z on W closest to Y=(1,1,1), compute \begin{aligned} \mathrm{proj}_{W}\left[\begin{array}{r} 1 \\ 1 \\ 1 \end{array}\right] & = \frac{2}{10} \left[\begin{array}{r} -1 \\ 3 \\ 0 \end{array}\right] + \frac{9}{35}\left[\begin{array}{r} 3 \\ 1 \\ 5 \end{array}\right]\\ & = \frac{1}{7}\left[\begin{array}{r} 4 \\ 6 \\ 9 \end{array}\right].\end{aligned} Therefore, Z=\left( \frac{4}{7}, \frac{6}{7}, \frac{9}{7}\right).