Linear Algebra/Orthogonal Projection Onto a Line

We first consider orthogonal projection onto a line. To orthogonally project a vector $$ \vec{v} $$ onto a line $$\ell$$, mark the point on the line at which someone standing on that point could see $$ \vec{v} $$ by looking straight up or down (from that person's point of view). The picture shows someone who has walked out on the line until the tip of $$\vec{v}$$ is straight overhead. That is, where the line is described as the span of some nonzero vector $$\ell=\{c\cdot\vec{s}\,\big|\, c\in\mathbb{R}\}$$, the person has walked out to find the coefficient $$c_{\vec{p}}\,$$ with the property that $$\vec{v}-c_{\vec{p}}\cdot\vec{s}\,$$ is orthogonal to $$c_{\vec{p}}\cdot\vec{s}$$. We can solve for this coefficient by noting that because $$\vec{v}-c_{\vec{p}}\vec{s}\,$$ is orthogonal to a scalar multiple of $$\vec{s}\,$$ it must be orthogonal to $$\vec{s}\,$$ itself, and then the consequent fact that the dot product $$(\vec{v}-c_{\vec{p}}\vec{s})\cdot \vec{s}\,$$ is zero gives that $$c_{\vec{p}}=\vec{v}\cdot \vec{s}/\vec{s}\cdot \vec{s}$$.

Problem 13 checks that the outcome of the calculation depends only on the line and not on which vector $$ \vec{s}\, $$ happens to be used to describe that line.

The picture above with the stick figure walking out on the line until $$\vec{v}$$'s tip is overhead is one way to think of the orthogonal projection of a vector onto a line. We finish this subsection with two other ways.

Thus, another way to think of the picture that precedes the definition is that it shows $$\vec{v}$$ as decomposed into two parts, the part with the line (here, the part with the tracks, $$\vec{p}$$), and the part that is orthogonal to the line (shown here lying on the north-south axis). These two are "not interacting" or "independent", in the sense that the east-west car is not at all affected by the north-south part of the wind (see Problem 5). So the orthogonal projection of $$ \vec{v} $$ onto the line spanned by $$ \vec{s}\, $$ can be thought of as the part of $$ \vec{v}\, $$ that lies in the direction of $$ \vec{s} $$.

Finally, another useful way to think of the orthogonal projection is to have the person stand not on the line, but on the vector that is to be projected to the line. This person has a rope over the line and pulls it tight, naturally making the rope orthogonal to the line. That is, we can think of the projection $$ \vec{p}\, $$ as being the vector in the line that is closest to $$ \vec{v} $$ (see Problem 11).

This subsection has developed a natural projection map: orthogonal projection onto a line. As suggested by the examples, it is often called for in applications. The next subsection shows how the definition of orthogonal projection onto a line gives us a way to calculate especially convienent bases for vector spaces, again something that is common in applications. The final subsection completely generalizes projection, orthogonal or not, onto any subspace at all.

Exercises
/Solutions/