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?
 A: 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}.$$
A: 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.$$

