Projections

One of the most useful applications of the dot product is the idea of a projection. A projection is an operation that allows us to determine, given two vectors, \vec{x} and \vec{y}, how much the vector \vec{x} is in the direction of \vec{y}.

Suppose that we have two vectors, \vec{x} and \vec{y}, that exist in some arbitrary direction in \mathbb{R}^2.

If we wanted to determine how much \vec{y} points in the direction of \vec{x}, we first need to extend \vec{y} to match the length of \vec{x}. Once we have done this, we can draw a line directly perpendicular to \vec{y} connecting it to \vec{x}, creating a right triangle.

This gives us a picture of what a projection looks like from a geometric point of view. From here, we can derive a formula to calculate the projection. In order to extend \vec{x} to reach \vec{y}, we can utilize the dot product, and then divide by the length of the vector to keep it to a unit size. From here, we can apply the scalar to vector \vec{y}, and end up with a vector that is the length of \vec{x}, in the direction of \vec{y}.

The actual formula for the projection is the following: proj_{\vec{x}}\vec{y} = \frac{\vec{x}*\vec{y}}{|\vec{x}|^2} * \vec{x}

Example: Determine the value of proj_{\vec{x}}\vec{y} where \vec{x} = \begin{bmatrix} 4 & 3 & -1 \end{bmatrix} and \vec{y} = \begin{bmatrix} -2 & 5 & 3 \end{bmatrix}

We can easily solve this problem just by substituting in the appropriate values for the projection equation.

proj_{\vec{x}}\vec{y} = \frac{\vec{x}*\vec{y}}{|\vec{x}|^2} * \vec{x} = \frac{\begin{bmatrix} 4 & 3 & -1 \end{bmatrix} * \begin{bmatrix} -2 & 5 & 3 \end{bmatrix}}{\sqrt{4^2+3^2+(-1)^2)}}*\begin{bmatrix} 4 & 3 & -1 \end{bmatrix}
= \frac{4}{26} * \begin{bmatrix} 4 & 3 & -1 \end{bmatrix} = \begin{bmatrix} \frac{16}{26} & \frac{12}{26}  & \frac{-4}{26} \end{bmatrix}

Often, you may also want to find a vector that is perpendicular to the vector \vec{x}. To do this, we can use a projection, as calculated above, to determine the projection of \vec{y} which is perpendicular to \vec{x}.

The reason we want to be able to do this mostly stems from Physics applications. In Physics, we often want to componentize forces which can be done with projections. From here, we may want to find a force that acts perpendicular to vector, which we will show how to calculate now.

If we want to find the projection of \vec{y} perpendicular to \vec{x}, we can use the formula perp_{\vec{x}}\vec{y} = \vec{y} - proj_{\vec{x}}\vec{y}. To get an intuition of why this works, consider what exactly we get when we calculate the projection of \vec{y} onto \vec{x}. We get a vector that is the length of \vec{x}, in the same direction as \vec{y}. If we subtract the vector \vec{y} from the projection, we would end up with a vector perpendicular to the projection.

One further application of projections is to be able to find the minimum distance from a line to a given point. The shortest line between any line and a point is a line that is perpendicular to the line. Due to this, we can apply the perp operation to be able to find such a value.

Example: Find the distance from Q(4,3) to the line \vec{x} = \begin{bmatrix} 1 & 2 \end{bmatrix} + t \begin{bmatrix} -1 & 1 \end{bmatrix}

First, we are going to draw a line between Q and a point on \vec{x}, which we will call P. The easiest point to use is the y-intercept, which is \begin{bmatrix} 1 & 2 \end{bmatrix}. This would give us PQ = \begin{bmatrix} 4-1 & 3-2 \end{bmatrix} = \begin{bmatrix} 3 & 1 \end{bmatrix}.

From here, we can find the projection that is perpendicular to PQ.

perp_d PQ = PQ - proj_d PQ = \begin{bmatrix} 3 & 1 \end{bmatrix} - \frac{-2}{2} \begin{bmatrix} -1 & 1 \end{bmatrix} = \begin{bmatrix} 2 & 2 \end{bmatrix}

What we have learned from this is that the vector \begin{bmatrix} 2 & 2 \end{bmatrix} is the vector with the shortest distance from the line \vec{x} to the point Q. We can find that distance by taking the magnitue of the vector, which is equal to 2*\sqrt{2}

1 thought on “Projections”

Leave a Reply

Your email address will not be published. Required fields are marked *