사용자:Kanie/연습장

위키백과 ― 우리 모두의 백과사전.

  1. What is the quaternion q1 that represents the rotation of 180 degree about the x-axis?
    \begin{array}{lcl}
q_1 & = & (\cos \pi / 2, \sin \pi / 2 \times \mathbf i ) \\
& = & (0, 1, 0, 0)
\end{array}
  2. What is the quaternion q2 that represents the rotation of 180 degree about the z-axis?
    \begin{array}{lcl}
q_2 & = & (\cos \pi / 2, \sin \pi / 2 \times \mathbf k ) \\
& = & (0, 0, 0, 1)
\end{array}
  3. What rotation is represented by composite quaternion q = q1q2?
    \begin{array}{lcl}
q & = & q_1 q_2 \\
& = & \mathbf i \times \mathbf k \\
& = & - \mathbf j \\
& = & (0, 0, 1, 0)
\end{array}
    rotation of 180 degree about the y-axis
  4. Let \mathbf x be a point and let X = ( 0, \mathbf x ) be a quaternion whose scalar part is zero and whose vector part is equal to \mathbf x. Show that if q = ( w, \mathbf v ) is a unit quaternion, the product qXq − 1 is a purely imaginary quaternion and the vector part of qXq − 1 satisfies:
    (w^2 - \mathbf v \cdot \mathbf v ) \mathbf x + 2 \left ( w( \mathbf v \times \mathbf x ) + ( \mathbf x \cdot \mathbf v ) \mathbf v \right )
    q^{-1} = ( w, -\mathbf v )
    \begin{array}{lcl}
qXq^{-1} & = & (w, \mathbf v)(0, \mathbf x)(w, -\mathbf v) \\
& = & (-\mathbf v \cdot \mathbf x, w \mathbf x + \mathbf v \times \mathbf x)(w, -\mathbf v) \\
& = & (-w(\mathbf v \cdot \mathbf x) + (w \mathbf x + \mathbf v \times \mathbf x) \cdot \mathbf v , w(w \mathbf x + \mathbf v \times \mathbf x) + (\mathbf v \cdot \mathbf x) \mathbf v - (w \mathbf x + \mathbf v \times \mathbf x) \times \mathbf v ) \\
& = & (- w (\mathbf v \cdot \mathbf x) + w (\mathbf v \cdot \mathbf x) + 0, w^2 \mathbf x + w(\mathbf v \times \mathbf x) + (\mathbf v \cdot \mathbf x)\mathbf v + w(\mathbf v \times \mathbf x) - (\mathbf v \times \mathbf x) \times \mathbf v ) \\
& = & (0, w^2 \mathbf x + 2w(\mathbf v \times \mathbf x) + (\mathbf v \cdot \mathbf x)\mathbf v - (\mathbf v \cdot \mathbf v)\mathbf x + (\mathbf v \cdot \mathbf x)\mathbf v) \\
& = & (0, (w^2 - \mathbf v \cdot \mathbf v) \mathbf x + 2 \left ( w(\mathbf v \times \mathbf x) + (\mathbf v \cdot \mathbf x) \mathbf v \right ) )
\end{array}
  5. Show that q and -q represent same rotation using the result of Exercise 4.
    -q = (-w. -\mathbf v)
    \begin{array}{lcl}
-q X (-q)^{-1} & = & \left ( (-w)^2 - (-\mathbf v) \cdot (-\mathbf v) \right ) \mathbf x + 2 \left ( (-w)(-\mathbf v \times \mathbf x) + (\mathbf x \cdot (-\mathbf v))\mathbf v \right ) \\
& = & (w^2 - \mathbf v \cdot \mathbf v) \mathbf x + 2 \left ( w(\mathbf v \times \mathbf x) + (\mathbf x \cdot \mathbf v) \mathbf v \right ) \\
& = & q X q^{-1}
\end{array}
    Therefore q and q represents the same rotation.
  6. Compare the number of additions and multiplications needed to perform the following operations:
    • Compose two rotation matrices.
      given n × n matrices A and B, (AB)_{ij} = \sum_{r=1}^n a_{ir}b_{rj} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}.
      this requires at least (n-1) additions and n multiplications per single element
      3 × 3 matrix multiplication requires (2 additions + 3 multiplication) * 9 elements = 18 additions + 27 multiplications)
    • Compose two quaternions
      \begin{array}{l}
(w_1 + x_1 \mathbf i + y_1 \mathbf j + z_1 \mathbf k) \times (w_2 + x_2 \mathbf i + y_2 \mathbf j + z_2 \mathbf k) \\
\begin{array}{ll}
= & w_1 w_2 - x_1 x_2 - y_1 y_2 - z_1 z_2 \\
& + (w_1 x_2 + x_1 w_2 + y_1 z_2 - z_1 y_2) \mathbf i \\
& + (w_1 y_2 + y_1 w_2 + z_1 x_2 - x_1 z_2) \mathbf j \\
& + (w_1 z_2 + z_1 w_2 + x_1 y_2 - y_1 x_2) \mathbf k
\end{array}
\end{array}
      this requires 12 additions + 16 multiplications
    • Apply a rotation matrix to a vector
      A \mathbf x = \left ( A_{1, 1} \mathbf x_1 + A_{1, 2} \mathbf x_2 + A_{1, 3} \mathbf x_3 , A_{2, 1} \mathbf x_1 + A_{2, 2} \mathbf x_2 + A_{2, 3} \mathbf x_3 , A_{3, 1} \mathbf x_1 + A_{3, 2} \mathbf x_2 + A_{3, 3} \mathbf x_3 \right )
      (2 additions + 3 multiplications) * 3 elements = 6 additions + 9 multiplications
    • Apply a quaternion to a vector (as in Exercise 4)
      
\begin{array}{l}
(w^2 - \mathbf v \cdot \mathbf v ) \mathbf x + 2 w( \mathbf v \times \mathbf x ) + ( \mathbf x \cdot \mathbf v ) \mathbf v ) \\
\begin{array}{ll}
= & ( (w^2 - \mathbf v \cdot \mathbf v) x_1 + 2w(v_2 x_3 - v_3 x_2) + 2(\mathbf x \cdot \mathbf v) v_1, \\
& (w^2 - \mathbf v \cdot \mathbf v) x_2 + 2w(v_3 x_1 - v_1 x_3) + 2(\mathbf x \cdot \mathbf v) v_2, \\
& (w^2 - \mathbf v \cdot \mathbf v) x_3 + 2w(v_1 x_2 - v_2 x_1) + 2(\mathbf x \cdot \mathbf v) v_3 )
\end{array}
\end{array}
      • w^2 - \mathbf v \cdot \mathbf v = w^2 - v_1^2 - v_2^2 - v_3^3 : 3 additions + 4 multiplications
      • \mathbf x \cdot \mathbf v = x_1 v_1 + x_2 v_2 + x_3 v_3 : 2 additions + 3 multiplications
      • total : (4 additions + 5 multiplications) * 3 + 5 additions + 7 multiplications
        = 17 additions + 22 multiplications
      • (if times 2 is counted as multiplication, then 6 more multiplications) : 17 additions + 28 multiplications
  7. Show that a rigid body rotating at angular velocity \omega (t) \in \Bbb R ^3 can be represented by the quaternion differential equations
     \dot q (t) = \frac{1}{2} \left ( 0, \omega (t) \right ) q(t)
    Hint: Recall that the angular velocity \omega (t) \, indicates that the body is instantaneously rotating about the ω axis with magnitude \left|\left|\omega (t)\right|\right|. Suppose that a body were to rotate with a constant angular velocity \omega (t) \,. Then the rotation of the body after a period of time \Delta t \, is represented by the quaternion
    \left ( \cos \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} , \frac{\omega (t)}{\left|\left| \omega (t) \right|\right|} \sin \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} \right )
    At times t + \Delta t \, (for small \Delta t \,), the orientation of the body is (to within the first order)
    q(t + \Delta t) = \left ( \cos \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} , \frac{\omega (t)}{\left|\left| \omega (t) \right|\right|} \sin \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} \right ) q(t)
    compute \dot q by differentiating the above equation

    \begin{array}{lcl}
\dot q (t) & = & \lim \limits_{\Delta t \to 0} \frac{q(t + \Delta t) - q(t)}{\Delta t}\\
& = & \lim \limits_{\Delta t \to 0} \left [ \left ( \cos \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} , \frac{\omega (t)}{\left|\left| \omega (t) \right|\right|} \sin \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} \right ) - 1 \right ] \frac{q(t)}{\Delta t} \\
& = & \lim \limits_{\Delta t \to 0} \left [ \left ( \cos \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} - 1 \right ) / \Delta t , \frac{\omega (t)}{\left|\left| \omega (t) \right|\right|} \sin \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} / \Delta t \right ] q(t) \\
& = & \left ( \frac {\partial}{\partial \Delta t} \cos \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} , \frac{\omega (t)}{\left|\left| \omega (t) \right|\right|} \frac {\partial}{\partial \Delta t} \sin \frac{\left|\left| \omega (t) \right|\right| \Delta t}{2} \right ) q(t) \,\,\,\,\,\, \mbox{(by lHospitals rule)}\\
& = & \left ( 0, \frac{\omega (t)}{\left|\left| \omega (t) \right|\right|} \frac{\left|\left| \omega (t) \right|\right|}{2} \right ) q(t) \\
& = & \frac{1}{2} \left ( 0, \omega (t) \right ) q(t)
\end{array}