Orthogonal projection onto the line spanned by $(1,1,1)$

1.9k Views Asked by At

I am trying to find the matrix of the projection in $\mathbb{R}^3$ onto the line spanned by the vector $\vec{w}=[1,1,1]$. The way I thought I should find the matrix is by taking

$$\frac{(\vec{x} \cdot \vec{w}) \, \vec{w}}{\vec{w} \cdot \vec{w}} = \frac{x_1 +x_2+x_3}{3} \begin{bmatrix} 1\\1\\1 \end{bmatrix} $$

So the final matrix is $$\frac{1}{3} \begin{bmatrix} 1\ 1\ 1\\ 1\ 1\ 1\\ 1\ 1\ 1 \end{bmatrix}$$

This seems wrong to me, but I can't figure what mistake I made.

2

There are 2 best solutions below

0
On

The length of the projection of a vector ${\bf x}$ onto ${\bf w}$ can be written as

$$ x_w = {\bf x}\cdot \frac{{\bf w}}{|{\bf w}|} = \frac{{\bf w}^T {\bf x}}{|{\bf w}|} $$

So that the projection vector is

$$ {\bf x}_w = x_w \frac{{\bf w}}{|{\bf w}|} = \frac{{\bf w}^T {\bf x}}{|{\bf w}|} \frac{{\bf w}}{|{\bf w}|} = \frac{{\bf w}{\bf w}^T}{|{\bf w}|^2} {\bf x} = P_w {\bf x} $$

where the projection matrix $P_w$ is

$$ P_w = \frac{{\bf w}{\bf w}^T}{|{\bf w}|^2} $$

2
On

It is correct, note indeed that $rank(P)=1$ with

$$P=\frac{1}{3} \begin{bmatrix} 1\ 1\ 1\\ 1\ 1\ 1\\ 1\ 1\ 1 \end{bmatrix}\implies P^2=P$$

and

$$P \begin{bmatrix} 1\\1\\1 \end{bmatrix}=\begin{bmatrix} 1\\1\\1 \end{bmatrix}\quad P \begin{bmatrix} 1\\-1\\0 \end{bmatrix}=\begin{bmatrix} 0\\0\\0 \end{bmatrix}\quad P \begin{bmatrix} 0\\1\\-1 \end{bmatrix}=\begin{bmatrix} 0\\0\\0 \end{bmatrix}$$