Finding the matrix that, when right multiplied by a vector, results in the perpendicular component of that vector

cross productlinear algebramatricesvectors

The question is

Find matrix $R$ so that $R\vec{a} = \vec{a} – \frac{\vec{a} \cdot \vec{b}}{\|\vec{b}\|^2} \vec{b} = \vec{a} – \vec{a}_{\parallel\vec{b}} = \vec{a}_{\bot \vec{b}}$.

I want to check if my solution is correct.

For start, $\vec{a}_{\bot \vec{b}} = \frac{\vec{b} \times \vec{a} \times \vec{b}}{\|b\|^2}$ is something I proved previously using the vector triple product and its property according to which $\vec{b} \times (\vec{a} \times \vec{b}) = (\vec{b} \times \vec{a}) \times \vec{b}$; another property is $(\vec{b} \times \vec{a}) \times \vec{c} = -\vec{c} \times (\vec{b} \times \vec{a})$, which in our case gives $-\vec{b} \times (\vec{b} \times \vec{a})$. Knowing that $\vec{u} \times \vec{v}$ can be written under the form of a matrix as $[u]_{\times}\vec{v}$ with $[u]_{\times} = \begin{bmatrix}
0 & -u_z & u_y \\
u_z & 0 & -u_x \\
-u_y & u_x & 0 \\
\end{bmatrix}$
we get $-\vec{b} \times (\vec{b} \times \vec{a}) = [-b]_{\times}([b]_{\times}\vec{a}) = [-b]_{\times}[b]_{\times}\vec{a}$. Considering the fact that $\vec{a}_{\bot \vec{b}} = \frac{\vec{b} \times \vec{a} \times \vec{b}}{\|b\|^2}$, we get $R = \frac{[-b]_{\times}[b]_{\times}}{\|b\|^2}$. Is my reasoning correct here or am I missing something?

Best Answer

In general, the required matrix $R\in \mathbb{R}^{n\times n}$ is

$$R=I_n-\frac{bb^T}{b^Tb}$$

where $b\in \mathbb{R}^n$ and $I_n=\delta_{ij} \in \mathbb{R}^{n\times n}$.

Related Question