Invert vector projection onto a plane

linear algebraprojection

Assume I have a vector $V_a$ that belongs to the plane $A$ defined by the normal $n_a$, which means that $V_a \cdot n_a = 0$.

Then assume that I projected $V_a$ onto a plane $B$ defined by its normal $n_b$ resulting in vector $V_b = V_a – (n_b \cdot V_a)n_b$.

If I know $V_b$, $n_a$ and $n_b$, how do I recover $V_a$? I initially thought that it would be as simple as projecting $V_b$ onto $A$, but a quick numerical test showed me that this isn't the case. Inverting the projection matrix also didn't work because $n_b$ is an null eigenvector.

Notes:

  1. I am interested in vector directions so all vectors are normalized
  2. Vectors are restricted to $\mathbb R^3$
  3. $n_a \cdot n_b \ne 0$

Best Answer

The projection of $V_b$ onto $A$ is $V_b-(n_a\cdot V_b) n_a$. This is in the right direction, however the magnitude is smaller than $V_a$. In the first projection $|V_b|=|V_a|\cos\alpha$, where $\alpha$ is the angle between $n_a$ and $n_b$. We can write it as $|V_b|=|V_a|n_a\cdot n_b$. When you do the second projection, you get an extra factor of $\cos\alpha$. Therefore the final answer is: $$\frac{V_b-(n_a\cdot V_b) n_a}{(n_a\cdot n_b)^2}$$ You can see why you don't want the directions to be perpendicular, since you don't want to divide by 0.