# How to choose a proper rotation matrix and apply it to rotate unit cell about Cartesian axis

In this paper, they have rotated the unit cell using a rotation matrix, so the axes are aligned with the atomic bonds. I would like to know how they calculated that rotation matrix, and which software to use to apply that rotation on a unit cell.

• From the article "For this we first find the proper rotation matrix using the VESTA program [43]. Then we cal- culated the corresponding rotation angles and rotated the CrI3 unit cell using Atomsk"
– Tyberius
Nov 20, 2021 at 13:52
• @Tyberius but how to do that? Nov 20, 2021 at 14:14
• From not having used Vesta and just checking the manual, it doesn't seem like there is an automated feature to find a particular rotation matrix. What it could help with is determining the vector of a bond, which could then be used to calculate the rotation matrix as described on Math SE. Vesta can then be used to apply this rotation to your unit cell.
– Tyberius
Nov 20, 2021 at 15:31
• If using the approach @Tyberius mentions, Mathematica's RotationMatrix[{u,v}] command can make obtaining the rotation matrix very easy. Nov 20, 2021 at 17:34
• @Tyberius I still couldn't understand the approach? Nov 21, 2021 at 16:35

I don't know much about either of these programs, but I can at least point you to the mathematical procedure for rotating a vector onto another vector. Using Vesta, you should be able to determine the vector for a bond $$\ce{A-B}$$ (call the vector $$\vec{u}$$) from the coordinates of $$\ce{A}$$ and $$\ce{B}$$. You could then align this bond with $$\vec{x}=(1,0,0)$$ (for example), using the rotation matrix:
$$R=I+[U]_\times+[U]_\times^2\frac{1-\cos(\theta)}{\sin(\theta)^2}$$
with $$\theta$$ the angle between the $$\vec{u}$$ and $$\vec{x}$$ and $$[U]_\times=[\vec{u}\times \vec{x}]= \begin{bmatrix} 0 & -u_3 & u_2\\ u_3 & 0 & -u_1\\ u_2 & u_1 & 0\\ \end{bmatrix}$$
Once you have this rotation matrix, you can enter the Transform tab in VESTA which should allow you enter and apply this rotation matrix. As Anyon mentioned, some languages like Mathematica have built in functions to form this rotation matrix. VESTA itself may have such a function, but I haven't found one thus far.