A particle is moving in a circle along a plane in 3d space with the center at the origin. The Euler axis is given by $a = [a_1, a_2,a_3]^\top$. The particle circles on a plane perpendicular to Euler axis $a$. I want to find the appropriate coordinate transformation that would describe the plane in which the circle is being traced. Here is my approach: We rotate the entire coordinate axis such that $Z$ axis intersects with the Euler axis. There is no need for translation of the coordinate axis since the circle is having origin as its center. The rotation angle $\phi$ between $a = [a_1, a_2,a_3]^\top$ and $\hat{z} = [0, 0, 1]^\top$ (unit vector along Z direction) is given by $$ cos(\phi) = \frac{a.\hat{z}}{|a|} = a_3 \tag{1} $$
The axis of rotation has to be orthogonal to $a$ and $\hat{z}$. Therefore the axis of rotation is given by \begin{equation} \alpha = \frac{a \times k}{|a|} = [a_2, -a_1, 0]^\top \tag{2} \end{equation}
The unit vector along the new axis is given by normalizing ($2$) \begin{equation} \hat{\alpha} = \frac{\alpha}{|\alpha|} = [\frac{a_2}{\sqrt(a_2^{2}+a_1^{2})}, \frac{-a_1}{\sqrt(a_2^{2}+a_1^{2})}, 0]^\top \tag{3} \end{equation}
We use Rotation matrix from axis and angle(https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle) with rotation axis given by ($3$) and rotation angle given by ($1$). The transformation matrix is given by
\begin{bmatrix} \cos\phi+ \alpha_x^{2}(1-\cos\phi) & \alpha_x \alpha_y (1-\cos\phi)- \alpha_z \sin\phi & \alpha_x \alpha_z (1-\cos\phi)+ \alpha_z \sin\phi \\ \alpha_y \alpha_x (1-\cos\phi)+ \alpha_z \sin\phi & \cos\phi+ \alpha_y^{2}(1-\cos\phi) & \alpha_y \alpha_z (1-\cos\phi)- \alpha_x \sin\phi \\ \alpha_z \alpha_x (1-\cos\phi)- \alpha_z \sin\phi & \alpha_z \alpha_y (1-\cos\phi)+ \alpha_x \sin\phi & \cos\phi+ \alpha_z^{2}(1-\cos\phi) \tag{4} \end{bmatrix}.
where $[\alpha_x,\alpha_y,\alpha_z]$ represents the respective component along the $\alpha$ axis. Whether ($4$) is the appropriate transformation matrix?