Projection orthogonal to two vectors

linear algebramatrices

Consider a unit vector $\mathbf{u}$, and the projection operator $\mathbb{P} = I – \mathbf{u}\mathbf{u}^T$. Then $\mathbb{P}$ projects an input vector into the space orthogonal to $\mathbf{u}$.

Now consider two unit vectors $\mathbf{u},\mathbf{v}$. What's the formula for the projection operator that projects an input vector into the subspace orthogonal to both $\mathbf{u}$ and $\mathbf{v}$?

If $\mathbf{u},\mathbf{v}$ are orthogonal, the formula is $\mathbb{P} = I – \mathbf{u}\mathbf{u}^T – \mathbf{v}\mathbf{v}^T$. I am interested in the general case, where $\mathbf{u},\mathbf{v}$ are not necessarily orthogonal.

Best Answer

I will assume that $\mathbf u$ and $\mathbf v$ are linearly independent. Per the original version of this question, I do not assume that $\mathbf u, \mathbf v$ are unit vectors.

There are two standard approaches. One approach is to start by finding an orthonormal basis for the space spanned by $\mathbf u,\mathbf v$. If we follow the Gram-Schmidt process, then we get $$ \mathbf w_1 = \mathbf u/\|\mathbf u\|, \\ \mathbf v_\perp = \mathbf v - \frac{\mathbf u^T \mathbf v}{\mathbf u^T\mathbf u}\mathbf u, \quad \mathbf w_2 = \mathbf v_\perp/\|\mathbf v_\perp\|. $$ From there, we have $$ \mathbb P = I - \mathbf w_1\mathbf w_1^T - \mathbf w_2\mathbf w_2^T = I - \frac{\mathbf u \mathbf u^T}{\mathbf u^T\mathbf u} - \frac{\mathbf v_\perp\mathbf v_\perp^T}{\mathbf v_\perp^T \mathbf v_\perp}. $$ Another option is to use a direct formula. For a given matrix $A$ with linearly independent columns, the projection onto the column space of $A$ is given by $$ \mathbb P_A = A(A^TA)^{-1}A^T. $$ Thus, if $A$ denotes the matrix whose columns are $\mathbf u,\mathbf v$, then your projection can be obtained as $$ \mathbb P = I - \mathbb P_A = I - A(A^TA)^{-1}A^T. $$ Because $A^TA$ is only a $2 \times 2$ matrix, you could expand this into a formula written completely in terms of $\mathbf u,\mathbf v$ if you wanted to. In particular, we find that $$ A^TA = \pmatrix{\mathbf u^T\mathbf u & \mathbf u^T \mathbf v\\ \mathbf v^T \mathbf u & \mathbf v^T\mathbf v}, \quad (A^TA)^{-1} = \frac{1}{\|\mathbf u\|^2\|\mathbf v\|^2 - (\mathbf u^T\mathbf v)^2}\pmatrix{ \mathbf v^T\mathbf v & -\mathbf u^T \mathbf v\\ -\mathbf v^T\mathbf u & \mathbf u^T\mathbf u }. $$ If we define $\delta = \frac{1}{\|\mathbf u\|^2\|\mathbf v\|^2 - (\mathbf u^T\mathbf v)^2}$, then we have $$ \mathbb P_A = \delta\cdot [\|\mathbf v\|^2 \mathbf u\mathbf u^T + \|\mathbf u\|^2 \mathbf v \mathbf v^T - \mathbf u^T\mathbf v(\mathbf u\mathbf v^T + \mathbf v \mathbf u^T)]. $$

Related Question