The projection of a vector $x$ onto a vector $u$ is $proj_u(x) =\frac{\langle x, u \rangle}{\langle u, u \rangle}u.$

Projection onto $u$ is given by matrix multiplication $proj_u(x)=Px$ where $P=\frac{1}{\left\lVert u \right\rVert^2}uu^T$

I don't understand the calculation of $P=\frac{1}{\left\lVert u \right\rVert^2}uu^T$ from $\frac{\langle x, u \rangle}{\langle u, u \rangle}u.$ Anyone help me to understand.


1 Answer 1


Recall $\langle a,b\rangle=a^\top b=b^\top a$. Thus, $$\operatorname{proj}_u(x)=\frac{x^\top u}{\|u\|^2}u=\frac{u^\top x}{\|u\|^2}u=\frac{uu^\top}{\|u\|^2}x$$ Now, $u^\top x$ is a scalar depending on $x$. It doesn't matter if you write $\lambda x$ or $x\lambda$ (where $\lambda$ is a scalar and $x$ a vector) so you can write $(u^\top x)u=u(u^\top x)$.

Hope this helps. :)

  • $\begingroup$ How $$\frac{u^\top x}{\|u\|^2}u=\frac{uu^\top}{\|u\|^2}x$$? $\endgroup$
    – David
    Apr 23 at 21:04
  • $\begingroup$ I asked this question only because of the question in above comment. $\endgroup$
    – David
    Apr 23 at 21:11
  • $\begingroup$ @Brett: I made edits. $\endgroup$ Apr 23 at 21:24
  • $\begingroup$ Why $u^Tx$ is scalar? Would you explain little bit. $\endgroup$
    – David
    Apr 23 at 21:28
  • $\begingroup$ @Brett: $u^\top x=u_1x_1+\dots+u_nx_n$ is just the inner product. It belongs to $\mathbb R$ (or whatever the base field is), hence a scalar. $\endgroup$ Apr 24 at 2:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .