## Quiz 3: Study Guide

Quizzes are open book. 30 minutes at the start of class

Topics:

• Rotation matrices

• Euler angles

• Quaternions

Unless explicitly asked to compute a final answer, it is sufficient to write out the formula and plug-in values.

## Practice questions

1) What is a rotation matrix?

2) What is a quaternion?

3) What is the relationship between rotation matrices, quaternions, and euler angles?

4) What does it mean for a matrix to be orthogonal?

5) What do the columns of a rotation matrix represent?

6) How do we compute the 3x3 rotation matrix for euler angles YXZ?

7) What are euler angles? Why use them?

8) What is Gimbol Lock? When does it occur?

9) Derive the inverse of a ZYX euler matrix.

10) Suppose an object is rotated 50 degrees around Z, what is the 3x3 rotation matrix corresponding to the object’s orientation?

11) Consider the YZX euler rotation matrix having the algebraic form

``````[  cy*cz, sx*sy - cx*cy*sz, cx*sy + cy*sx*sz]
[     sz,            cx*cz,           -cz*sx]
[ -cz*sy, cy*sx + cx*sy*sz, cx*cy - sx*sy*sz]``````

Suppose we have the following matrix and we wish to extract YZX euler angles from it.

$\left( \begin{array}{ccc} -0.0170 & -0.5260 & 0.8503\\ 0.9939 & 0.0839 & 0.0718\\ -0.1091 & 0.8463 & 0.5214\\ \end{array} \right)$
• How can we get back the Z rotation? Write the formula and plugin in values

• How can we get back the Y rotation? Write the formula and plugin in values

• How can we get back the X rotation? Write the formula and plugin in values

12) Consider again the YZX euler rotation matrix above, but suppose we have the following matrix.

$\left( \begin{array}{ccc} 0 & -0.7597 & 0.6503 \\ -1 & 0 & 0 \\ 0 & -0.6503 & -0.7597 \\ \end{array} \right)$
• What is the Z rotation? What is the algebraic form of the matrix in this case?

• Sketch how we can get the YZX euler angles back from this matrix.

13) How do quaternions relate to rotations specified with an axis and angle?

14) Suppose we want to rotate a point (3,0,0) around the axis (1,1,0) by 30 degrees. Compute the quaternion corresponding to this rotation.

15) How can we ensure that a quaternion corresponds to a rotation?

16) Convert the quaternion from the previous question to a matrix.

17) Verify that multiplying the quaternion $q_i = (x, y, z, w) = (1,0,0,0)$ by $q_j = (0,1,0,0)$ produces the quaternion $q_k = (0,0,1,0)$. Recall that the formula for multiplying quaternions is

$q_1 q_2 = [w_1 v_2 + w_2 v_1 + v_1 \times v_2, w_1 w_2 - v_1 \cdot v_2]$

18) Consider the algebraic form of a matrix constructed from a quaternion $q = (x, y, z, w) = (\bar{v}, w)$.

$\left( \begin{array}{ccc} 1-2(y^2+z^2) & 2(x y - w z) & 2(x z + w y) \\ 2(x y + w z) & 1-2(x^2+z^2) & 2(y z - w x) \\ 2(x z - w y) & 2(y z + w x) & 1-2(y^2+x^2) \\ \end{array} \right)$

Suppose we have the same matrix as before

$\left( \begin{array}{ccc} -0.0170 & -0.5260 & 0.8503\\ 0.9939 & 0.0839 & 0.0718\\ -0.1091 & 0.8463 & 0.5214\\ \end{array} \right)$
• Show that $w^2 = \frac{1}{4}(r_{11} + r_{22} + r_{33} + 1)$.

• What is the w component corresponding to the given matrix? Plug in the values.

• How can we use the off-diagonal components to get the remaining x,y,z components?

19) Suppose we have a quaternion q = [0.1325, 0.2649, -0.7947, 0.5298]. Extract the angle and axis of rotation corresponding to this quaternion. Write the formula and plug in values.

20)Suppose we have a quaternion q = [0, 0, 0, 1]. Compute the matrix corresponding to this quaternion. What rotation does this correspond to?