3. Rotation Matrix About an Arbitrary Axis
To perform a rotation about an arbitrary axis through the origin, OXYZ is taken to be the fixed frame. A mobile coordinate frame OABC is rotated through the origin \(O\) about a vector \(V = (x,y,z)\) with components \(V_x, V_y, V_z\). The arbitrary axis can be written as \(V = V_xi + V_yj + V_zk\). The rotation matrix \(R(V, O)\) comprises the following steps as illustrated by Figure 5.
-
A rotation by angle \(\alpha\) about x-axis
-
A rotation by angle \(-\beta\) about y-axis
-
A rotation by angle \(\theta\) about z-axis
-
A rotation by angle \(\beta\) about y-axis
-
A rotation by angle \(-\alpha\) about x-axis
This rotation, \(R(V, O)\), may be summarized as \(R(V, O) = R(x,-\alpha) R(y,\beta) R(z,\theta) R(y,-\beta) R(x,\alpha)\). |
The resultant rotation matrix about \(V\) is \(R(V, O)\)
Let
From the geometry of Figure 5 it follows that,
\[\begin{align}
\mathrm{R}(\mathrm{V}, O) &= \left[\begin{array}{ccc}\mathrm{V}_{x}^{2}(1-c \theta)+c \theta, & \mathrm{V}_{x} \mathrm{~V}_{y}(1-c \theta)-\mathrm{V}_{z} s \theta, & \mathrm{V}_{x} \mathrm{~V}_{z}(1-c \theta)+\mathrm{V}_{y} s \theta \\\mathrm{V}_{x} \mathrm{~V}_{y}(1-c \theta)+\mathrm{V}_{z} s \theta, & \mathrm{V}_{y}^{2}(1-c \theta)+c \theta, & \mathrm{V}_{y} \mathrm{~V}_{z}(1-c \theta)-\mathrm{V}_{x} s \theta \\\mathrm{V}_{x} \mathrm{~V}_{z}(1-c \theta)-\mathrm{V}_{y} s \theta, & \mathrm{V}_{y} \mathrm{~V}_{z}(1-c \theta)+\mathrm{V}_{x} s \theta, & \mathrm{V}_{z}^{2}(1-c \theta)+c \theta\end{array}\right] \\
\mathrm{R}(\mathrm{V}, O) &= \left[\begin{array}{ccc}\mathrm{V}_{x}^{2}T+C, & \mathrm{V}_{x} \mathrm{~V}_{y}T-\mathrm{V}_{z} S, & \mathrm{V}_{x} \mathrm{~V}_{z}T+\mathrm{V}_{y} S \\\mathrm{V}_{x} \mathrm{~V}_{y}T+\mathrm{V}_{z} S, & \mathrm{V}_{y}^{2}T+C, & \mathrm{V}_{y} \mathrm{~V}_{z}T-\mathrm{V}_{x} S \\\mathrm{V}_{x} \mathrm{~V}_{z}T-\mathrm{V}_{y} S, & \mathrm{V}_{y} \mathrm{~V}_{z}T+\mathrm{V}_{x} S, & \mathrm{V}_{z}^{2}T+C\end{array}\right] \\
\mathrm{R}\left(\mathrm{V}, O\right) &= \left[\begin{array}{lll}n_{x} & s_{x} & q_{x} \\n_{y} & s_{y} & q_{y} \\n_{z} & s_{z} & q_{z}\end{array}\right] \\
& \text { where, } \quad C =\cos \theta \text {, } \quad S =\sin \theta \text {, } \quad T = (1-cos \theta) \text{ .}
\end{align}\]
We need to use the components of vector V about the principal axes of the OXYZ frame.
\[\begin{align*}
V_{x} = \frac{x}{\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}} \text {, } V_{y} = \frac{y}{\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}} \text {, } V_{z} = \frac{z}{\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}}
\end{align*}\]
|
3.1. Rotation About an Arbitrary Axis Through the Origin
Example 1 |
|
Compute the rotation matrix to represent a rotation of \(90^o\) about an arbitrary vector \(V = (2, 2, 2)^T\). |
Solution:
\[ \begin{aligned}
& V_{x} = \frac{2}{2\sqrt{3}}, V_{y}=\frac{2}{2\sqrt{3}} \text {, and } V_{z}=\frac{2}{2\sqrt{3}} \\
\end{aligned}\]
\[ \begin{aligned}
& C =\cos(90) = 0 \text {, } \quad S =\sin(90) = 1 \text {, } \quad T = (1-cos(90)) = 1 \\
& n_{x}=\mathrm{V}_{x}^{2}T+C=\left(\frac{2}{(2\sqrt{3})}\right)^2(1)+0=\frac{1}{3} \\
& n_{y}=\mathrm{V}_{x} \mathrm{~V}_{y}T+\mathrm{V}_{z} S=\frac{2}{2\sqrt{3}} \cdot \frac{2}{2\sqrt{3}}(1)+\frac{2}{2\sqrt{3}}(1)= \frac{1 + \sqrt{3}}{3} \\
& n_{z}=\mathrm{V}_{x} \mathrm{~V}_{z}T-\mathrm{V}_{y} S=\frac{2}{2\sqrt{3}} \cdot \frac{2}{2\sqrt{3}}(1)-\frac{2}{2\sqrt{3}}(1)= \frac{1 - \sqrt{3}}{3} \\
& s_{x}=\mathrm{V}_{x} \mathrm{~V}_{y}T-\mathrm{V}_{z} S=\frac{2}{2\sqrt{3}} \cdot \frac{2}{2\sqrt{3}}(1)-\frac{2}{2\sqrt{3}}(1)= \frac{1 - \sqrt{3}}{3} \\
& s_{y}=\mathrm{V}_{y}^{2}T+C=\left(\frac{2}{(2\sqrt{3})}\right)^2(1)+0= \frac{1}{3} \\
& s_{z}=\mathrm{V}_{y} \mathrm{~V}_{z}T+\mathrm{V}_{x} S=\frac{2}{2\sqrt{3}} \cdot \frac{2}{2\sqrt{3}}(1)+\frac{2}{2\sqrt{3}}(1)= \frac{1 + \sqrt{3}}{3} \\
& q_{x}=\mathrm{V}_{x} \mathrm{~V}_{z}T+\mathrm{V}_{y} S=\frac{2}{2\sqrt{3}} \cdot \frac{2}{2\sqrt{3}}(1)+\frac{2}{2\sqrt{3}}(1)= \frac{1 + \sqrt{3}}{3} \\
& q_{y}=\mathrm{V}_{y} \mathrm{~V}_{z}T-\mathrm{V}_{x} S=\frac{2}{2\sqrt{3}} \cdot \frac{2}{2\sqrt{3}}(1)-\frac{2}{2\sqrt{3}}(1)= \frac{1 - \sqrt{3}}{3} \\
& q_{z}=\mathrm{V}_{z}^{2}T+C=\left(\frac{2}{(2\sqrt{3})}\right)^2(1)+0= \frac{1}{3} \\
\end{aligned}\]
\[ \mathrm{R}\left(\mathrm{V}, 90^{\circ}\right)=\left[\begin{array}{ccc}
\frac{1}{3} & \frac{1 - \sqrt{3}}{3} & \frac{1 + \sqrt{3}}{3} \\
\frac{1 + \sqrt{3}}{3} & \frac{1}{3} & \frac{1 - \sqrt{3}}{3} \\
\frac{1 - \sqrt{3}}{3} & \frac{1 + \sqrt{3}}{3} & \frac{1}{3}
\end{array}\right]\]
|
The following is a Python code implementation of the above calculation (Click to reveal). This code implementation provides 3 outputs: a matrix in surd form, 4 decimal numerical values, and a latex format.
|
3.2. Rodrigues' Rotation Formula
An alternative would be to use Rodrigues' Rotation Formula (Rodrigues’ Rotation Formula – from Wolfram MathWorld, n.d.), which is similar to the derived matrix above. It is important to note that the Rodrigues formula only works for rotations about an axis through the origin.
\[\begin{align}
\mathrm{R}(\mathrm{V}, O) &= e^{W\theta} \\
& = I + W \sin(\theta) + W^2(1-\cos(\theta))\\
& \text{where, }\\
I &= 3 \times 3 \text{ identity matrix } \\
W &= \left[\begin{matrix}0 & -V_z & V_y\\V_z & 0 & -V_x\\-V_y & V_x & 0\end{matrix}\right]
\end{align}\]
|
The following is a Python code implementation of the above calculation (Click to reveal). This code implementation provides 3 outputs: a matrix in surd form, 4 decimal numerical values, and a latex format.
|
Example 2 |
|
Compute the rotation matrix to represent a rotation of \(80^o\) about an arbitrary vector \(V = (2, 3, 4)^T\). |
Solution:
\[ \begin{aligned}
& V_{x}=\frac{2\sqrt{29}}{29}, V_{y}=\frac{3\sqrt{29}}{29} \text {, and } V_{z}=\frac{4\sqrt{29}}{29} \\
& C =\cos(80) = 0.1736 \text {, } \quad S =\sin(80) = 0.9848 \text {, } \quad T = (1-cos(80)) = 0.8264 \\
& n_{x}=\mathrm{V}_{x}^{2}T+C=\left(\frac{2\sqrt{29}}{29}\right)^2(0.8264)+0.1736= 0.2876 \\
& n_{y}=\mathrm{V}_{x} \mathrm{~V}_{y}T+\mathrm{V}_{z} S=\frac{2\sqrt{29}}{29} \cdot \frac{3\sqrt{29}}{29}(0.8264)+\frac{4\sqrt{29}}{29}(0.9848)= 0.9025 \\
& n_{z}=\mathrm{V}_{x} \mathrm{~V}_{z}T-\mathrm{V}_{y} S=\frac{2\sqrt{29}}{29} \cdot \frac{4\sqrt{29}}{29}(0.8264)-\frac{3\sqrt{29}}{29}(0.9848)= -0.3206 \\
\end{aligned}\]
\[ \begin{aligned}
& s_{x}=\mathrm{V}_{x} \mathrm{~V}_{y}T-\mathrm{V}_{z} S=\frac{2\sqrt{29}}{29} \cdot \frac{3\sqrt{29}}{29}(0.8264)-\frac{4\sqrt{29}}{29}(0.9848)= -0.5605 \\
& s_{y}=\mathrm{V}_{y}^{2}T+C=\left(\frac{3\sqrt{29}}{29}\right)^2(0.8264)+0.1736= 0.4301 \\
& s_{z}=\mathrm{V}_{y} \mathrm{~V}_{z}T+\mathrm{V}_{x} S=\frac{3\sqrt{29}}{29} \cdot \frac{4\sqrt{29}}{29}(0.8264)+\frac{2\sqrt{29}}{29}(0.9848)= 0.7077 \\
& q_{x}=\mathrm{V}_{x} \mathrm{~V}_{z}T+\mathrm{V}_{y} S=\frac{2\sqrt{29}}{29} \cdot \frac{4\sqrt{29}}{29}(0.8264)+\frac{3\sqrt{29}}{29}(0.9848)= 0.7766 \\
& q_{y}=\mathrm{V}_{y} \mathrm{~V}_{z}T-\mathrm{V}_{x} S=\frac{3\sqrt{29}}{29} \cdot \frac{4\sqrt{29}}{29}(0.8264)-\frac{2\sqrt{29}}{29}(0.9848)= -0.0238 \\
& q_{z}=\mathrm{V}_{z}^{2}T+C=\left(\frac{4\sqrt{29}}{29}\right)^2(0.8264)+0.1736= 0.6295 \\
\end{aligned}\]
\[ \mathrm{R}\left(\mathrm{V}, 80^{\circ}\right)=\left[\begin{array}{ccc}
0.2876 & -0.5605 & 0.7766 \\
0.9025 & 0.4301 & -0.0238 \\
-0.3206 & 0.7077 & 0.6295
\end{array}\right]\]
|
The following is a Python code implementation of the above calculation (Click to reveal). This code implementation provides 3 outputs: a matrix in surd form, 4 decimal numerical values, and a latex format.
|
The formula for calculating the unit vector in the direction of a vector \(V = (x,y,z)\) is:
\(\text{unit_vector} = V / |V|\)
where \(|V|\) is the magnitude of the vector \(V\).
This formula is equivalent to:
\(\text{unit_vector} = (x/magnitude, y/magnitude, z/magnitude)\)
where \(\text{magnitude} = sqrt(x^2 + y^2 + z^2)\).
The formula for calculating the components of a vector V = (x,y,z) about the principal axes is:
The formulas for calculating the unit vector and the components of a vector about the principal axes may seem similar, but they are actually solving different problems.
The unit vector formula normalizes the vector to have a magnitude of 1, preserving the direction of the vector but setting the magnitude to 1. This allows for easier comparison of vectors, as the magnitude is not a factor.
On the other hand, the formula for calculating the components of a vector about the principal axes projects the vector onto each axis and divides by the magnitude of the vector. This allows for the vector to be described in terms of its position along each axis, rather than its direction.
The components of a vector about the principal axes can be used to represent the orientation of a vector in 3D space. This orientation can then be used to determine the axis of rotation and the angle of rotation, which are needed to calculate a rotation matrix using the above formulas.
Add Comment
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Comments (4)
Using the knowledge of spatial mechanics and computer programming introduced in this course, you can go on to perform advanced kinematic analysis of 3D mechanisms.
These skills apply to robotics systems design, research, and development.
The notes are on point. I've gained alot of skill and visualization from the unit.
Does it mean the inverse of a 3x3 matrix same as its transpose
In spatial mechanics, the inverse and transpose of a 3x3 matrix are not the same, but they can be related in specific cases. The inverse (A⁻¹) is a matrix that, when multiplied by A, results in the identity matrix (A * A⁻¹ = I). The transpose (Aᵀ) is obtained by interchanging the rows and columns of A.
For 3x3 orthogonal matrices, often used to represent rotations, the transpose is equal to the inverse (A⁻¹ = Aᵀ) because they satisfy Aᵀ * A = I. This property is unique to orthogonal matrices, and for general 3x3 matrices, the inverse and transpose are not the same.