Decomposition of a Rotation Matrix

Click For Summary

Discussion Overview

The discussion revolves around the decomposition of rotation matrices, particularly in the context of robotics. Participants explore the derivation of roll, pitch, and yaw angles from rotation matrices, as well as the conventions used in different texts regarding these matrices.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant expresses difficulty in finding derivations for roll, pitch, and yaw angles from rotation matrices.
  • Another participant provides a derivation of a rotation matrix for rotation around the z-axis, using trigonometric identities and matrix form.
  • Concerns are raised about the connection between the elements of a global roll-pitch-yaw rotation matrix and the angles derived from it, questioning why specific matrix elements correspond to roll, pitch, and yaw.
  • A suggestion is made to derive individual rotation matrices and multiply them to understand the composition of rotations.
  • One participant notes a difference in conventions used in their book compared to another participant's, highlighting how this affects the representation of rotation matrices.
  • Discussion includes the identification of key rows and columns in rotation matrices that relate to the angles in different rotation sequences.
  • A request for textbook recommendations is made, indicating an interest in further exploring the theoretical background of rotation matrices and linear algebra.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the derivation of angles from rotation matrices, with multiple viewpoints on conventions and interpretations of the matrix elements presented. The discussion remains unresolved regarding the best approach to understanding these concepts.

Contextual Notes

Participants mention varying conventions in literature regarding rotation matrices, which may lead to confusion in understanding the relationships between matrix elements and angles. There is also a lack of consensus on the derivation methods and the specific elements to focus on for roll, pitch, and yaw angles.

Who May Find This Useful

Readers interested in robotics, linear algebra, and the mathematical foundations of rotation matrices may find this discussion beneficial.

QuickLoris
Messages
12
Reaction score
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
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.
 
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?
 
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]
 
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}<br /> \cos\beta\cos\gamma &<br /> \cos\alpha\sin\gamma+\sin\alpha\sin\beta\cos\gamma &<br /> \sin\alpha\sin\gamma-\cos\alpha\sin\beta\cos\gamma \\<br /> -\cos\beta\sin\gamma &<br /> \cos\alpha\cos\gamma-\sin\alpha\sin\beta\sin\gamma &<br /> \sin\alpha\cos\gamma+\cos\alpha\sin\beta\sin\gamma \\<br /> \sin\beta &<br /> -\sin\alpha\cos\beta &<br /> \cos\alpha\cos\beta<br /> \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<br /> \end{bmatrix}[/itex] versus [itex] \begin{bmatrix}<br /> \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta<br /> \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}<br /> \cos\beta\cos\gamma & \cdots & \cdots \\<br /> -\cos\beta\sin\gamma & \cdots & \cdots \\<br /> \sin\beta & -\sin\alpha\cos\beta & \cos\alpha\cos\beta<br /> \end{bmatrix}[/tex]
Here's my convention for a roll/yaw/pitch (XZY) sequence, reducing some of the elements to ellipses (...):
[tex]\begin{bmatrix}<br /> \cos\beta\cos\gamma & \cdots & \cdots \\<br /> -\sin\beta & \cos\alpha\cos\beta & \sin\alpha\cos\beta \\<br /> \cos\beta\sin\gamma & \cdots & \cdots<br /> \end{bmatrix}[/tex]
Finally, here's the astronomical ZXZ sequence:
[tex]\begin{bmatrix}<br /> \cdots & \cdots & \sin\beta\sin\gamma \\<br /> \cdots & \cdots & \sin\beta\cos\gamma \\<br /> \sin\alpha\sin\beta & -\cos\alpha\sin\beta & \cos\beta<br /> \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, ...).
 
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.
 
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!
 
Thanks BackEMF, I added it to my shopping list.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K