Is there any intuition why rotational matrices are not commutative? I assume the final rotation is the combination of all rotations. Then how does it matter in which order the rotations are applied?

3I can only guess what your second sentence means. $\qquad$ – Michael Hardy Nov 16 '16 at 15:59

25Two rotations in the plane are indeed commutative. However two rotations in 3d space are not commutative. – vadim123 Nov 16 '16 at 16:01

In 3D space why they are not commutative? – Navin Prashath Nov 16 '16 at 16:02

39It might help to pick up a die and try rotating it in different directions. It helped me greatly. – Riccardo Orlando Nov 16 '16 at 16:02

Great.. I tried now and helped me too..Thanks – Navin Prashath Nov 16 '16 at 16:04

28I always find these “why do $XYZ$ not have property $PQR$” kind of questions strange. Why _would_ rotations be commutative? Ab initio, there's no reason to assume any sort of mapping to be commutative. Certain mappings, like 2D rotations, happen to have this property; that's then surprising and warrants questions as to the intuition behind it. But by default, I'd always assume that any property you could ask for is _not_ fulfilled by a given object. – leftaroundabout Nov 16 '16 at 17:32

An excellent question. This confused the crap out of me when I first was learning OpenGL. – Ashwin Gupta Nov 17 '16 at 05:02

51Find a bed. Stand at the foot of the bed. Fall forward onto the bed and then turn 90 degrees to your left.. Now stand at the foot of the bed again. Turn 90 degrees to your left and fall forward onto the floor. You made the same two rotations in two different orders, so why didn't you end up in the same place? – Eric Lippert Nov 17 '16 at 07:18

3@leftaroundabout quite. The answers given so far include many nice demonstrations *that* rotations are not commutative, but that's not what's been asked. I'm not sure what *kind* of answer could usefully answer the question asked here. "Why don't multiplication and addition on the integers commute?"  well... because they don't. – AakashM Nov 17 '16 at 12:15

2@AakashM Multiplication and addition do commute in the sense that $xy=yx$ and $x+y=y+x$. But I think I know what you mean, if one operation is "multiply by $m$", and another is "add $a$", we have $xm+a \ne (x+a)m$ in general. – Jeppe Stig Nielsen Nov 17 '16 at 12:33

2@EricLippert Your description is quite evocative and goes to the heart of the question of why one should expect commutation in the first place. However it has a minor flaw in the sense that it assumes the "same rotation" is the one that looks the same from the object being rotated; I think the usual convention is that a rotation is identified by an axis fixed _in space_ and and angle around it. When I was a kid I thought noncommutativity is related to the ambiguity of what the same rotation is (and in a sense it is), and that it might go away with the proper point of view (but no, it won't). – Marc van Leeuwen Nov 17 '16 at 17:11

1... With the "in a sense it is", I mean noncommutativity is directly related to the conjugate of some transformation $T$ by another transformation $S$ differing from $T$. – Marc van Leeuwen Nov 17 '16 at 17:14

@AakashM: I fully agree with leftaroundabout's comment that we shouldn't expect any property unless there is some good reason, and rather should expect any 'nice' property to be due to some underlying reason. However, to me it's not enough to say "no it's just like that", which is why in my answer I attempt to elucidate a core structure in the group of 3d rotations that is noncommutative. In fact it's literally the minimal noncommutative group, though not every noncommutative structure has an embedding of it. – user21820 Nov 20 '16 at 07:08

Also, Dan Uznanski's answer provides another perspective when we restrict our focus to matrix transformations, so that we can explain the distinction between 2 and 3 dimensions. – user21820 Nov 20 '16 at 07:11

The true origin of the idiom _got up on the wrong side of the bed!_ :) – Qmechanic May 18 '17 at 14:07
9 Answers
Here is a picture of a die:
Now let's spin it $90^\circ$ clockwise. The die now shows
After that, if we flip the left face up, the die lands at
Now, let's do it the other way around: We start with the die in the same position:
Flip the left face up:
and then $90^\circ$ clockwise
If we do it one way, we end up with $3$ on the top and $5, 6$ facing us, while if we do it the other way we end up with $2$ on the top and $1, 3$ facing us. This demonstrates that the two rotations do not commute.
Since so many in the comments have come to the conclusion that this is not a complete answer, here are a few more thoughts:
 Note what happens to the top number of the die: In the first case we change what number is on the left face, then flip the new left face to the top. In the second case we first flip the old left face to the top, and then change what is on the left face. This makes two different numbers face up.
 As leftaroundabout said in a comment to the question itself, rotations not commuting is not really anything noteworthy. The fact that they do commute in two dimensions is notable, but asking why they do not commute in general is not very fruitful apart from a concrete demonstration.
 187,016
 14
 158
 288

21I've always used a book as an example, but I think a die is way better. $+1$! – Cameron Williams Nov 16 '16 at 16:21

2

See my answer for a very concrete analysis of the 90degree rotations. =) – user21820 Nov 17 '16 at 07:17

7

@CameronWilliams Here is a picture with a rotated book, with explanations in the picture: [https://universereview.ca/I1518nonAbelian.jpg](https://universereview.ca/I1518nonAbelian.jpg) – Jeppe Stig Nielsen Nov 17 '16 at 12:11



@kleineg Kaladesh prerelease required multiplie dice for each player. I decided that I didn't want to rely on my neighbours during the games. – Arthur Nov 17 '16 at 15:28

3While an excellent illustration of the problem. It doesn't help me really understand how to think about this. I've been perplexed by this conundrum more than once and I still don't have an intuitive way to reason about it. That's what I'd like to know. What reference is changing and how? – John Leidegren Nov 18 '16 at 12:27

@JohnLeidegren How about just focusing on which number ends up on the top? In both cases, that's the same as the number that was flipped up from the left face (since the clockwise rotation doesn't change the top number). In the second case, that's the number that _started_ on the left face, while in the first case we first change what face is on the left before turning it up. – Arthur Nov 18 '16 at 12:34

@Arthur Is it commutative for rotations in a plane? Rubik's Cube would have been so easy to solve if rotations are commutable, right? – Narasimham Nov 20 '16 at 09:04

@Narasimham Yes, rotations in a plane commute, because there it's basically just addition of angles. – Arthur Nov 20 '16 at 09:50

36I have no idea really why this answer was accepted. It does not answer the question of *Why* this happens, it only confirms *that* it happens. The question clearly suggests that the OP knows *that* it happens. – AnoE Nov 20 '16 at 10:32

9

2@Arthur OK, in 3D why is it not so.. is still elusive. Hamilton invented quarternions are not commutative either, https://www.quora.com/Whyisntquaternionmultiplicationcommutative – Narasimham Nov 20 '16 at 15:58

3

I guess the reason why rotations in 3d are not commutative is really the wrong question  you shouldn't expect things to commute. There isn't a reason why 3d rotations *should* commute, so they don't. Nice demonstration :) – Dark Malthorp Oct 13 '20 at 13:03

1Here's my intuition: Assume the 3D shape you are rotating has 3 levers attached: red lever along the x axis, green along the y axis, and blue along the zaxis. Any 3D rotation can be made by rotating (say clockwise) the red lever by alpha, the green by beta, and the blue by gamma. This description is commutative  it doesn't matter in which order you rotate the levers, because we assume that *the other two levers will move with the shape*. BUT with the matrix rotation the levers don't move with the shape. They stay fixed in the original coordinate system. – Jonathan Jan 24 '21 at 23:35
Matrices commute if they preserve each others' eigenspaces: there is a set of eigenvectors that, taken together, describe all the eigenspaces of both matrices, in possibly varying partitions.
This makes intuitive sense: this constraint means that a vector in one matrix's eigenspace won't leave that eigenspace when the other is applied, and so the original matrix's transformation still works fine on it.
In two dimensions, no matter what, the eigenvectors of a rotation matrix are $[i,1]$ and $[i,1]$. So since all such matrices have the same eigenvectors, they will commute.
But in three dimensions, there's always one real eigenvalue for a real matrix such as a rotation matrix, so that eigenvalue has a real eigenvector associated with it: the axis of rotation. But this eigenvector doesn't share values with the rest of the eigenvectors for the rotation matrix (because the other two are necessarily complex)! So the axis is an eigenspace of dimension 1, so rotations with different axes can't possibly share eigenvectors, so they cannot commute.
 9,478
 2
 19
 35

12I like this answer. Unlike the highest voted one (which, at the time of writing, has nearly 100 votes), which merely illustrates that 3D rotations are indeed noncommutative, this answer at least attempts to explain **why** they are noncommutative from a higher perspective. In fact, as opposed to the OP's claim, rotation matrices **are** commutative  provided that we are talking about rotations on the $xy$plane, and that's exactly because all those rotations share a common axis (the $z$axis). 3D rotations have different axes and hence they are not commutative. – user1551 Nov 19 '16 at 09:27

1

2

@Widawensen It's really intuitive if you watch this [video](https://www.youtube.com/watch?v=PFDu9oVAEg) first. – Neil G Dec 13 '16 at 07:17

@user1551 Lately I have discovered one thing, excuse me that I have some doubts about the last statement in the answer and returned to it. According to the last statement it is not possible to commute for matrices with different axes? But there is at least one case of commutation for matrices with different axes  take two matrices of rotations by $\pi$ about axes, say, $x$ and $y$ respectively. If we write down explicit forms of these matrices we see that they are both **diagonal** so they have to commute. – Widawensen Jan 11 '19 at 09:48

This is true: a half turn will commute with another half turn whose axes are orthogonal to each other; this is because the offaxis eigenvalues become equal to each other (and also 1) and the plane that the axis is normal to joins the eigenspace. – Dan Uznanski Jan 11 '19 at 09:52

@DanUznanski Thank you for the confirmation, I think that this is **the only** possible case when rotations with different ( orthogonal axes to each other, rotations by $\pi$) axes commute, do you agree with me? – Widawensen Jan 11 '19 at 09:55

Yeah. Well, that and the trivial rotation, which is the identity matrix, but that hardly bears mentioning. – Dan Uznanski Jan 11 '19 at 09:57

@DanUznanski BTW, your answer is completely in spirit of linear algebra, so it would be useful to add 'linear algebra' tag into question, what do you think? – Widawensen Jan 14 '19 at 12:51
In 3D space why they are not commutative?
Because you can exhibit two rotations $a,b$ such that $a\circ b\neq b\circ a$.
Take, for example, $a$ to be a rotation of $90$ degrees counterclockwise around the $x$ axis and $b$ to be a rotation of $90$ degrees counterclockwise around the $y$ axis.
Doing $a\circ b$ maps the $x$ axis onto the $y$ axis, but $b\circ a$ maps the $x$axis onto the $z$ axis.
 141,564
 15
 151
 364

5This answers, like others, also just says *that* it happens, not *why*. The first sentence translates the informal question into the mathematical definition of commutativeness, the second is an example. – AnoE Nov 20 '16 at 10:34

4@AnoE and there's a reason for what you're seeing across the board: there isn't much else you do. Consider: given some random nonabelian group, someone asks "why is it nonabelian?" Well? Where's the deep explanation? The slight difference here is that it involves a group we have a lot of geometric experience with, and so maybe the eigenvalue answer is another good explanation. – rschwieb Nov 20 '16 at 12:01
Here is a pictorial explanation equivalent to Arthur's answer:
(Picture source: Benjamin Crowell, General Relativity, p. 256.)
 9,814
 2
 36
 95
Imagine yourself walking a narrow bridge across a deep canyon. You stop and rotate face down onto the bridge, then rotate on your side to watch the beautiful sunset at the far end of the valley. By that time, however, someone who would have done the very same rotations, only in the opposite order, would be lying face down at the bottom of the canyon.
 68,892
 6
 58
 112

I'm not sure whether you mean the 'very same rotations' relative to your body, or relative to the landscape? – jwg Nov 18 '16 at 15:48

3@jwg You can think of it either way. In the end the only difference is which side of the bridge one falls off of. – dxiv Nov 18 '16 at 17:48
Consider the group of permutations of 3 objects in a line as generated by two 'rotations' $r,s$, where $r$ swaps the first two in the line and $s$ swaps the last two in the line.
$r(1,2,3) = (2,1,3)$.
$s(1,2,3) = (1,3,2)$.
Note that $rs \ne sr$ since:
$rs(1,2,3) = (3,1,2)$.
$sr(1,2,3) = (2,3,1)$.
Now you may ask, what has this got to do with 'real rotations' in space? In fact this is precisely the same phenomenon as the dice example given by Arthur. The 3 objects are the 3 orthogonal (undirected) axes that are perpendicular to the faces, and the two rotations mentioned indeed swap different pairs of axes!

1Just to be clear: this is an analysis of the axes of my die _without signs / direction_. You could include signs and make it $r(1, 2, 3) = (2, 1, 3)$ and $s(1, 2, 3) = (1, 3, 2)$. You would get something that is more directly relatable to a die. That doesn't change your analysis, though. – Arthur Nov 17 '16 at 09:02

@Arthur: Yeap that's why I wrote "undirected". Indeed one could use sign to indicate direction, or simply change to permutation of 6 axes/faces, as you say, but I wanted to give the simplest possible group representation of the visual analysis. One can learn a lot from a simple cube. =) – user21820 Nov 17 '16 at 09:05

@user21820 I like your argumentation. However it would be clearer if you presented the whole table for all cases not only (1,2,3) ( although you defined it with the words) – Widawensen Nov 25 '16 at 18:44

@Widawensen: Yea I should have used "a,b,c" instead of "1,2,3" in the first orange box, but never mind I think it's clear enough anyway. =) – user21820 Nov 26 '16 at 01:29

@user21820 .. and one more remark.. permutations are illustrations of rotations about current axes, not fixed axes ..am I right ? If so is it possible to use them also for fixed axes..? – Widawensen Nov 26 '16 at 04:01

@Widawensen: Well my last sentence was supposed to be about that. If you treat each axis as simply a line (with no direction), then indeed any of the 90degree rotations about an axis will swap the other two axes. If you split each of these lines into two axes pointing in opposite direction, then each of those rotations would be a 4cycle rather than a swap. – user21820 Nov 26 '16 at 05:49
Picture the $x$, $y$, and $z$axes in the positions in which they are conventionally drawn.
Rotate a cube $90^\circ$ counterclockwise with the $x$axis as the axis of rotation.
Then rotate it $90^\circ$ counterclockwise with the $y$axis as the axis of rotation.
After those two rotations, the $x$axis now points in the negative$z$ direction, the $z$axis in the negative$y$ direction, and the $y$axis in the positive$x$ direction.
Now do the same two rotations in the opposite order. You'll get a different result.
Here it is essential that the two axes about which we rotated were different. Rotations in $3$dimensional space that are both about the same axis commute with each other.
 1
 30
 276
 565
I'm discussing here noncommutativity of rotations made about current axes..
Rotations in 3d are non commutative because rotation changes direction of every potential other axis except itself (unlike in 2d where it is nothing to change because it is only one "axis" of rotation  it can be reduced in 3D to rotation about Z axis ).
Denote succession of rotations about Zaxis as $Z_1, Z_2,... Z_n$ (it's convenient to imagine that there is multitude of them by a small angular increment let's say $1^\circ$ or $2^\circ$ ) and one rotation about different axis $X$ ( it can be also not very big). When we have only rotations $..Z_j...$ we can change order of rotations in any way  the result will be the same.
But if we insert rotation $\mathbf{X}$ somewhere into middle of rotations succession $Z_1,{Z_2}...{Z_n}$ the final result $Z_1,{z_2}...{Z_j}{\mathbf{X}} {Z_k}...{Z_n}$ now depends on which place we inserted it because inserting it means that we are changing current axis of rotations for all successive rotations Z  the current Z axis, after this operation, is changed in the global frame.
It could be seen the other effect of inserting X rotation into different places of succession of $ Z_i $ if we would track the end of X versor (vector $i$) :
 If this X rotation is made at the beginning the plane XY constant in current frame for Z rotations is changed and the endpoint of X axis is distancing itself from original XY plane with every successive incremental rotation about changed now Zaxis.
If it would be made at the end, the distance from original XY plane still would be equal $0$ !
As the versors $i,j,k$ after whole linear operation represents the resulting matrix we clearly see that these two operations are quite different. Graphically one can imagine this track of the endpoint of $X$ versor on the surface of the unit sphere.
The simplest alternative presentation of noncommutativity in 3D (approach here is more algebraic than geometric as previous one) can be made using axis unit vector $v_1$ of rotation, say, $R_1$.
($R_2$, we assume, has different axis with vector $v_2 \ne v_1$ and moreover we assume $R_2(v_1) \ne v_1$ which together with $R_2(v_1) \ne v_1$ states that transformed by $R_2$ vector $v_1$ is not lying in the axis of $R_1$).
Apply it to $R_2R_1(v_1)=R_2(v_1) = v_{21}$. (Obviously $v_{21} \ne v_1$).
In reverse order $R_1R_2(v_1)=R_1(v_{21} )$.
But $v_{21} $ is not lying in the axis of $R_1$ !
Hence the result must be different than $v_{21}$ and $R_1R_2 \ne R_2R_1$.
They commute only if they share common axis or in the case of different axes they preserve each other axes with result vector changing sign i.e. $R_2(v_1)=v_1$ and $R_1(v_2)=v_2$ what is possible when $v_1$ is orthogonal to $v_2$ and rotations are by $\pi$ angle.
 7,564
 5
 33
 62

I will add in comment some short proof of orthogonality for vectors $v$ and $u$ (which is related to discussed above problem) in the case when we have $Rv=v$ and $Ru=u$. Calculating $v^Tu$ we obtain $v^Tu= (Rv)^T(Ru)=v^TR^TRu=v^Tu$, hence $v^Tu=0$. – Widawensen Jan 11 '19 at 10:58
Many comments on the original post pondered if this is a good question because "why should we expect them to be commutative in the first place?"
I think it's a great question for the following reason. One major purpose of science is to make what seems mysterious intuitive. Diseases aren't actually caused by things we can't hope to understand like the whim of the gods or "bad humors in the blood." Heavier objects fall more quickly because of air resistance, not gravity. The goal is prediction, but one result is increased intuition.
Let's take the last example. Someone who had never heard of Galileo and the Tower of Pisa, had never heard of physics, etc. could very easily ask the question "is there any reason why in a vacuum all objects should fall at the same rate [i.e. accelerate the same]?" One could replay "well, what reason would you have for it being any other way?" Philosophically true, but not helpful.
The reason this example isn't intuitive is that we never experience this "same rate" phenomenon in everyday life. Heavier things pull us down more, are better at holding things in place, etc. So it's more intuitive that they should fall faster. You see where I'm going with this.
Another great example from physics would be momentum. When have you ever pushed something and it goes forever?
So looking at some of the examples that others have given demonstrating that rotations don't commute, it's interesting to think about why the fact does not become intuitive given how often we manipulate objects in 3d space?
So, let's address the question:
Is there any intuition why rotational matrices are not commutative? I assume the final rotation is the combination of all rotations. Then how does it matter in which order the rotations are applied?
While we manipulate objects in 3D all day long, we don't do that nearly as much as in 2D. We mostly work on surfaces (counters, workbenches, floors, walls, etc.). In that context, rotations do commuteorder does not matter.
Most objects we actually use in 3D are so asymmetrical and directed that we never have to consider compound rotations. A fork has only one way to hold it that makes sense. If you want to use it, you grab the handle and point the tines downward. You don't sit there doing compound rotations on it. When was the last time you manipulated a die or a book or a bed by doing compound rotations? I usually just lay a book down with the cover facing up, the binding on the left, and open it. I don't often rotate my bed and fall forward onto it :) So what experiences would have given me a chance to build intuition
There are some situations where we might actually consider compound rotations, such as moving furniture and loading it into a truck with our partner. If you have a romantic partner and have ever moved furniture and loaded it into a truck, you will agree that this is not exactly an intuitionbuilding experience.
For someone who assembles machinery or puts together pipe fittings, it may be extremely intuitive that rotations do not commute. If you asked a person in such a field "if I rotate this 3say plumbing fitting vertically and then horizontally vs the opposite way, will it end up in the same orientation," and they weren't too busy working to answer your question, they would likely know the correct answer.
To summarize, the noncommutativity of compound rotations is not intuitive because we just don't have a lot of life experiences where it is important or useful. Meanwhile, noncommutative operations are VERY familiar to us (just think about it). So if you go through a number of the exercises others have shown above, you will soon find that it is indeed very intuitive.
 448
 3
 12