I am having difficulty in understanding the standard basis and standard matrix.

I'll explain my problem through a math problem. (My question and all the geometric diagrams at the end of the post)

The problem:

Suppose let l be the line in the xy-plane that passes through the origin and makes an angle $\displaystyle \theta$ with

the positive x-axis, where $\displaystyle 0 \leq \theta < \pi$. As illustrated in Figure a. , let $\displaystyle T:R^2 \rightarrow R^2$

be a linear operator that maps each vector into its orthogonal projection on l.

Find standard matrix for T.

-------------------------------------------------------------------------------------

The book i am reading did it like this:

We know that:

$\displaystyle [T] = [T(e_1) | T(e_2)] $

Where $\displaystyle e_1$ and $\displaystyle e_2$ are the standard basis vectors for $\displaystyle R^2$. We consider the case where

$\displaystyle 0 \leq \theta \leq \frac{\pi}{2}$; the case where $\displaystyle \frac{\pi}{2} < \theta < \pi$ is similar.

Referring to Figure b. we have $\displaystyle \left | \left | T(e_1) \right| \right | = \cos \theta$, so

$\displaystyle T(e_1) = \left[ {\begin{array}{c}

\left | \left | T(e_1) \right| \right| \cos(\theta) \\

\left | \left | T(e_1) \right| \right| \sin(\theta) \\

\end{array} } \right]

= \left[ {\begin{array}{c}

\cos^{2}(\theta) \\

\sin(\theta) \cos(\theta)\\

\end{array} } \right]

$

And referring to Figure c. we have $\displaystyle \left | \left | T(e_2) \right| \right | = \sin(\theta)$, so:

$\displaystyle T(e_2) = \left[ {\begin{array}{c}

\left | \left | T(e_2) \right| \right| \cos(\theta) \\

\left | \left | T(e_2) \right| \right| \sin(\theta) \\

\end{array} } \right]

= \left[ {\begin{array}{c}

\sin(\theta) \cos(\theta)\\

\sin^{2}(\theta) \\

\end{array} } \right]

$

Thus the standard matrix for T is:

$\displaystyle

\left[T\right] =

\left[ {\begin{array}{cc}

\cos^{2}(\theta) & \sin(\theta) \cos(\theta)\\

\sin(\theta) \cos(\theta) & \sin^{2}(\theta) \\

\end{array} } \right]

$

Now my question: According to my text,

$\displaystyle [T] = [T(e_1) | T(e_2)] $

I understand this. But then how did the author come up with the following lines?

(The author said nothing about how he got it)

$\displaystyle T(e_1) = \left[ {\begin{array}{c}

\left | \left | T(e_1) \right| \right| \cos(\theta) \\

\left | \left | T(e_1) \right| \right| \sin(\theta) \\

\end{array} } \right]

= \left[ {\begin{array}{c}

\cos^{2}(\theta) \\

\sin(\theta) \cos(\theta)\\

\end{array} } \right]

$

And also why???

$\displaystyle T(e_2) = \left[ {\begin{array}{c}

\left | \left | T(e_2) \right| \right| \cos(\theta) \\

\left | \left | T(e_2) \right| \right| \sin(\theta) \\

\end{array} } \right]

= \left[ {\begin{array}{c}

\sin(\theta) \cos(\theta)\\

\cos^{2}(\theta) \\

\end{array} } \right]

$

If you look at the top the author says that "We consider the case where$\displaystyle 0 \leq \theta \leq \frac{\pi}{2}$;

the case where $\displaystyle \frac{\pi}{2} < \theta < \pi$ is similar." why is that?

Can anyone kindly explain these questions? Thanks.

Figure a.

Figure b.

Figure c.