# Finding orthogonal projections onto $1$ (co)-dimensional subspaces of $\mathbb R^n$

1)Consider the vector space $\mathbb{R}^n$ with usual inner product. And let S the subspace generated by $u\in \mathbb{R}^n,u\neq 0$. Find the orthogonal projection matrix $P$ onto the subspace $S$ and the orthogonal projection matrix onto subspace $S^\perp$

There is an explicit way to determine $P$? Or I can only say that $Pu$ is the orthogonal projection onto $S$ and $(I-P)u$ is the orthogonal projection onto $S^\perp$

2)Let $S$ the subspace of $\mathbb{R}^3$ with usual inner product defined by equation $x-2y+3z=0$. Find the orthogonal projection matrix onto subspace $S$

I'm a little lost as to resolve this, I know that $$x-2y+3z=\begin{bmatrix}x\\y\\z\end{bmatrix}\begin{bmatrix}1&&0&&0\\0&&-2&&0\\0&&0&&3\end{bmatrix}=A$$

A is symmetric but not idempotent, anyone can help me?

• $x-2y+3z$ $\ne$ $\begin{bmatrix}x\\y\\z\end{bmatrix}$ $\begin{bmatrix}1&&0&&0\\0&&-2&&0\\0&&0&&3\end{bmatrix}$. Perhaps you meant something like $$x-2y+3z=\begin{bmatrix}x&y&z\end{bmatrix}\begin{bmatrix}1&&0&&0\\0&&-2&&0\\0&&0&&3\end{bmatrix}\begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix}$$
– user137731
May 24 '15 at 17:00

i think it is easier to find the projection on to the line $u = (1, -2, 3)^\top$ that is orthogonal to the plane and then subtract from the identity to get the projection onto the plane.

the projection matrix onto the line $u$ is $$uu^\top/(u^\top u) = \frac1{14}\pmatrix{1&-2&3\\-2&4&-6\\3&-6&9}.$$ therefore the projection matrix on to the plane is $$I - uu^\top/(u^\top u) = \frac1{14}\pmatrix{13&2&-3\\2&10&6\\-3&6&5}.$$

• This is for 1 or 2? Or both? May 24 '15 at 16:53
• @askazy, you can/t tell which one?
– abel
May 24 '15 at 16:53
• The exercise consists of two parts, I will enumerate 1 and 2. For I find the projection on the plane I can always do that? May 24 '15 at 16:56
• @askazy, given a plane, you can always a find a matrix $P$ that projects onto the plane. this means any $x in R^3$ can be written as the sum of two orthogonal vectors $Px$ and $x - Px.$
– abel
May 24 '15 at 17:02
• @askazy This answers part $2$ -- or in fact the subset of problems described in part $1$ where your subspace is $n-1$-dimensional. The general answer to part $1$ was however provided by AlgebraicPavel in his answer to your question from the other day. Just construct a matrix whose columns are the basis vectors of your subspace and proceed from his answer.
– user137731
May 24 '15 at 17:10

Hint:

In terms of inner product, the projection of vector $X=(x,y,z)$ onto vector $u=(a,b,c)$ is simply: $$p_u(X)=\frac{\langle X,u\rangle}{\langle u,u\rangle}\, u$$

For the second question, two strategies for the projection onto a plane:

• If you have the equation of the plane, as is the case, you also have a normal vector of the plane: $n=(1,-2,3)$. Consider the straight line that passes through the point to be projected; it has a parametric representation: $$\begin{cases} x=x_0+t\\y=y_0-2t\\z=z_0+3t \end{cases}$$ and find for which value of $t$ you have a point in the plane.
• If you have an orthonormal basis $(u,v)$ of the plane, the projection of vector $X$ onto the plane is: $$p_{u,v}(X)=\frac{\langle X,u\rangle}{\langle u,u\rangle}\, u+\frac{\langle X,v\rangle}{\langle v,v\rangle}\, v.$$