Answers.Body: <p>The <a href="https://en.wikipedia.org/wiki/Rotation_matrix" rel="nofollow noreferrer">rotation matrix</a> <span class="math-container">$R_k(\theta)$</span> associated with a given unit-length vector <span class="math-container">$k$</span> and angle <span class="math-container">$\theta$</span> is given by the following formula</p>
  
  <p><span class="math-container">$$\small{R_k(\theta) = \begin{bmatrix} 
  \cos \theta +k_x^2 \left(1-\cos \theta\right) &amp; k_x k_y \left(1-\cos \theta\right) - k_z \sin \theta &amp; k_x k_z \left(1-\cos \theta\right) + k_y \sin \theta \\ 
  k_y k_x \left(1-\cos \theta\right) + k_z \sin \theta &amp; \cos \theta + k_y^2\left(1-\cos \theta\right) &amp; k_y k_z \left(1-\cos \theta\right) - k_x \sin \theta \\ 
  k_z k_x \left(1-\cos \theta\right) - k_y \sin \theta &amp; k_z k_y \left(1-\cos \theta\right) + k_x \sin \theta &amp; \cos \theta + k_z^2\left(1-\cos \theta\right)
  \end{bmatrix}}$$</span></p>
  
  <p>So, to find your specific rotation matrix, you just need to substitute the values of your <span class="math-container">$k$</span> and <span class="math-container">$\theta$</span> in the above matrix.</p>
  
  <p>The derivation of this matrix can be found in section <em>9.2 Rotation Matrix Derivation</em> of the PhD thesis <a href="https://dspace.lboro.ac.uk/dspace-jspui/handle/2134/18050" rel="nofollow noreferrer"><em>Modelling CPV</em> (2015)</a>, by Ian R. Cole. The basic idea of the derivation follows the following steps</p>
  
  <ol>
  <li><p>Rotate the given axis <span class="math-container">$k$</span> and the point <span class="math-container">$p$</span> (that you want to rotate) such that the axis <span class="math-container">$k$</span> lies in one of the coordinate <strong>planes</strong>: xy, yz or zx</p></li>
  <li><p>Rotate the given axis <span class="math-container">$k$</span> and the point <span class="math-container">$p$</span> (that you want to rotate) such that the axis <span class="math-container">$k$</span> is aligned with one of the two coordinate <em><strong>axes</strong> for that particular coordinate <strong>plane</strong></em>: <span class="math-container">$x$</span>, <span class="math-container">$y$</span> or <span class="math-container">$z$</span></p></li>
  <li><p>Use one of the <a href="https://en.wikipedia.org/wiki/Rotation_matrix" rel="nofollow noreferrer">fundamental rotation matrix</a> to rotate the point <span class="math-container">$p$</span> depending on the coordinate axis with which the rotation axis is aligned</p></li>
  <li><p>Reverse rotate the axis-point pair such that it attains the final configuration as that was in step 2 (that is, you have to undo step 2)</p></li>
  <li><p>Reverse rotate the axis-point pair which was done in step 1 (that is, you have to undo step 1)</p></li>
  </ol>
  
  <p>To show that a matrix is orthonormal, you need to show that it is <a href="https://en.wikipedia.org/wiki/Orthogonal_matrix" rel="nofollow noreferrer"><em>orthogonal</em></a> (each row is independent of any other row and each column is independent of any other column) and that the length of each row (and column) is 1. Equivalently, a <em>square</em> matrix <span class="math-container">$Q$</span> is orthogonal if and only if</p>
  
  <p><span class="math-container">$$
  Q^TQ = QQ^T = I
  $$</span></p>
  
  <p>where <span class="math-container">$Q^T$</span> is the <a href="https://en.wikipedia.org/wiki/Transpose" rel="nofollow noreferrer">transpose</a> of <span class="math-container">$Q$</span> and <span class="math-container">$I$</span> is the identity matrix. If you are really stuck, have a look at this proof <a href="https://math.stackexchange.com/a/537248/168764">https://math.stackexchange.com/a/537248/168764</a> (and this other answer <a href="https://math.stackexchange.com/a/156742/168764">https://math.stackexchange.com/a/156742/168764</a>), but, at this point, it should just be a matter of replacing <span class="math-container">$R_k(\theta)$</span> in the equation above and check that the equation holds.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-18T19:03:15.953Z
Answers.LastActivityDate: 2019-08-21T14:38:53.597Z
Answers.LastEditDate: 2019-08-21T14:38:53.597Z
Answers.UserDisplayName: nbro
Body: <p>Given an axis-angle rotation vector <span class="math-container">$\Theta = (2,2,0)$</span>, after finding the unit vector <span class="math-container">$k=(1/\sqrt{2}, 1/\sqrt{2}, 0)$</span> and angle <span class="math-container">$\theta = 2\sqrt{2}$</span> representing the same rotation, I need to derive the rotation matrix <span class="math-container">$R$</span> representing the same rotation and to show, that the matrix is orthonormal. How can I do that?</p>
  
Tags: <math><robotics>
Title: How can I derive the rotation matrix from the axis-angle rotation vector?
UserDisplayName: Qebapp
ThreadText: # How can I derive the rotation matrix from the axis-angle rotation vector?
  
  (Asked by: username_0 on 2019-08-18)
  
  Given an axis-angle rotation vector $\Theta = (2,2,0)$, after finding the unit vector $k=(1/\sqrt{2}, 1/\sqrt{2}, 0)$ and angle $\theta = 2\sqrt{2}$ representing the same rotation, I need to derive the rotation matrix $R$ representing the same rotation and to show, that the matrix is orthonormal. How can I do that?
  
  **Tags:** math, robotics
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-18. Score: 1
  
  The [rotation matrix](https://en.wikipedia.org/wiki/Rotation_matrix) $R\_k(\theta)$ associated with a given unit-length vector $k$ and angle $\theta$ is given by the following formula
  
  $$\small{R\_k(\theta) = \begin{bmatrix}
  \cos \theta +k\_x^2 \left(1-\cos \theta\right) & k\_x k\_y \left(1-\cos \theta\right) - k\_z \sin \theta & k\_x k\_z \left(1-\cos \theta\right) + k\_y \sin \theta \\
  k\_y k\_x \left(1-\cos \theta\right) + k\_z \sin \theta & \cos \theta + k\_y^2\left(1-\cos \theta\right) & k\_y k\_z \left(1-\cos \theta\right) - k\_x \sin \theta \\
  k\_z k\_x \left(1-\cos \theta\right) - k\_y \sin \theta & k\_z k\_y \left(1-\cos \theta\right) + k\_x \sin \theta & \cos \theta + k\_z^2\left(1-\cos \theta\right)
  \end{bmatrix}}$$
  
  So, to find your specific rotation matrix, you just need to substitute the values of your $k$ and $\theta$ in the above matrix.
  
  The derivation of this matrix can be found in section *9.2 Rotation Matrix Derivation* of the PhD thesis [*Modelling CPV* (2015)](https://dspace.lboro.ac.uk/dspace-jspui/handle/2134/18050), by Ian R. Cole. The basic idea of the derivation follows the following steps
  
  1. Rotate the given axis $k$ and the point $p$ (that you want to rotate) such that the axis $k$ lies in one of the coordinate **planes**: xy, yz or zx
  2. Rotate the given axis $k$ and the point $p$ (that you want to rotate) such that the axis $k$ is aligned with one of the two coordinate ***axes** for that particular coordinate **plane***: $x$, $y$ or $z$
  3. Use one of the [fundamental rotation matrix](https://en.wikipedia.org/wiki/Rotation_matrix) to rotate the point $p$ depending on the coordinate axis with which the rotation axis is aligned
  4. Reverse rotate the axis-point pair such that it attains the final configuration as that was in step 2 (that is, you have to undo step 2)
  5. Reverse rotate the axis-point pair which was done in step 1 (that is, you have to undo step 1)
  
  To show that a matrix is orthonormal, you need to show that it is [*orthogonal*](https://en.wikipedia.org/wiki/Orthogonal_matrix) (each row is independent of any other row and each column is independent of any other column) and that the length of each row (and column) is 1. Equivalently, a *square* matrix $Q$ is orthogonal if and only if
  
  $$
  Q^TQ = QQ^T = I
  $$
  
  where $Q^T$ is the [transpose](https://en.wikipedia.org/wiki/Transpose) of $Q$ and $I$ is the identity matrix. If you are really stuck, have a look at this proof <https://math.stackexchange.com/a/537248/168764> (and this other answer <https://math.stackexchange.com/a/156742/168764>), but, at this point, it should just be a matter of replacing $R\_k(\theta)$ in the equation above and check that the equation holds.
  
  
  ---
  
  