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 with

the positive x-axis, where . As illustrated in Figure a. , let

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:

Where and are the standard basis vectors for . We consider the case where

; the case where is similar.

Referring to Figure b. we have , so

And referring to Figure c. we have , so:

Thus the standard matrix for T is:

Now my question: According to my text,

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

(The author said nothing about how he got it)

And also why???

If you look at the top the author says that "We consider the case where ;

the case where is similar." why is that?

Can anyone kindly explain these questions? Thanks.

Figure a.

Figure b.

Figure c.