Skip to content

Latest commit

 

History

History
101 lines (72 loc) · 4.22 KB

euler_angles.rst

File metadata and controls

101 lines (72 loc) · 4.22 KB

Understanding Euler angles and the orientation matrix

In crystallography, the orientation of a lattice can be described with respect to the laboratory frame by a rotation. In material science, this description follows the passive convention (as used by pymicro) which means the rotation is defines such as it brings the laboratory frame in coincidence with the crystal frame.

Rotations in Euclidian space have 3 independent components as shown by Euler. They can be described in a number of ways such as:

  • Euler angles
  • Orientation matrix
  • Rodrigues vector
  • Quaternion

Euler angles are a common way of defining a rotation by combining 3 successive rotations around different axes. Here we use the convention of Bunge which is to rotate first around Z then around the new X and finally around the new Z. This example will show how the 3 successive rotations are carried out and that they indeed bring the laboratory frame (XYZ) in coincidence with the crystal frame.

Get the complete Python source code: euler_angles_anim.py <../examples/animation/euler_angles_anim.py>

As an example, take the following triplet of Euler angles (in degrees): (ϕ1, Φ, ϕ2) = (142.8, 32.0, 214.4)

../examples/animation/euler_angles_anim.py

This instance of Orientation can be used to display a crystal lattice in a 3D scene

../examples/animation/euler_angles_anim.py

A 3D view of a cubic lattice with a given orientation.

A 3D view of a cubic lattice with a given orientation.

Now by applying successively the 3 rotation, we show that the laboratory frame is made coincident with the crystal frame. The first rotation of angle ϕ1 is around Z, the second rotation of angle Φ is around the new X and the third rotation angle ϕ2 is around the new Z.

image

image

image

The expression of the orientation matrix is obtained by composing the three rotations Rϕ1, RΦ and Rϕ2:

$$\begin{aligned} \mathbf{g}(\phi_1,\Phi,\phi_2)= \begin{pmatrix} \cos\phi_1\cos\phi_2 - \sin\phi_1\sin\phi_2\cos\Phi & \sin\phi_1\cos\phi_2 + \cos\phi_1\sin\phi_2\cos\Phi & \sin\phi_2\sin\Phi \\\ -\cos\phi_1\sin\phi_2 - \sin\phi_1\cos\phi_2\cos\Phi & -\sin\phi_1\sin\phi_2 + \cos\phi_1\cos\phi_2\cos\Phi & \cos\phi_2\sin\Phi \\\ \sin\phi_1\sin\Phi & -\cos\phi_1\sin\Phi & \cos\Phi \end{pmatrix} \end{aligned}$$

Using the given Euler angle yield the following orientation matrix:

$$\begin{aligned} \mathbf{g}(142.8, 32.0, 214.4)= \begin{pmatrix} 0.946 & -0.117 & -0.299 \\\ -0.026 & 0.898 & -0.437 \\\ 0.320 & 0.422 & 0.848 \end{pmatrix} \end{aligned}$$

With the orientation matrix it is the possible to express any vector Vc from the cartesian crystal frame to the sample frame by:


Vs = g − 1.Vc with g − 1 = gT

From this it follows that the lines of g are actually composed by the 3 cartesian lattice vectors expressed in the lab frame. Similarly, the columns of g are composed by the 3 cartesian laboratory vectors expressed in the crystal frame.

For instance, using the same Euler angles and considering the vector Vc = (1, 0, 0) gives Vs = (0.946,  − 0.117,  − 0.299) which is the first line of g. Chosing Vc = (1, 1, 1) gives Vs = (1.240, 1.203, 0.111). This can be verified using pymicro:

>>> g = orientation.orientation_matrix()
>>> Vc = np.array([1, 0, 0])
>>> print(np.dot(g.T, Vc))
[ 0.94690263, -0.11723012, -0.2993869]
>>> Vc = np.array([1, 1, 1])
>>> print(np.dot(g.T, Vc))
[ 1.24033795  1.20380558  0.11141766]

Finally, looking at the 3d representation for direction [1, 1, 1] shows the values seem correct.

3D view showing the [111] lattice vector in the sample frame XYZ.

3D view showing the [111] lattice vector in the sample frame XYZ.