Calculate the projection matrix of R^3 onto the line spanned by (2, 1, −3). 
Calculate the projection matrix of $\Bbb R^3$ onto the line spanned by $(2, 1, −3)$.

This is the entirety of the question. I know that $$\operatorname{proj}_{\mathbf s}(\mathbf v) = \frac{\mathbf v \cdot \mathbf s}{\mathbf s\cdot \mathbf s}\mathbf s$$ but I don't know what the projection matrix of $\Bbb R^3$ is.
 A: Using the definition of the dot product of matrices $$a\cdot b = a^Tb$$ we can figure out the formula for the projection matrix from your dot product formula.
$$\begin{align}
\operatorname{proj}_s(v) &= \frac{s\cdot v}{s\cdot s}s \\
&= \frac{s^Tv}{s^Ts}s \\
&= \frac{s(s^Tv)}{s^Ts} &\text{(scalars commute with matrices)} \\
&= \frac{(ss^T)v}{s^Ts} &\text{(matrix multiplication is associative)} \\
&= \frac{ss^T}{s^Ts}v
\end{align}$$
Hence the projection matrix onto the 1-dimensional space $\operatorname{span}(s)$ is $$A  = \frac{ss^T}{s^Ts}$$  Note that if $s$ is a unit vector (it's not in this case, but you can normalize it if you wish) then $s^Ts = 1$ and hence this reduces to $A = ss^T$.

Example: Let's calculate the projection matrix for a projection in $\Bbb R^2$ onto the subspace $\operatorname{span}\big((1,1)\big)$.  First set $s = \begin{bmatrix} 1 \\ 1 \end{bmatrix}$.  Then, using the formula we derived above, the projection matrix should be $$A = \frac{\begin{bmatrix} 1 \\ 1\end{bmatrix}\begin{bmatrix} 1 & 1\end{bmatrix}}{\begin{bmatrix} 1 & 1\end{bmatrix}\begin{bmatrix} 1 \\ 1\end{bmatrix}} = \frac{1}{2}\begin{bmatrix} 1 & 1 \\ 1 & 1\end{bmatrix} =  \begin{bmatrix} \frac 12 & \frac 12 \\ \frac 12 & \frac 12\end{bmatrix}$$
A: The projection matrix for projecting in the direction of a unit vector $s$ is $s s^T$. 
You can easily verify this matches with the definition you have above. 
