先转 X,再转 Y。
结果会一样吗?
Rotate X, then Y.
Does order matter?

三维旋转不满足交换律。不要先相信这句话——试着自己交换操作顺序,让矩阵和立方体一起变化。3D rotations do not generally commute. Don't take our word for it — swap the order and watch the matrices and the cubes change together.

设置两个旋转Set two rotations

90°
90°
试试特殊角度Try a special case

分步观察Walk through the rotation

第二步:左侧再绕 Y 轴,右侧再绕 X 轴。Step 2: left adds Y, right adds X.

先猜一下Predict first

交换顺序,结果会一样吗?Swap the order — same result?

交换顺序,观察差别Swap the order

01

先 X,后 YX first, then Y

浏览器无法显示三维画布,请查看下方坐标结果。Canvas unavailable; read the coordinates below.

初始正面 Z 轴指向Resulting front Z vector (0.00, -1.00, 0.00)

02

先 Y,后 XY first, then X

浏览器无法显示三维画布,请查看下方坐标结果。Canvas unavailable; read the coordinates below.

初始正面 Z 轴指向Resulting front Z vector (1.00, 0.00, 0.00)

对比结果The result

姿态差距Difference2.45

旋转矩阵间的 Frobenius 距离,范围 0–2.83(最大 2√2)。0 = 两种顺序的最终姿态相同;它不是角度。The Frobenius distance between the two final rotation matrices, range 0–2.83 (max 2√2). 0 = identical final orientation; it is not an angle.

02√2 ≈ 2.83

交换旋转顺序改变了最终姿态。观察立方体上不同颜色的面标记。Changing the order changes the final 3D orientation. Compare the labelled faces.

相关矩阵Rotation matrices

列向量;最右侧矩阵先作用Column vectors; rightmost matrix acts first

绕 X 轴Around X · RX(θX)
1.000.000.00
0.000.00-1.00
0.001.000.00
绕 Y 轴Around Y · RY(θY)
0.000.001.00
0.001.000.00
-1.000.000.00
先 X 后 YX then Y · RYRX
0.001.000.00
0.000.00-1.00
-1.000.000.00
先 Y 后 XY then X · RXRY
0.000.001.00
1.000.000.00
0.001.000.00
为什么会这样?展开数学解释Why? Read the mathematics

RY(θY) RX(θX) ≠ RX(θX) RY(θY)

三维旋转属于旋转群 SO(3)。矩阵作用在列向量上,右侧的操作先执行,因此「先 X 后 Y」对应 RY · RX。旋转的先后顺序通常不可交换;某些特殊角度(如其中一个为 0°)可能得到相同结果。Three-dimensional rotations form SO(3). With column vectors, the rightmost matrix acts first: X then Y means RY · RX. Order generally matters, although special cases (such as a zero angle) can coincide.

操作按固定的世界 X、Y 轴进行;画面中的彩色箭头和面标记代表立方体自身的局部坐标轴,会随物体转动。拖动只改变两侧共同的观察视角。Operations use fixed world X and Y axes. The colored arrows and face markers show the cube’s local axes, so they rotate with the object. Dragging changes only the shared camera.