Decomposition of a Rotation Matrix

In summary, the author is having difficulty decomposing rotation matrices and needs help understanding how to derive the angles.
  • #1
QuickLoris
12
0
Hey guys! I'm new here, so forgive me if I'm posting in the wrong section.
I recently picked up a book on robotics and it had a section about rotation matrices. I'm having a difficult time with the decomposition of rotation matrices. Everywhere I look, I can find the the equations for the roll, pitch, and yaw, but there's never any derivation.

Can someone explain how you get them or point me in the direction of where I can learn?
 
Last edited:
Physics news on Phys.org
  • #2
QuickLoris said:
Hey guys! I'm new here, so forgive me if I'm posting in the wrong section.
I recently picked up a book on robotics and it had a section about rotation matrices. I'm having a difficult time with the decomposition of rotation matrices. Everywhere I look, I can find the the equations for the roll, pitch, and yaw, but there's never any derivation.

Can someone explain how you get them or point me in the direction of where I can learn?

Hey QuickLoris and welcome to the forums.

The basic idea for deriving these matrices has to do with with cos(x+y) = cos(x)cos(y) - sin(x)sin(y) and sin(x+y) = sin(x)cos(y) + cos(x)sin(y).

Now let's say we are rotating around the z-axis: the z co-ordinate won't change but the x and y probably will.

Define y = rsin(a) and x = rcos(a) where r is the length of the vector in 2D and a is the angle (decomposition into polar).

Now we give an angle b that we want to rotate around: our new rotated vector will be y' = rsin(a+b) and x' = rcos(a+b): we need to find x' and y' in terms of x and y.

Now expanding this out we get y' = rsin(a+b) = rsin(a)cos(b) + rcos(a)sin(b) and x' = rcos(a+b) = rcos(a)cos(b) - rsin(a)sin(b).

But y = rsin(a) and x = rcos(a) so substituting in we get:

y' = ycos(b) + xsin(b) and x' = xcos(b) - ysin(b)

In matrix form this gives us for x,y:

[cos(b) -sin(b)] [x] = [x']
[sin(b) cos(b)] [y] [y']

For 3D, we have the condition that the z point doesn't change since we are rotating about the z-axis so for this case we get:

[cos(b) -sin(b) 0]
[sin(b) cos(b) 0]
[ 0 0 1]

as our rotation matrix.

You can do the same thing for the other rotations in the x-z and y-z planes to get your other matrices.

To derive the general axis angle you do the same sort of thing.
 
  • #3
Thanks! That was very helpful.
I'm still wondering though, about how the angles are derived straight from the matrix. In the book it has the example of a global roll-pitch-yaw rotation matrix

GQB = QZ,γQY,βQX,α
=
[cβcγ -cαsγ+cγsαsβ sαsγ+cαcγsβ ]
[cβsγ cαcγ+sαsβsγ -cγsα+cαsβsγ ]
[-sβ cβsα cαcβ ]

Suppose that rij indicates the element of row i and column j of the roll-pitch-yaw rotation matrix, then the roll angle is:

α = tan-1(r32/r33)

the pitch angle is:
β = -sin-1(r31)

and the yaw angle is:
γ = tan-1(r31/r11)

I don't see the link between the roll-pitch-yaw angle equations and the elements of the matrix. In other words, why those elements?

My understanding is that the rows 1,2, and 3 correspond to the I, J, and K of the global frame and the columns correspond to i, j, and k or the local frame. But if we're looking at the angle for roll, why are we looking into the j and k components of the Z direction?

Should I look into a particular subject matter to understand these things?
 
  • #4
Derive the individual matrices and then multiply them together: I have derived one, but you can derive the rest through exactly the same ideas, with the note that you will rotate about the x-z and y-z planes.

Then do matrix multiplication in the order you have written above and compare the two results: basically you are composing functions by doing Q(x) then Q(y) and finally Q(z) [composition is right to left in terms the order of application]
 
  • #5
QuickLoris said:
Thanks! That was very helpful.
I'm still wondering though, about how the angles are derived straight from the matrix. In the book it has the example of a global roll-pitch-yaw rotation matrix

GQB = QZ,γQY,βQX,α
=
[cβcγ -cαsγ+cγsαsβ sαsγ+cαcγsβ ]
[cβsγ cαcγ+sαsβsγ -cγsα+cαsβsγ ]
[-sβ cβsα cαcβ ]
A word of caution: Your book must use a different convention than do I. For a roll-pitch-yaw (XYZ) sequence, I use
[tex]
\begin{bmatrix}
\cos\beta\cos\gamma &
\cos\alpha\sin\gamma+\sin\alpha\sin\beta\cos\gamma &
\sin\alpha\sin\gamma-\cos\alpha\sin\beta\cos\gamma \\
-\cos\beta\sin\gamma &
\cos\alpha\cos\gamma-\sin\alpha\sin\beta\sin\gamma &
\sin\alpha\cos\gamma+\cos\alpha\sin\beta\sin\gamma \\
\sin\beta &
-\sin\alpha\cos\beta &
\cos\alpha\cos\beta
\end{bmatrix}[/tex]
I'm not saying your book is wrong. It's just convention, the distinction boiling down to [itex]
\begin{bmatrix}\cos\theta & \sin\theta \\ -\sin\theta & \cos\theta
\end{bmatrix}[/itex] versus [itex]
\begin{bmatrix}
\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta
\end{bmatrix}
[/itex] Using my convention (I'll just make a mess of things if I use your book's convention), let's take a look at that roll/pitch/yaw sequence but treat the upper right 2x2 submatrix as noise:
[tex]\begin{bmatrix}
\cos\beta\cos\gamma & \cdots & \cdots \\
-\cos\beta\sin\gamma & \cdots & \cdots \\
\sin\beta & -\sin\alpha\cos\beta & \cos\alpha\cos\beta
\end{bmatrix}[/tex]
Here's my convention for a roll/yaw/pitch (XZY) sequence, reducing some of the elements to ellipses (...):
[tex]\begin{bmatrix}
\cos\beta\cos\gamma & \cdots & \cdots \\
-\sin\beta & \cos\alpha\cos\beta & \sin\alpha\cos\beta \\
\cos\beta\sin\gamma & \cdots & \cdots
\end{bmatrix}[/tex]
Finally, here's the astronomical ZXZ sequence:
[tex]\begin{bmatrix}
\cdots & \cdots & \sin\beta\sin\gamma \\
\cdots & \cdots & \sin\beta\cos\gamma \\
\sin\alpha\sin\beta & -\cos\alpha\sin\beta & \cos\beta
\end{bmatrix}[/tex]
Note that there is always some key row that involves just the first two angles of the sequence, a key column that involves the last two angles only, and a key element at the intersection of that key row and column that involves the middle angle only. The reason is pretty simple. When written as a product of three matrices, the leftmost matrix will always have one trivial row that comprises a one and two zeros, while the rightmost matrix will always have one trivial column that comprises a one and two zeros. The trivial row in the leftmost matrix and trivial column in the rightmost matrix dictate the key row, key column, and key element in the product. For example, for an XYZ sequence it is the third row, first column; for a XZY sequence it is the second row, first column; and for a ZXZ sequence it is the third row, third column. That key element is [itex]\sin\beta[/itex], [itex]-\sin\beta[/itex], or [itex]\cos\beta[/itex]. The first two pertain to aerodynamics sequences (XYZ, XZY, ...), the sign depending on whether the sequence is an even or odd permutation of XYZ. The value of [itex]\cos\beta[/itex] pertains to the six astronomical sequences (ZXZ, ...).
 
  • #6
Thanks to the both of you!
DH,your explanation was exactly what I was looking for!
Can you recommend a textbook (I'm guessing I need a general Linear Algebra book) so I can delve into the theory behind this kind of stuff? I really like knowing the details when it comes to things like this.
 
  • #7
A good book by all accounts (I haven't read it yet myself) is this: Quaternions and Rotation Sequences. It may be a bit too advanced at the moment. Keep it for later reference maybe, something to work toward!
 
  • #8
Thanks BackEMF, I added it to my shopping list.
 

What is decomposition of a rotation matrix?

The decomposition of a rotation matrix refers to breaking down a rotation matrix into its individual components, such as translation, rotation, and scale. It is a process commonly used in computer graphics and robotics to understand and manipulate the transformations of objects in a 3D space.

Why is decomposition of a rotation matrix important?

Decomposition of a rotation matrix allows for a better understanding and manipulation of the transformations applied to objects in a 3D space. It also enables the use of more efficient algorithms for calculations involving rotation matrices.

What are the different methods of decomposing a rotation matrix?

The two most commonly used methods for decomposing a rotation matrix are the Euler angles method and the quaternion method. The Euler angles method involves breaking down the rotation matrix into three separate rotations around the x, y, and z axes. The quaternion method represents a rotation using four parameters and is more efficient and less prone to singularities than the Euler angles method.

What are the applications of decomposition of a rotation matrix?

The decomposition of a rotation matrix has various applications in computer graphics, robotics, and engineering. It is used for animation, object manipulation, inverse kinematics, and navigation of robots, among others.

Is decomposition of a rotation matrix reversible?

Yes, the decomposition of a rotation matrix is reversible. It is possible to reconstruct a rotation matrix from its decomposed components using appropriate mathematical operations.

Similar threads

  • Linear and Abstract Algebra
Replies
2
Views
596
  • Mechanical Engineering
Replies
3
Views
451
  • Linear and Abstract Algebra
Replies
8
Views
1K
  • Linear and Abstract Algebra
Replies
6
Views
1K
  • Linear and Abstract Algebra
Replies
6
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
7
Views
2K
  • Linear and Abstract Algebra
Replies
8
Views
2K
Replies
5
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
1K
Back
Top