Linear Algebra, Orthogonal Projection Onto a Line
Up for GrabsUpdated 9 min read
We first consider orthogonal projection onto a line.
To orthogonally project a vector \overset{→}{v} onto a line ℓ,
mark the point on the line at which someone standing on that point could see \overset{→}{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 \overset{→}{v} is straight overhead.
That is, where the line is described as the span of some nonzero
vector ℓ = \{ c ⋅ \overset{→}{s} \ | \ c ∈ ℝ \},
the person has walked out to find the coefficient ${c}_{\overset{→}{p}} $
with the property that $\overset{→}{v} − {c}_{\overset{→}{p}} ⋅ \overset{→}{s} $ is orthogonal
to {c}_{\overset{→}{p}} ⋅ \overset{→}{s}.
We can solve for this coefficient by noting that because
$\overset{→}{v} − {c}_{\overset{→}{p}} \overset{→}{s} $ is orthogonal to a scalar multiple
of $\overset{→}{s} $ it must be orthogonal to $\overset{→}{s} $ itself,
and then the consequent fact that the dot product
$( \overset{→}{v} − {c}_{\overset{→}{p}} \overset{→}{s} ) ⋅ \overset{→}{s} $ is zero gives that{c}_{\overset{→}{p}} = \overset{→}{v} ⋅ \overset{→}{s} / \overset{→}{s} ⋅ \overset{→}{s}.
Definition 1.1
The orthogonal projection of \overset{→}{v} onto the line spanned by a nonzero $\overset{→}{s} $ is this vector.
{\text{proj}}_{[ \overset{→}{s} \ ]} ( \overset{→}{v} ) = \frac{\overset{→}{v} ⋅ \overset{→}{s}}{\overset{→}{s} ⋅ \overset{→}{s}} \overset{→}{s}
Problem 13 checks that the
outcome of the calculation depends only on the line and not on which vector
$\overset{→}{s} $ happens to be used to describe that line.
Remark 1.2
The wording of that definition says "spanned by $\overset{→}{s} $" instead the more formal "the span of the set \{ \overset{→}{s} \ \}". This casual first phrase is common.
Example 1.3
To orthogonally project
the vector ( \frac{2}{3} ) onto the line y = 2 x,
we first pick a direction vector for the line.
For instance,
\overset{→}{s} = ( \begin{matrix}1 \\ 2\end{matrix} )
will do.
Then the calculation is routine.
Example 1.4
In {ℝ}^{3}, the orthogonal projection of a general vector
( \begin{matrix}x \\ y \\ z\end{matrix} )
onto the y-axis is
\frac{( \begin{matrix}x \\ y \\ z\end{matrix} ) ⋅ ( \begin{matrix}0 \\ 1 \\ 0\end{matrix} )}{( \begin{matrix}0 \\ 1 \\ 0\end{matrix} ) ⋅ ( \begin{matrix}0 \\ 1 \\ 0\end{matrix} )} ⋅ ( \begin{matrix}0 \\ 1 \\ 0\end{matrix} ) = ( \begin{matrix}0 \\ y \\ 0\end{matrix} )
which matches our intuitive expectation.
The picture above with the stick figure walking out on the line until\overset{→}{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.
Example 1.5
A railroad car left on an east-west track without its brake is pushed by
a wind blowing toward the northeast at fifteen miles per hour;
what speed will the car reach?
For the wind we use a vector of length 15 that points toward
the northeast.
\overset{→}{v} = ( \begin{matrix}15 \sqrt{1 / 2} \\ 15 \sqrt{1 / 2}\end{matrix} )
The car can only be affected by the part of the wind blowing in the
east-west direction— the part of \overset{→}{v} in the direction
of the x-axis is this (the picture has the same perspective as the
railroad car picture above).
So the car will reach a velocity of {}15 \sqrt{1 / 2} miles per hour toward the east.
Thus, another way to think
of the picture that precedes the definition is that it shows\overset{→}{v} as decomposed into two parts, the part with the line (here, the part
with the tracks, \overset{→}{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 \overset{→}{v}
onto the line spanned by $\overset{→}{s} $ can be thought of as
the part of $\overset{→}{v} $ that lies in the direction of \overset{→}{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 $\overset{→}{p} $ as being the vector
in the line that is closest to \overset{→}{v}
(see Problem 11).
Example 1.6
A submarine is tracking a ship moving along the line y = 3 x + 2.
Torpedo range is one-half mile.
Can the sub stay where it is, at the origin on the chart below,
or must it move to reach a place where the ship will pass within range?
The formula for projection
onto a line does not immediately apply because the line doesn't pass through
the origin, and so isn't the span of any \overset{→}{s}.
To adjust for this, we start by shifting the entire map down two units.
Now the line is y = 3 x, which is a subspace, and we can project to get
the point \overset{→}{p} of closest approach, the point on the
line through the origin closest to
\overset{→}{v} = ( \begin{matrix}0 \\ − 2\end{matrix} )
the sub's shifted position.
\overset{→}{p} = \frac{( \begin{matrix}0 \\ − 2\end{matrix} ) ⋅ ( \begin{matrix}1 \\ 3\end{matrix} )}{( \begin{matrix}1 \\ 3\end{matrix} ) ⋅ ( \begin{matrix}1 \\ 3\end{matrix} )} ⋅ ( \begin{matrix}1 \\ 3\end{matrix} ) = ( \begin{matrix}− 3 / 5 \\ − 9 / 5\end{matrix} )
The distance between \overset{→}{v} and \overset{→}{p} is approximately 0.63 miles and so the sub must move to get in range.
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
This exercise is recommended for all readers.
Problem 1
Project the first vector orthogonally
onto the line spanned by the second vector.
( \begin{matrix}2 \\ 1\end{matrix} ),( \begin{matrix}3 \\ − 2\end{matrix} )( \begin{matrix}2 \\ 1\end{matrix} ),( \begin{matrix}3 \\ 0\end{matrix} )( \begin{matrix}1 \\ 1 \\ 4\end{matrix} ),( \begin{matrix}1 \\ 2 \\ − 1\end{matrix} )( \begin{matrix}1 \\ 1 \\ 4\end{matrix} ),( \begin{matrix}3 \\ 3 \\ 12\end{matrix} )
This exercise is recommended for all readers.
Problem 2
Project the vector orthogonally onto the line.
( \begin{matrix}2 \\ − 1 \\ 4\end{matrix} ) , \{ c ( \begin{matrix}− 3 \\ 1 \\ − 3\end{matrix} ) \ | \ c ∈ ℝ \}
( \begin{matrix}− 1 \\ − 1\end{matrix} ), the liney = 3 x
Problem 3
Although the development of Definition 1.1
is guided by the pictures, we are not restricted to spaces that
we can draw.
In {ℝ}^{4} project this vector onto this line.
\overset{→}{v} = ( \begin{matrix}1 \\ 2 \\ 1 \\ 3\end{matrix} ) \ ℓ = \{ c ⋅ ( \begin{matrix}− 1 \\ 1 \\ − 1 \\ 1\end{matrix} ) \ | \ c ∈ ℝ \}
This exercise is recommended for all readers.
Problem 4
Definition 1.1 uses two vectors \overset{→}{s} and\overset{→}{v}.
Consider the transformation of {ℝ}^{2} resulting from fixing
\overset{→}{s} = ( \begin{matrix}3 \\ 1\end{matrix} )
and projecting \overset{→}{v} onto the line that is the span of \overset{→}{s}.
Apply it to these vectors.
( \begin{matrix}1 \\ 2\end{matrix} )( \begin{matrix}0 \\ 4\end{matrix} )
Show that in general the projection tranformation is this.
( \begin{matrix}{x}_{1} \\ {x}_{2}\end{matrix} ) ↦ ( \begin{matrix}( 9 {x}_{1} + 3 {x}_{2} ) / 10 \\ ( 3 {x}_{1} + {x}_{2} ) / 10\end{matrix} )
Express the action of this transformation with a matrix.
Problem 5
Example 1.5 suggests that projection breaks \overset{→}{v} into
two parts, {\text{proj}}_{[ \overset{→}{s} \ ]} ( \overset{→}{v} \ ) and\overset{→}{v} − {\text{proj}}_{[ \overset{→}{s} \ ]} ( \overset{→}{v} \ ), that are
"not interacting".
Recall that the two are orthogonal.
Show that any two nonzero orthogonal vectors make up a linearly
independent set.
Problem 6
- What is the orthogonal projection of
\overset{→}{v}
onto a line if\overset{→}{v}is a member of that line? - Show that
if \overset{→}{v} is not a member of the line
then the set\{ \overset{→}{v} , \overset{→}{v} − {\text{proj}}_{[ \overset{→}{s} \ ]} ( \overset{→}{v} \ ) \}
is linearly independent.
Problem 7
Definition 1.1 requires that $\overset{→}{s} $ be
nonzero.
Why?
What is the right definition of the orthogonal projection
of a vector onto the (degenerate) line spanned by the zero vector?
Problem 8
Are all vectors the projection of some other vector onto some line?
This exercise is recommended for all readers.
Problem 9
Show that the projection of \overset{→}{v} onto the line spanned by\overset{→}{s} has length equal to the absolute value of the number\overset{→}{v} ⋅ \overset{→}{s} divided by the length of the vector\overset{→}{s}.
Problem 10
Find the formula for the distance from a point to a line.
Problem 11
Find the scalar c such that ( c {s}_{1} , c {s}_{2} )
is a minimum distance from the point ( {v}_{1} , {v}_{2} )
by using calculus (i.e., consider the distance function, set the
first derivative equal to zero, and solve).
Generalize to {ℝ}^{n}.
This exercise is recommended for all readers.
Problem 12
Prove that the orthogonal projection of a vector onto a line is shorter
than the vector.
This exercise is recommended for all readers.
Problem 13
Show that the definition of orthogonal projection onto a line
does not depend
on the spanning vector: if \overset{→}{s} is a nonzero multiple
of \overset{→}{q} then( \overset{→}{v} ⋅ \overset{→}{s} / \overset{→}{s} ⋅ \overset{→}{s} \ ) ⋅ \overset{→}{s} equals( \overset{→}{v} ⋅ \overset{→}{q} / \overset{→}{q} ⋅ \overset{→}{q} \ ) ⋅ \overset{→}{q}.
This exercise is recommended for all readers.
Problem 14
Consider the function mapping to plane to itself that takes
a vector to its projection onto the line y = x.
These two each show that the map is linear, the first one in a way that
is bound to the coordinates (that is, it fixes a basis and then computes)
and the second in a way that is more conceptual.
- Produce a matrix that describes the function's action.
- Show also that this map can be obtained by first rotating
everything in the plane π / 4 radians clockwise,
then projecting onto the x-axis,
and then rotating π / 4 radians counterclockwise.
Problem 15
For \overset{→}{a} , \overset{→}{b} ∈ {ℝ}^{n} let {\overset{→}{v}}_{1} be the
projection of \overset{→}{a} onto the line spanned by \overset{→}{b}, let{\overset{→}{v}}_{2} be the projection of {\overset{→}{v}}_{1} onto the line spanned
by \overset{→}{a}, let {\overset{→}{v}}_{3} be the projection of {\overset{→}{v}}_{2}
onto the line spanned by \overset{→}{b}, etc.,
back and forth between the spans of \overset{→}{a} and \overset{→}{b}.
That is, {\overset{→}{v}}_{i + 1} is the projection of{\overset{→}{v}}_{i} onto the
span of \overset{→}{a} if i + 1 is even, and
onto the span of \overset{→}{b} if i + 1 is odd.
Must that sequence of vectors eventually settle down— must
there be a sufficiently large i such that{\overset{→}{v}}_{i + 2} equals {\overset{→}{v}}_{i}
and {\overset{→}{v}}_{i + 3} equals {\overset{→}{v}}_{i + 1}?
If so, what is the earliest such i?
Where this page came from
This page was imported from Wikibooks. From “Linear Algebra” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.
Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.