$3D$ projection onto a plane

812 Views Asked by At

I have an engineering problem involving math so I figured I ask it here. I have two sets of data:

  1. Acceleration in $3$ dimension is given by $\langle X,Y,Z \rangle $.
  2. Change of orientation along each of the three axis is given by $\langle x,y,z\rangle$.

For these two set of data, I want acceleration in $2$ dimension $\langle \ ,\ \rangle$.

So for example, say my orientation is orthogonal to the $z$-axis. Acceleration would be $\langle X,Y\rangle$.

If the orientation is orthogonal to the $y$-axis, acceleration would be $\langle X,Z\rangle$.

If the orientation is orthogonal to the $x$-axis, acceleration would be $\langle Y,Z\rangle$.

I want this for all orientation, what would be transformation matrix?

1

There are 1 best solutions below

2
On

I'm not sure if I understand your terminology properly (not really sure what you mean by "change of orientation along each of the three axis"), but it sounds like you want to project a vector given by $\langle X,Y,Z\rangle$ to a 2-dimensional plane that is orthogonal to a vector given by $\langle x,y,z\rangle$.

I don't know if you are familiar at all with vectors, but all you need to do is to remove the component of $\langle X,Y,Z\rangle$ that is parallel to $\langle x,y,z\rangle$.

Since you are calling $\langle X,Y,Z\rangle$ the "acceleration," I 'll denote it by $\vec{a}$. I will call $\vec{n} = \langle x,y,z\rangle$.

Using vector projection, you can find the component of $\vec{a}$ that is parallel to $\vec{n}$:

$$Proj_{\vec{n}}\vec{a} = \dfrac{\vec{a}\cdot \vec{n}}{\vec{n}\cdot\vec{n}}\vec{n}$$

Once you take away this projection from $\vec{a}$, your vector no longer has a component in the $\vec{n}$ direction; therefore, it must be perpendicular to $\vec{n}$.

$$\vec{a} - Proj_{\vec{n}}\vec{a}$$

The resulting vector is precisely the projection of $\vec{a}$ onto the plane perpendicular to $\vec{n}$.

If you are skeptical, you can test it out as follows:

If the orientation is orthogonal along the $z$-axis, then $\vec{n} = \langle0, 0, 1\rangle$, so

$$Proj_{\vec{n}}\vec{a} = \dfrac{\langle X,Y,Z\rangle\cdot \langle 0,0,1\rangle}{\langle 0,0,1\rangle\cdot\langle0,0,1\rangle}\langle0,0,1\rangle = \dfrac{Z}{1} \langle0,0,1\rangle = \langle0,0,Z\rangle$$

And so

$$\vec{a} - Proj_{\vec{n}}\vec{a} = \langle X,Y,Z\rangle - \langle0,0,Z\rangle = \langle X,Y,0\rangle$$

You can try it with other examples you have, and you'll see that you get the desired result.

Finally, if you want to get a matrix out of this, simply note that

$$\vec{a} - Proj_{\vec{n}}\vec{a}$$

is a linear transformation in $\vec{a}$. You can find the matrix of transformation by following the instructions in this link.

Finally, if you want to get something with just a pair of numbers, this isn't really possible, because 2 dimensional planes that lie in three dimensional space do not have a canonical choice of basis vectors. The $xy$, $yz$, and $xz$ planes are special.