index

## Projection of Two Vectors

The dot product can be used to perform a projection.

The vector projection of a vector $\vec{w}$ onto a non-zero vector $\vec{v}$ results in a straight line $k\vec{v}$ which is parallel to $\vec{v}$, which includes a vector orthogonal to $\vec{v}$.

I've done my best to show this visualization here:

Note to self: Learn how to use some graphing software, or something. 😄

We can think of the projection of $\vec{w}$ onto $\vec{v}$ as the shadow that $\vec{w}$ casts on $\vec{v}$ when rays of light are perpendicular to $\vec{v}$.

Going back to the diagram, we want to know:

1. Where does $k\vec{v}$ intersect with $\vec{u}$ so that $\vec{u}$ can be a perpendicular to $\vec{v}$?

1. As in, what is the displacement of $\vec{u}$ from $k\vec{v}$?
2. We also want to know where $\vec{u}$ meets with $\vec{w}$.

We'll need to find 2 things:

1. The vector $k\vec{v}$
2. The vector $\vec{u}$

We can begin to find $k\vec{v}$ by using this formula:

Then, we can say that $k\vec{v}$ is the projection of $\vec{w}$ onto $\vec{v}$.

Note: If $\vec{u}$ is orthogonal to $\vec{v}$, then $\vec{u} \cdot \vec{v} = 0$.

### Step-By-Step Process

Here is the step-by-step process in finding projection of two vectors.

#### Step 1 - Find the Length of $k\vec{v}$

Back to that diagram above the page, we can find the length of $k\vec{v}$ using trigonometry. Assume that we know $\theta$:

#### Step 2 - Normalize $\vec{w}$, and $\vec{v}$

Knowing that for unit vectors $\vec{a_u}$, and $\vec{b_u}$, the dot products of these unit vectors is:

Then, we know that finding the unit vector of $\vec{w}$ to be $\vec{w_u}$, and the unit vector of $\vec{v}$ to be $\vec{v_u}$, we can write an expression like this:

Since $|\vec{w_u}||\vec{v_u}|$ evaluate to $1$ due to them being unit vectors, we can simplify to have the formula be written without it.

#### Step 3 - Rewrite $k\vec{v}$

We can now rewrite the equation for $k\vec{v}$ from $k\vec{v} = ||\vec{w}||\cos(\theta)$ to:

We read this as two components:

1. $|\vec{w}|(\vec{w_u} \cdot \vec{v_u})$ is a scalar, and will adjust $\vec{v}$ to be the required length. It is the $k$.
2. $\vec{v_u}$ will indicate the result to be in the same orientation as $\vec{v}$.

#### Step 4 - Find $\vec{u}$

Now, we can find the orthogonal vector to $\vec{v}$. This will be the vector $\vec{u}$. We can rewrite our expression $\vec{w} = k\vec{v} + \vec{u}$ to be

Since w know $\vec{w}$ , and now $k\vec{v}$, the process then becomes an exercise of vector subtraction.

### Example

I ripped this one off from here.

Suppose we have two vectors:

We now want to find the projection of $\vec{w}$ onto $\vec{v}$. In order to do that, we have to:

1. Find $k\vec{v}$
2. Find $\vec{u}$.

First let's normalize the vectors $\vec{w}$, and $\vec{v}$ to unit vectors.

And, for $\vec{v_u}$:

Now, we find $k\vec{v}$ by

Now, it becomes a scalar multiplication:

So, we know that the displacement $k\vec{v} = \begin{bmatrix} 5.3598 \\ 2.6802 \end{bmatrix}$.

Next, let's find $\vec{u}$.

So, $\vec{u} = \begin{bmatrix} -2.1598 \\ 4.3198 \end{bmatrix}$, meaning that this is the displacement starting from $\vec{v}$. If we plot this, we will find that $\vec{u}$ is orthogonal to $\vec{v}$.

Now, excuse the crappy picture

### Notes

• It is important to know that $\vec{w}$ projected onto $\vec{v}$ is NOT the same as $\vec{v}$ projected onto $\vec{w}$.

• The vector resulting from a projection is oriented in the same direction as the vector projected onto.

• Since the cosine function is never more than $1$, the length of the projection will NEVER be longer than the projected vector.