Constructing an orthogonal projection matrix onto a line in $\mathbb{R}^2$

linear algebramatricesorthogonalityprojection-matrices

How would one go about constructing an orthogonal projection matrix onto a line in $\mathbb{R}^2$ that contains the unit vector $(u_1, u_2)$? Is Gram-Schmidt necessary to do this?

Best Answer

The orthogonal projection $p$ onto the line $\operatorname{Vect}(u=(u_1,u_2)^T)$ is defined by: for $x=(x_1,x_2)^T\in\Bbb R^2$,

$$p(x)=\langle x,u\rangle u =(x_1u_1+x_2u_2)u$$ Hence the desired matrix is

$$P=\begin{pmatrix}u_1^2&u_1u_2\\ u_1u_2& u_2^2\end{pmatrix}$$ where the first column is $p((1,0)^T)$ and the second is $p((0,1)^T)$.

Related Question