Find rotations about x,y,z such that

562 Views Asked by At

I have a vector $(0,0,1)$ and it is rotated about x, then rotated around y and then rotated around the z axis to a new point $(x,y,z)$. In other words.

$\begin{bmatrix} x \\ y \\ z\end{bmatrix} = R_z(\alpha) R_y(\beta) R_x(\gamma) \begin{bmatrix} 0 \\ 0 \\ 1\end{bmatrix}$

Where $R_x, R_y, R_z$ are rotation matrices. How can I find the rotation angles $\alpha, \beta, \gamma$ in terms of final point coordinates $x,y,z$?

1

There are 1 best solutions below

0
On BEST ANSWER

First find the azimuth $\theta$ and elevation $\phi$ and radius $r$ of the final point $(x,y,z)$. Then rotate the the initial point in the x,y plane by the $\theta$. Then rotate that point around the axis perpendicular to the line at the angle of $\theta$. Let this second axis of rotation be defined by the unit vector $u = (u_x, u_y, u_z)$.

First rotation about z axis

$R_z = \left(\begin{array}{ccc} \cos\left(\mathrm{\theta}\right) & -\sin\left(\mathrm{\theta}\right) & 0\\ \sin\left(\mathrm{\theta}\right) & \cos\left(\mathrm{\theta}\right) & 0\\ 0 & 0 & 1 \end{array}\right)$

Second rotation about u axis. In this case the axis of rotation is defined by: $u_x = -\sin(\theta)$, $u_y = \cos(\theta)$, $u_z = 0$.

$R_u=\left(\begin{array}{ccc} \cos\left(\mathrm{\phi}\right)-{u_{x}}^2\,\left(\cos\left(\mathrm{\phi}\right)-1\right) & -u_{z}\,\sin\left(\mathrm{\phi}\right)-u_{x}\,u_{y}\,\left(\cos\left(\mathrm{\phi}\right)-1\right) & u_{y}\,\sin\left(\mathrm{\phi}\right)-u_{x}\,u_{z}\,\left(\cos\left(\mathrm{\phi}\right)-1\right)\\ u_{z}\,\sin\left(\mathrm{\phi}\right)-u_{x}\,u_{y}\,\left(\cos\left(\mathrm{\phi}\right)-1\right) & \cos\left(\mathrm{\phi}\right)-{u_{y}}^2\,\left(\cos\left(\mathrm{\phi}\right)-1\right) & -u_{x}\,\sin\left(\mathrm{\phi}\right)-u_{y}\,u_{z}\,\left(\cos\left(\mathrm{\phi}\right)-1\right)\\ -u_{y}\,\sin\left(\mathrm{\phi}\right)-u_{x}\,u_{z}\,\left(\cos\left(\mathrm{\phi}\right)-1\right) & u_{x}\,\sin\left(\mathrm{\phi}\right)-u_{y}\,u_{z}\,\left(\cos\left(\mathrm{\phi}\right)-1\right) & \cos\left(\mathrm{\phi}\right)-{u_{z}}^2\,\left(\cos\left(\mathrm{\phi}\right)-1\right) \end{array}\right)$

Then to map the vector $(0,0,1)$ to the point $(x,y,z)$ I need to do the following:

${\begin{pmatrix} x\\ y\\ z \end{pmatrix}} = R_u R_z {\begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix}}$

Because the matrices only do rotations, this formula will only work if the magnitude of the vector $(x,y,z)$ is 1