# transforming $(A,B,C)$ to $(0, 0, 1)$ by rotations

I'm trying to reflect the "world" through a specified plane $p:Ax+By+Cz=0$. I know how to reflect the "world" through the $xy$-plane, so I want to rotate $p$ in the $3$ axes ($x,y,z$-axes) so it will be contained in the $xy$-plane, which means its normal will be $(0,0,1)$.

That's why I want transform $p$'s normal to $(0,0,1)$. I'm trying to solve this using the three rotations with known transformations:

Rotation about the $z$-axis for example:

\begin{pmatrix} \cos A & -\sin A & 0 \\ \sin A & \cos A & 0 \\ 0 & 0 & 1 \end{pmatrix} So, using only this kind of matrix (for the $x$- and $y$-axes too) I would like to transform $(A,B,C)$ to $(0,0,1)$.

Thank you so much for helping.

• Three times is too much, it creates indeterminacy on the angles.
– user65203
May 6 '15 at 11:16
• @George S I will not fight a LaTeX/MathJax formatting war. May 6 '15 at 11:16
• I don't understand?
– user230715
May 6 '15 at 11:17
• correction: ... NOT fight ... May 6 '15 at 11:18
• I'm not fighting anyone.
– user230715
May 6 '15 at 11:19

First rotate around $X$ with angle $-\arctan(B/C)$ to cancel $B$

$$(A,B,C)\to(A,0,C'),$$

Then rotate around $Y$ with angle $-\arctan(A/C')$ to cancel $A$

$$(A,0,C')\to(0,0,C'').$$

• Assuming I need to execute the transformations one after another given only (A,B,C) ? without calculating the angle arctan(A/C') as this is something I can't do without calculating the first rotation? May 6 '15 at 17:35
• $C'=\sqrt{B^2+C^2}$ and $C''=\sqrt{A^2+B^2+C^2}$, obviously.
– user65203
May 6 '15 at 17:42
• Assuming the (A,B,C) = (1,0,0), we divide by zero. What do you say? May 6 '15 at 17:45
• No problem. For the first rotation the angle is arbitrary and the second, $\pi/2$. The equations are coherent.
– user65203
May 6 '15 at 17:47

What you want to do is rotate your vector $(A,B,C)^T$ three times, around each axis, and find the appropriate angles of rotation. You can write: $$\begin{pmatrix}0\\0\\1\end{pmatrix}=R_X\cdot R_Y\cdot R_Z\cdot\begin{pmatrix}A\\B\\C\end{pmatrix}$$ $$\begin{pmatrix}0\\0\\1\end{pmatrix}=\begin{pmatrix}1&0&0\\0&\cos X&-\sin X\\0&\sin X&\cos X\end{pmatrix}\begin{pmatrix}\cos Y&0&\sin Y\\0&1&0\\-\sin Y&0&\cos Y\end{pmatrix}\begin{pmatrix}\cos Z&-\sin Z&0\\\sin Z&\cos Z&0\\0&0&1\end{pmatrix}\begin{pmatrix}A\\B\\C\end{pmatrix}$$ Now you can multiply these matrices, and you should end up with a system of three equations with three unknowns, namely the angles $X$, $Y$ and $Z$.

• I don't think this is the best option as this is like "brute forcing" the angles. There must be a way to calculate the angels like @Yves Daoust suggested, just without the need of calculating the second angle after calculating the first transformation. May 6 '15 at 17:43

For a detailed algorithm you look here: http://inside.mines.edu/fs_home/gmurray/ArbitraryAxisRotation/

This is what @Yves suggested, in a more detailed way.

Thank you all!