Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

2.7: Orthogonal projections and orthonormal bases in ℝ³

In Chapter 2.3, we broke a vector in R2\mathbb R^2 into two perpendicular components. Let’s extend that idea to R3\mathbb R^3. First, we’ll break a vector into a component along a line and a component in a plane perpendicular to that line. Then, we’ll use three perpendicular directions to describe the vector using an orthonormal basis.


Recalling projections in ℝ²

Let ℓ=span⁡(w⃗)\ell=\operatorname{span}(\vec w), where w⃗\vec w is nonzero. Given a vector v⃗\vec v in R2\mathbb R^2, we want to write

v⃗=v⃗1+v⃗2,\vec v=\vec v_1+\vec v_2,

where v⃗1\vec v_1 lies on ℓ\ell and v⃗2\vec v_2 lies on ℓ⊥\ell^\perp, the line perpendicular to ℓ\ell through the origin.

Since v⃗1\vec v_1 lies on ℓ\ell, we can write v⃗1=cw⃗\vec v_1=c\vec w for some scalar cc. The remaining vector is v⃗2=v⃗−cw⃗\vec v_2=\vec v-c\vec w. To make it perpendicular to ℓ\ell, we need

(v⃗−cw⃗)⋅w⃗=0,v⃗⋅w⃗−c(w⃗⋅w⃗)=0.\begin{aligned} (\vec v-c\vec w)\cdot\vec w&=0,\\ \vec v\cdot\vec w-c(\vec w\cdot\vec w)&=0. \end{aligned}

Solving for cc gives

c=v⃗⋅w⃗w⃗⋅w⃗.c=\frac{\vec v\cdot\vec w}{\vec w\cdot\vec w}.

Therefore,

v⃗1=proj⁡ℓ(v⃗)=v⃗⋅w⃗w⃗⋅w⃗w⃗,v⃗2=proj⁡ℓ⊥(v⃗)=v⃗−v⃗1.\vec v_1=\operatorname{proj}_{\ell}(\vec v) =\frac{\vec v\cdot\vec w}{\vec w\cdot\vec w}\vec w, \qquad \vec v_2=\operatorname{proj}_{\ell^\perp}(\vec v)=\vec v-\vec v_1.

Notice that w⃗\vec w does not need to have length one. We only need w⃗≠0⃗\vec w\ne\vec0, so that the denominator is nonzero.


Projecting onto a line and a plane in ℝ³

In R3\mathbb R^3, the vectors perpendicular to a line through the origin form a plane through the origin. Let ℓ=span⁡(w⃗)\ell=\operatorname{span}(\vec w) and let P=ℓ⊥P=\ell^\perp. Equivalently, ℓ=P⊥\ell=P^\perp: the vectors perpendicular to every vector in PP form the line ℓ\ell.

We again want to write v⃗=v⃗1+v⃗2\vec v=\vec v_1+\vec v_2, but now v⃗1\vec v_1 lies on ℓ\ell and v⃗2\vec v_2 lies in PP. The derivation above still works! It only uses dot products, so adding a third coordinate does not change the argument.

Loading...

The blue component v⃗1\vec v_1 lies on ℓ=P⊥\ell=P^\perp, and the orange component v⃗2\vec v_2 lies in PP. Together, they add to v⃗\vec v. Drag to rotate the picture.

If w⃗\vec w is a nonzero normal vector to PP, we can first find the component along ℓ=span⁡(w⃗)\ell=\operatorname{span}(\vec w), then subtract it from v⃗\vec v.

Why does the second component lie in PP? Recall from Chapter 2.5 that PP consists of the vectors whose dot product with its normal w⃗\vec w is zero. Our choice of cc ensures exactly that:

w⃗⋅(v⃗−cw⃗)=0.\vec w\cdot(\vec v-c\vec w)=0.

Example: Projecting onto a plane

Let

v⃗=[512],P: 2x−3y+4z=0.\vec v=\begin{bmatrix}5\\1\\2\end{bmatrix},\qquad P:\ 2x-3y+4z=0.

Find the projections of v⃗\vec v onto ℓ=P⊥\ell=P^\perp and onto PP.

The coefficients in the equation of PP give us a normal vector:

w⃗=[2−34],ℓ=span⁡(w⃗).\vec w=\begin{bmatrix}2\\-3\\4\end{bmatrix},\qquad \ell=\operatorname{span}(\vec w).

We compute

v⃗⋅w⃗=5(2)+1(−3)+2(4)=15,\vec v\cdot\vec w=5(2)+1(-3)+2(4)=15,
w⃗⋅w⃗=22+(−3)2+42=29.\vec w\cdot\vec w=2^2+(-3)^2+4^2=29.

So the projection onto the line is

v⃗1=proj⁡ℓ(v⃗)=1529[2−34]=[30/29−45/2960/29].\vec v_1=\operatorname{proj}_{\ell}(\vec v) =\frac{15}{29}\begin{bmatrix}2\\-3\\4\end{bmatrix} =\begin{bmatrix}30/29\\-45/29\\60/29\end{bmatrix}.

Subtracting this from v⃗\vec v gives the projection onto the plane:

v⃗2=proj⁡P(v⃗)=[512]−[30/29−45/2960/29]=[115/2974/29−2/29].\begin{aligned} \vec v_2=\operatorname{proj}_P(\vec v) &=\begin{bmatrix}5\\1\\2\end{bmatrix} -\begin{bmatrix}30/29\\-45/29\\60/29\end{bmatrix}\\ &=\begin{bmatrix}115/29\\74/29\\-2/29\end{bmatrix}. \end{aligned}

Let’s check that v⃗2\vec v_2 lies in PP by substituting its coordinates into the plane’s equation:

2(11529)−3(7429)+4(−229)=230−222−829=0.2\left(\frac{115}{29}\right)-3\left(\frac{74}{29}\right) +4\left(-\frac{2}{29}\right) =\frac{230-222-8}{29}=0.

Also, v⃗−v⃗2=v⃗1\vec v-\vec v_2=\vec v_1 is a multiple of the normal vector, so it is perpendicular to PP.


Orthonormal bases in ℝ³

So far, we have broken a vector into a component along a line and a component in a plane. Can we break the plane component into two perpendicular components as well?

Choose two perpendicular lines through the origin in PP. Both are perpendicular to ℓ=P⊥\ell=P^\perp, so we now have three mutually perpendicular lines. Choosing a unit vector along each line gives three perpendicular unit directions. These play the same role as the two vectors in an orthonormal basis of R2\mathbb R^2 from Chapter 2.2.

“Pairwise orthogonal” means that each pair of distinct vectors is orthogonal. We need to check all three dot products.

Every vector in R3\mathbb R^3 can be written uniquely as a linear combination of these three directions. Geometrically, we can first project onto the line along u⃗1\vec u_1 and its perpendicular plane, then split the plane component along u⃗2\vec u_2 and u⃗3\vec u_3.

Example: The standard basis

The standard basis vectors

e⃗1=[100],e⃗2=[010],e⃗3=[001]\vec e_1=\begin{bmatrix}1\\0\\0\end{bmatrix},\qquad \vec e_2=\begin{bmatrix}0\\1\\0\end{bmatrix},\qquad \vec e_3=\begin{bmatrix}0\\0\\1\end{bmatrix}

form an orthonormal basis. Each has length one, and every pair has dot product zero. For example,

[512]=5e⃗1+e⃗2+2e⃗3.\begin{bmatrix}5\\1\\2\end{bmatrix}=5\vec e_1+\vec e_2+2\vec e_3.

Example: A different orthonormal basis

Consider

u⃗1=[1/32/32/3],u⃗2=[2/31/3−2/3],u⃗3=[−2/32/3−1/3].\vec u_1=\begin{bmatrix}1/3\\2/3\\2/3\end{bmatrix},\qquad \vec u_2=\begin{bmatrix}2/3\\1/3\\-2/3\end{bmatrix},\qquad \vec u_3=\begin{bmatrix}-2/3\\2/3\\-1/3\end{bmatrix}.

First, check their lengths:

∥u⃗1∥=1+4+49=1,∥u⃗2∥=4+1+49=1,∥u⃗3∥=4+4+19=1.\begin{aligned} \lVert\vec u_1\rVert&=\sqrt{\frac{1+4+4}{9}}=1,\\ \lVert\vec u_2\rVert&=\sqrt{\frac{4+1+4}{9}}=1,\\ \lVert\vec u_3\rVert&=\sqrt{\frac{4+4+1}{9}}=1. \end{aligned}

Next, check all three dot products:

u⃗1⋅u⃗2=2+2−49=0,u⃗1⋅u⃗3=−2+4−29=0,u⃗2⋅u⃗3=−4+2+29=0.\begin{aligned} \vec u_1\cdot\vec u_2&=\frac{2+2-4}{9}=0,\\ \vec u_1\cdot\vec u_3&=\frac{-2+4-2}{9}=0,\\ \vec u_2\cdot\vec u_3&=\frac{-4+2+2}{9}=0. \end{aligned}

All three vectors have length one and are pairwise orthogonal, so they form an orthonormal basis of R3\mathbb R^3.


Finding coefficients using dot products

Let (u⃗1,u⃗2,u⃗3)(\vec u_1,\vec u_2,\vec u_3) be an orthonormal basis. We can write a vector v⃗\vec v as

v⃗=c1u⃗1+c2u⃗2+c3u⃗3.\vec v=c_1\vec u_1+c_2\vec u_2+c_3\vec u_3.

How do we find c1c_1, c2c_2, and c3c_3? As in R2\mathbb R^2, taking a dot product isolates one coefficient at a time. Taking the dot product with u⃗1\vec u_1 gives

v⃗⋅u⃗1=c1(u⃗1⋅u⃗1)+c2(u⃗2⋅u⃗1)+c3(u⃗3⋅u⃗1)=c1(1)+c2(0)+c3(0)=c1.\begin{aligned} \vec v\cdot\vec u_1 &=c_1(\vec u_1\cdot\vec u_1)+c_2(\vec u_2\cdot\vec u_1)+c_3(\vec u_3\cdot\vec u_1)\\ &=c_1(1)+c_2(0)+c_3(0)\\ &=c_1. \end{aligned}

The first dot product is 1 because u⃗1\vec u_1 is a unit vector. The other two are 0 because the vectors are orthogonal. Taking dot products with u⃗2\vec u_2 and u⃗3\vec u_3 similarly gives c2=v⃗⋅u⃗2c_2=\vec v\cdot\vec u_2 and c3=v⃗⋅u⃗3c_3=\vec v\cdot\vec u_3.

Each term (v⃗⋅u⃗i)u⃗i(\vec v\cdot\vec u_i)\vec u_i is the projection of v⃗\vec v onto the line span⁡(u⃗i)\operatorname{span}(\vec u_i). The denominator in the projection formula is u⃗i⋅u⃗i=1\vec u_i\cdot\vec u_i=1. The coefficient is a scalar; multiplying it by u⃗i\vec u_i gives the corresponding vector component.

Example: Writing a vector in the new basis

Use the orthonormal basis from the previous example:

u⃗1=[1/32/32/3],u⃗2=[2/31/3−2/3],u⃗3=[−2/32/3−1/3].\vec u_1=\begin{bmatrix}1/3\\2/3\\2/3\end{bmatrix},\qquad \vec u_2=\begin{bmatrix}2/3\\1/3\\-2/3\end{bmatrix},\qquad \vec u_3=\begin{bmatrix}-2/3\\2/3\\-1/3\end{bmatrix}.

Let v⃗=[−525]\vec v=\begin{bmatrix}-5\\2\\5\end{bmatrix}. Its coefficients are

c1=v⃗⋅u⃗1=−5+4+103=3,c2=v⃗⋅u⃗2=−10+2−103=−6,c3=v⃗⋅u⃗3=10+4−53=3.\begin{aligned} c_1=\vec v\cdot\vec u_1&=\frac{-5+4+10}{3}=3,\\ c_2=\vec v\cdot\vec u_2&=\frac{-10+2-10}{3}=-6,\\ c_3=\vec v\cdot\vec u_3&=\frac{10+4-5}{3}=3. \end{aligned}

Therefore,

v⃗=3u⃗1−6u⃗2+3u⃗3.\vec v=3\vec u_1-6\vec u_2+3\vec u_3.

We can check this by carrying out the linear combination in standard coordinates:

3u⃗1−6u⃗2+3u⃗3=[122]+[−4−24]+[−22−1]=[−525]=v⃗.\begin{aligned} 3\vec u_1-6\vec u_2+3\vec u_3 &=\begin{bmatrix}1\\2\\2\end{bmatrix} +\begin{bmatrix}-4\\-2\\4\end{bmatrix} +\begin{bmatrix}-2\\2\\-1\end{bmatrix}\\ &=\begin{bmatrix}-5\\2\\5\end{bmatrix}=\vec v. \end{aligned}

The coordinates in this basis are 3,−6,33,-6,3, while the standard coordinates are −5,2,5-5,2,5. These are two descriptions of the same vector. The negative coefficient -6 means that the second component points opposite to u⃗2\vec u_2.

Loading...

The components 3u⃗13\vec u_1, −6u⃗2-6\vec u_2, and 3u⃗33\vec u_3 lie on three mutually perpendicular lines. The dashed copies show how they add to v⃗\vec v. Drag to rotate the picture.


Application: Forces on a drone

The usual xx-, yy-, and zz-directions describe a force using fixed, global coordinates. For a moving drone, it can be more useful to describe the same force using the drone’s forward, rightward, and upward directions. If these directions form an orthonormal basis, three dot products tell us how much force acts along each one.