# Orthogonal projection matrix onto a plane

To find, for example, the orthogonal projection matrix onto the plane: $$x-y-z = 0$$ ... we would choose two independent vectors that lie on the plane, use them as columns of a matrix A, and use the following equation: As I understand it, this works because this matrix essentially projects onto the column space of A, but given how we have created matrix A, the column space of the matrix is exactly equal to the plane of interest.

However, does this method still apply for planes not passing through the origin?

Because as far as I know, column space (when it is a 2D subspace of $$R^3$$) is a plane through the origin. So, if you take two independent vectors on a plane not passing through the origin, and come up with an orthogonal projection matrix as I have described, surely that matrix would project onto a plane that is through the origin (the column space of A), and not the intended plane (albeit the two planes would have the same basis/direction vectors)?

Am I missing something here?

• Projections onto affine spaces (e.g. planes not containing the origin) are not linear transformations (e.g. note that $0$ is not mapped to $0$) and cannot be expressed as $f(v) = Pv$ for some matrix $P$. Jun 3 at 21:59
• A common way of dealing with this non-linearity is to conjugate by a translation map. Pick some individual point $\vec{x}_0$ in the plane, and two linearly independent direction vectors parallel to the plane (i.e. vectors between two points in the plane). Compute the matrix $P$ with these two direction vectors. Then, the projection onto the plane (not through the origin) of a vector $\vec{x}$ is given by $P(\vec{x} - \vec{x}_0) + \vec{x}_0$. Jun 3 at 22:19

If the plane equation is

$$n^T (r - r_0) = 0$$

Then let

$$A = [u_1, u_2]$$

where $$n \cdot u_1 = n \cdot u_2 = 0$$ and $$u_1$$ and $$u_2$$ are linearly independent.

Then the projection of a point $$P$$ onto the plane is

$$\text{Proj}(P) = r_0 + A (A^T A)^{-1} A^T (P - r_0)$$

To derive this formula, note that

$$r = r_0 + A u$$

where $$u \in \mathbb{R}^2$$. Since we want $$r$$ to be the projection of $$P$$ onto the plane, then

$$P - r$$ is perpendicular to the plane, i.e. perpendicular to $$u_1$$ and $$u_2$$, therefore,

$$A^T (P - r_0 - A u) = 0$$

From which

$$u = (A^T A)^{-1} A^T (P - r_0)$$

Hence,

$$\text{Proj}(P) = r = r_0 + A u = r_0 + A (A^T A)^{-1} A^T ( P - r_0)$$