[Math] Formula to project a vector onto a plane

3dlinear algebravectors

I have a reference plane formed by $3$ points in $\mathbb{R}^3$$A, B$ and $C$. I have a $4$th point, $D$. I would like to project the vector $\vec{BD}$ onto the reference plane as well as project vector $\vec{BD}$ onto the plane orthogonal to the reference plane at vector $\vec{AB}$. Ultimately, I need the angle between $\vec{AB}$ and $\vec{BD}$ both when the vectors are projected on to the reference plane as well as the orthogonal plane. I have completed tutorials on projecting a vector onto a line in $\mathbb{R}^2$ but haven't figured out how to translate that to $\mathbb{R}^3$

Please note the diagram only shows the reference plane as parallel to the $xy$ plane for the sake of convenience. In my examples, the reference plane could be at any orientation. I am using $3$D coordinate data from an electromagnetic motion tracker and the reference plane will be constantly moving. I understand the cross product of the two vectors $\vec{AB} \times \vec{BC}$ results in the normal vector to their plane. I have $2$ different methods to calculate that but am a little lost once I get to this point. I have seen both unit vector notation and column vector notation but am confused by moving between the different styles. It would be most helpful if you could tell me the formal name of the notation/equations you use. I know the scalar equation of a plane through point $(a,b,c)$ with normal $\hat{n} = [n_1, n_2, n_3]$ is:
$$
n_1(x-a) + n_2(y-b) +n_3(z-c) = 0
$$

and the standard linear equation definition is:
$$
Ax + By + Cz = D
$$

but I could use some tips on when the equation is $=D$ and when it is $=0$ as well as any additional equations for a plane and in which circumstances the different forms are appropriate. I hope I've made sense here. Thanks for any help you can provide.
enter image description here

Best Answer

If $A$,$B$,$C$ are not on the same line, then $\vec{AB}\times \vec{BC}$ will give you the direction of your reference plane normal vector $\hat{n}_1$. I think you should know how to do the normalization so that $|\hat{n}_1|=1$

Then the projection of $\vec{BD}$ on the reference plane is $\vec{BD}-(\vec{BD}\cdot \hat{n}_1)\hat{n}_1$

Another plane $\hat{n}_2$ orthogonal to the reference plane ABC can be found as $\vec{AB}\times\hat{n}_1$ (again you need to normalize it). Then the projection of $\vec{BD}$ on that plane can alsow be found in a similar way as shown for the first plane.

Related Question