# 2d projection of a 3d image

I am having a problem where I have a $2$D object which can move in $3$-dimensional space about a fixed point (the origin). I want to rotate this object using Euler angles and axes of rotation.

If you think of the object as a square with co-ordinates: $(0, 1, 0)$, $(1, 0, 0)$, $(0, -1, 0)$ and $(-1, 0, 0)$.

What I am trying to do is to rotate this square first by rotating around the $x$ axis ($y$ axis and $z$ axis will move by the given angle $\theta$ giving $y'$ and $z'$) then around the new axis $y'$ with an angle $\phi$, giving $x'$ and $z''$ and finally around $z''$ with an angle $\psi$ giving at last $x''$, $y''$ and $z''$.

What I need after rotating the axes is the angle between the $z''$ axis and the $x''$ axis to be a given angle $\alpha$ when projected onto a $2$D plane.

The angle will always be $90$ degrees but when projected as a $2$D image it will appear to have a different angle. I need it to be around $80$ degrees.

• Welcome to MSE! Some questions: Do you know about rotation matrices? Are $(x', y', z')$ the Cartesian coordinates associated to the rotated axes after rotating about $x$ (and similarly for $(x'', y'', z'')$ after rotating about $y'$)? Are you just asking for appropriate numerical values for the Euler angles? And does the square enter in, or just the projected angle between $x''$ and $z''$? (Separately, it's customary (and appreciated) if you format your answers. The site tour may be useful, as well.) Mar 10, 2015 at 21:02
• Yes I have studied rotation matrices last year but I am a little rusty. When rotating around the x axis the x axis will not move and remain as x, but y and z will move giving after this rotation (x, y', z'). If we then rotate around the z axis (i.e z') both the x and y axes will move but not the z giving (x', y'', z'). If we finally rotate about the y axis (i.e y'') we will have (x'', y'', z''). My problem is that I need to find the angle between the final axes x'' and z''. Does that clear this up? Im finding it quite hard to explain. Mar 11, 2015 at 18:53

$\newcommand{\NEG}{\phantom{-}}$Not positive I understand in detail what you want, but here are a couple of factlets that should suffice to piece together a solution. First, rotations by $\theta$ about the three Cartesian coordinate axes are accomplished by $$R_{x}(\theta) = \left[\begin{array}{@{}ccc@{}} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \NEG\cos\theta \\ \end{array}\right],\ R_{y}(\theta) = \left[\begin{array}{@{}ccc@{}} \NEG\cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \\ \end{array}\right],\ R_{z}(\theta) = \left[\begin{array}{@{}ccc@{}} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \NEG\cos\theta & 0 \\ 0 & 0 & 1 \\ \end{array}\right].$$
Second, if $P$ is a rotation matrix carrying the axes $(x, y, z)$ to $(x', y', z')$, then the transpose $P^{t}$ carries $(x', y', z')$ to $(x, y, z)$, and (for example) $$R_{x'}(\theta) = P R_{x}(\theta) P^{t}$$ is rotation by $\theta$ about the $x'$ axis.
Thus, for example, to rotate by $\theta$ about $x$ and then to rotate by $\phi$ about $y'$, the image of the $y$ axis under the first rotation, you'd form the product of $P = R_{x}(\theta)$ and $R_{y'}(\phi) = P R_{y}(\phi) P^{t}$, i.e., $$R_{y'}(\phi)R_{x}(\theta) = R_{x}(\theta) R_{y}(\phi).$$
Once you've computed the composition of all your rotations, the first column is a set of direction cosines for $x''$ (with respect to the original $(x, y, z)$ coordinate system) and the third column is a set of direction cosines for $z''$. To project to the $(x, y)$ plane, discard the third component of each vector; then take the dot product to get the cosine of the angle between the "shadows".