Rigid transformations: one pose, several coordinate systems
刚体变换
Represent, compose and invert rigid-body poses with rotation and homogeneous matrices, convert between axis-angle, Euler angles and unit quaternions, and recognise where each representation breaks.
rigid-transformationsWhere is the gripper, and which way is it turned?
Robot grippers, drone cameras and animated objects all raise the same question: where is the body, and how is it turned? For a rigid body, the distances between its points never change, so describing a handful of points is enough. Lynch and Park count the degrees of freedom step by step: three coordinates fix a first point, two angles fix a second point at a known distance, and one angle fixes a third. A rigid body has six in space and three in the plane. Configuration space
Six numbers are not yet a good working representation. We also need to combine poses (“the camera relative to the gripper, the gripper relative to the base”), invert them (“the base seen from the camera”), interpolate between them and feed them to optimizers. Each task favours a different representation, and many practical bugs come from mixing two conventions: multiplying in the wrong order, reading a matrix in the wrong direction, or comparing quaternions without noticing that q and −q are the same rotation.
This article presents the standard representations using the convention of Lynch and Park’s Modern Robotics: rotation matrices and the group SO(3), homogeneous transformation matrices and SE(3), exponential coordinates and Rodrigues’ formula, Euler angles, and unit quaternions. It ends with screw motions, which is where robot kinematics begins. Orthogonality itself, determinants and matrix products are covered in orthogonal matrices, determinants and matrix multiplication; here we cover only what rigid motion adds.
Matrices, groups and charts for rotation
Frames and conventions. Lynch and Park treat every frame as stationary and right-handed. A “body frame” means the stationary frame that coincides with the frame attached to the moving body at the instant considered. We write for a fixed (space) frame and for a body frame, and or for the orientation or configuration of relative to . Frame conventions
Rotation matrices. Write the three unit axes of in the coordinates of and place them as columns of a 3×3 matrix . Unit length and mutual orthogonality give six constraints, compactly , so only three of the nine entries are free. Orthonormal columns imply ; the value −1 corresponds to a left-handed frame, a mirror image, which no continuous motion of a physical body can produce. Adding removes reflections without changing the number of free parameters:
SO(3) is a group under multiplication: the inverse is the transpose, a product of rotations is a rotation, multiplication is associative, and rotations preserve vector length. Multiplication is generally not commutative; planar rotations in SO(2) are the exception. Rotation matrices
Three uses of one matrix. The same can (1) represent an orientation, (2) change the frame in which a vector or a frame is expressed, and (3) rotate a vector or a frame. Lynch and Park make the second use mechanical with subscript cancellation: and , where the inner subscripts must match and then disappear. Inverting swaps subscripts: .
Fixed frame versus body frame. Take an operator . Pre-multiplying, , rotates the frame about the axis read in the fixed frame . Post-multiplying, , rotates it about the same numerical axis read in the body frame . The two results differ unless the frames are aligned. This “left = fixed, right = body” rule belongs to the convention; if a library stores the inverse (for example world-to-camera matrices in vision), the reading flips. Pre- and post-multiplication
Homogeneous transformations. Position is added by stacking the rotation and the origin of written in :
Appending a 1 to a point (homogeneous coordinates) turns “rotate, then shift” into a single matrix product, and subscript cancellation carries over:
Products of transforms are transforms, multiplication is associative but not commutative, and every preserves distances and angles. That isometry property is why SE(3) is identified with rigid-body motions. has the same three uses as ; pre-multiplying by interprets and in , post-multiplying interprets them in . SE(3) The inverse formula above is worth memorising: it needs only a transpose and one matrix–vector product, and if is orthogonal its inverse block is exactly orthogonal too, whereas a general matrix inverse hides the structure and adds its own round-off (general numerical practice, not a claim from the cited sources).
Exponential coordinates and Rodrigues’ formula. Any rotation can be reached by turning through an angle about a fixed unit axis . The vector is the exponential coordinates of the rotation; keeping and separate is the axis-angle representation. Rotating a point at unit rate about obeys the linear equation , whose solution is the matrix exponential of the skew-symmetric matrix (the link to differential equations). Because , the exponential series collapses to a closed form:
Here . Matrix exponential
The matrix logarithm. Going back uses the trace, , and the antisymmetric part of :
This is valid only when is not a multiple of π. At the angle is 0 and the axis is undefined. At the angle is π, the antisymmetric part vanishes, separate formulas built from the diagonal apply, and both and are correct answers. Restricting to pictures SO(3) as a solid ball of radius π: each interior point is a unique rotation, while antipodal points on the surface are the same rotation. Lynch and Park add, without proof, that such singularities are unavoidable for any three-parameter representation of rotation. Matrix logarithm
Euler angles and gimbal lock. Three successive rotations about coordinate axes give a representation people can read. Lynch and Park’s ZYX Euler angles are body-frame rotations about , then , then :
Read as fixed-frame rotations in reverse order ( by , then by , then by ), the same product is the roll–pitch–yaw description. Any sequence whose first and second axes are perpendicular and whose second and third are perpendicular works (ZYZ, for example). At the ZYX chart degenerates: the first and third rotations then turn about the same physical axis, so only (or ) is determined and there is a one-parameter family of solutions. Euler angles Shoemake calls the loss of one rotational degree of freedom when two of the three axes align gimbal lock, notes that at least a dozen axis conventions are possible, and that Euler angles offer no reasonable way to combine two rotations. Problems with Euler angles Gimbal lock is a property of the coordinates, not of the body: the body can still turn in every direction, but the three angles cannot follow smoothly.
Unit quaternions. A rotation corresponds to the unit quaternion
which lies on the unit sphere in four dimensions. Each rotation has exactly two antipodal quaternions (a double cover), the quaternion product gives the quaternion of the product rotation, and can be computed from the entries of . Lynch and Park motivate quaternions by the numerical sensitivity of the SO(3) logarithm at small angles, at the price of a fourth variable and a unit-norm constraint. Unit quaternions Shoemake argued that quaternions, not independently interpolated Euler angles, are the right tool for in-betweening key-frame rotations: interpolate along the great arc of the sphere (Slerp), and when converting a sequence choose each quaternion’s sign on the side closest to the previous one, so that small changes in orientation give small displacements on the sphere. (Picking the far sign makes the arc between neighbours longer than a quarter circle, which corresponds to turning more than 180°: the interpolation takes the long way round.) He credits Hamilton with discovering quaternions in October 1843. Quaternion interpolation
Conventions differ here more than anywhere. This article uses Lynch and Park’s scalar-first and their quaternion-to-matrix formula. Shoemake rotates a vector as and prints a matrix laid out as the transpose of Lynch and Park’s; many libraries store the scalar last. Never combine a conversion formula from one source with a product rule from another without checking the result on a known rotation.
Screw motion. Rotation and translation combine in one more way. A screw axis is a point , a unit direction and a pitch , the ratio of linear to angular speed. The Chasles–Mozzi theorem, as stated by Lynch and Park, says every rigid-body displacement can be obtained by moving along some fixed screw axis; the six exponential coordinates give that axis and the distance travelled, and has a closed form analogous to Rodrigues’. Screw motion Joints of a robot arm are such screws, which is why the next step, the product-of-exponentials formula, belongs to robot kinematics.
Checking every rule numerically
The program below is original numpy code that implements the formulas above in Lynch and Park’s convention. It has no randomness and runs in well under a second. Equality checks print “ok” when the largest entry error is below 1e-12, instead of printing round-off digits that vary across machines. Section 1 uses the axis and angle of Lynch and Park’s Example 3.12; everything else is our own test data.
import numpy as np
def skew(w):
return np.array([[0.0, -w[2], w[1]], [w[2], 0.0, -w[0]], [-w[1], w[0], 0.0]])
def rot_axis_angle(axis, theta):
w = np.asarray(axis, dtype=float)
w = w / np.linalg.norm(w)
K = skew(w)
return np.eye(3) + np.sin(theta) * K + (1.0 - np.cos(theta)) * (K @ K)
def log_rot(R):
tr = np.trace(R)
if np.allclose(R, np.eye(3)):
return None, 0.0
if abs(tr + 1.0) < 1e-9:
if R[2, 2] > -1.0 + 1e-9:
w = np.array([R[0, 2], R[1, 2], 1.0 + R[2, 2]]) / np.sqrt(2.0 * (1.0 + R[2, 2]))
elif R[1, 1] > -1.0 + 1e-9:
w = np.array([R[0, 1], 1.0 + R[1, 1], R[2, 1]]) / np.sqrt(2.0 * (1.0 + R[1, 1]))
else:
w = np.array([1.0 + R[0, 0], R[1, 0], R[2, 0]]) / np.sqrt(2.0 * (1.0 + R[0, 0]))
return w, np.pi
theta = np.arccos(np.clip((tr - 1.0) / 2.0, -1.0, 1.0))
W = (R - R.T) / (2.0 * np.sin(theta))
return np.array([W[2, 1], W[0, 2], W[1, 0]]), theta
def make_T(R, p):
T = np.eye(4)
T[:3, :3] = R
T[:3, 3] = p
return T
def inv_T(T):
R, p = T[:3, :3], T[:3, 3]
return make_T(R.T, -R.T @ p)
def apply_T(T, x):
return T[:3, :3] @ x + T[:3, 3]
def rot_to_quat(R):
q0 = 0.5 * np.sqrt(1.0 + np.trace(R))
v = np.array([R[2, 1] - R[1, 2], R[0, 2] - R[2, 0], R[1, 0] - R[0, 1]]) / (4.0 * q0)
return np.concatenate([[q0], v])
def quat_to_rot(q):
q0, q1, q2, q3 = q
return np.array([
[q0*q0 + q1*q1 - q2*q2 - q3*q3, 2*(q1*q2 - q0*q3), 2*(q0*q2 + q1*q3)],
[2*(q0*q3 + q1*q2), q0*q0 - q1*q1 + q2*q2 - q3*q3, 2*(q2*q3 - q0*q1)],
[2*(q1*q3 - q0*q2), 2*(q0*q1 + q2*q3), q0*q0 - q1*q1 - q2*q2 + q3*q3],
])
def quat_mul(q, p):
q0, qv = q[0], q[1:]
p0, pv = p[0], p[1:]
return np.concatenate([[q0*p0 - qv @ pv], q0*pv + p0*qv + np.cross(qv, pv)])
def rz(a):
return rot_axis_angle([0, 0, 1], a)
def ry(a):
return rot_axis_angle([0, 1, 0], a)
def rx(a):
return rot_axis_angle([1, 0, 0], a)
def zyx(a, b, c):
return rz(a) @ ry(b) @ rx(c)
def ok(err, tol=1e-12):
return "ok" if err < tol else f"FAIL ({err:.1e})"
def fmt(v, d=3):
return "[" + ", ".join(f"{x:+.{d}f}" for x in np.ravel(v)) + "]"
print("1. Rodrigues formula (axis (0, sqrt3/2, 1/2), angle 30 deg)")
R = rot_axis_angle([0.0, np.sqrt(3) / 2, 0.5], np.radians(30))
for row in R:
print(" ", fmt(row, 4))
print(f" R^T R = I: {ok(np.abs(R.T @ R - np.eye(3)).max())}, det R = {np.linalg.det(R):.6f}")
w, th = log_rot(R)
print(f" log: axis {fmt(w)}, angle {np.degrees(th):.3f} deg, exp. coords {fmt(w * th)}")
print("2. Order matters: Rz(90) Rx(90) vs Rx(90) Rz(90) applied to e_x")
ex = np.array([1.0, 0.0, 0.0])
print(" Rz Rx e_x =", fmt(rz(np.pi/2) @ rx(np.pi/2) @ ex, 1))
print(" Rx Rz e_x =", fmt(rx(np.pi/2) @ rz(np.pi/2) @ ex, 1))
print("3. Homogeneous transforms: compose, invert, preserve distances")
T_ab = make_T(rz(np.pi/2), [1.0, 0.0, 0.0])
T_bc = make_T(rx(np.pi/2), [0.0, 2.0, 0.0])
T_ac = T_ab @ T_bc
p_c = np.array([1.0, 1.0, 1.0])
print(" p in {c}:", fmt(p_c, 1), "-> p in {a}:", fmt(apply_T(T_ac, p_c), 1))
print(" step by step T_ab(T_bc p):", fmt(apply_T(T_ab, apply_T(T_bc, p_c)), 1))
print(f" T_ac inv(T_ac) = I: {ok(np.abs(T_ac @ inv_T(T_ac) - np.eye(4)).max())}")
print(" T_ab T_bc origin:", fmt(T_ac[:3, 3], 1), " T_bc T_ab origin:", fmt((T_bc @ T_ab)[:3, 3], 1))
x, y = np.array([0.3, -1.2, 2.0]), np.array([1.5, 0.4, -0.7])
d0 = np.linalg.norm(x - y)
d1 = np.linalg.norm(apply_T(T_ac, x) - apply_T(T_ac, y))
print(f" |x-y| = {d0:.6f}, |Tx-Ty| = {d1:.6f}")
print("4. Fixed-frame vs body-frame rotation of the same R_sb")
R_sb = rx(np.pi/2)
Rop = rz(np.pi/2)
print(" R R_sb (about fixed z) x-axis of {b}:", fmt((Rop @ R_sb)[:, 0], 1))
print(" R_sb R (about body z) x-axis of {b}:", fmt((R_sb @ Rop)[:, 0], 1))
print("5. Unit quaternions: R -> q -> R, q and -q, composition")
q = rot_to_quat(R)
print(" q =", fmt(q, 4), f"|q| = {np.linalg.norm(q):.6f}")
print(f" R(q) = R: {ok(np.abs(quat_to_rot(q) - R).max())}, R(-q) = R: {ok(np.abs(quat_to_rot(-q) - R).max())}")
R2 = rot_axis_angle([1.0, -2.0, 2.0], 1.1)
q2 = rot_to_quat(R2)
print(f" R(q * q2) = R R2: {ok(np.abs(quat_to_rot(quat_mul(q, q2)) - R @ R2).max())}")
print(f" 2*acos(q0) = {np.degrees(2*np.arccos(q[0])):.3f} deg")
print("6. Angle pi: the axis sign is ambiguous")
Rpi = rot_axis_angle([1.0, 1.0, 0.0], np.pi)
w, th = log_rot(Rpi)
print(" log axis", fmt(w, 4), f"angle {np.degrees(th):.1f} deg;",
f"exp(+w pi) = exp(-w pi): {ok(np.abs(rot_axis_angle(w, np.pi) - rot_axis_angle(-w, np.pi)).max())}")
print("7. Gimbal lock in ZYX Euler angles")
A = zyx(np.radians(30), np.radians(90), np.radians(10))
B = zyx(np.radians(50), np.radians(90), np.radians(30))
print(f" R(30,90,10) = R(50,90,30): {ok(np.abs(A - B).max())}")
def euler_jacobian_rank(a, b, c, h=1e-6):
base = np.array([a, b, c])
cols = []
for k in range(3):
e = np.zeros(3)
e[k] = h
dR = (zyx(*(base + e)) - zyx(*(base - e))) / (2 * h)
W = dR @ zyx(*base).T
cols.append([W[2, 1], W[0, 2], W[1, 0]])
J = np.array(cols).T
return np.linalg.matrix_rank(J, tol=1e-6), np.linalg.svd(J, compute_uv=False)
for beta in [0.0, 60.0, 89.0, 90.0]:
r, s = euler_jacobian_rank(np.radians(30), np.radians(beta), np.radians(10))
print(f" beta = {beta:4.1f} deg: rank {r}, singular values {fmt(s, 4)}")
Inspect the recorded output
1. Rodrigues formula (axis (0, sqrt3/2, 1/2), angle 30 deg)
[+0.8660, -0.2500, +0.4330]
[+0.2500, +0.9665, +0.0580]
[-0.4330, +0.0580, +0.8995]
R^T R = I: ok, det R = 1.000000
log: axis [+0.000, +0.866, +0.500], angle 30.000 deg, exp. coords [+0.000, +0.453, +0.262]
2. Order matters: Rz(90) Rx(90) vs Rx(90) Rz(90) applied to e_x
Rz Rx e_x = [+0.0, +1.0, +0.0]
Rx Rz e_x = [+0.0, +0.0, +1.0]
3. Homogeneous transforms: compose, invert, preserve distances
p in {c}: [+1.0, +1.0, +1.0] -> p in {a}: [+0.0, +1.0, +1.0]
step by step T_ab(T_bc p): [+0.0, +1.0, +1.0]
T_ac inv(T_ac) = I: ok
T_ab T_bc origin: [-1.0, +0.0, +0.0] T_bc T_ab origin: [+1.0, +2.0, +0.0]
|x-y| = 3.360060, |Tx-Ty| = 3.360060
4. Fixed-frame vs body-frame rotation of the same R_sb
R R_sb (about fixed z) x-axis of {b}: [+0.0, +1.0, +0.0]
R_sb R (about body z) x-axis of {b}: [+0.0, +0.0, +1.0]
5. Unit quaternions: R -> q -> R, q and -q, composition
q = [+0.9659, +0.0000, +0.2241, +0.1294] |q| = 1.000000
R(q) = R: ok, R(-q) = R: ok
R(q * q2) = R R2: ok
2*acos(q0) = 30.000 deg
6. Angle pi: the axis sign is ambiguous
log axis [+0.7071, +0.7071, +0.0000] angle 180.0 deg; exp(+w pi) = exp(-w pi): ok
7. Gimbal lock in ZYX Euler angles
R(30,90,10) = R(50,90,30): ok
beta = 0.0 deg: rank 3, singular values [+1.0000, +1.0000, +1.0000]
beta = 60.0 deg: rank 3, singular values [+1.3660, +1.0000, +0.3660]
beta = 89.0 deg: rank 3, singular values [+1.4142, +1.0000, +0.0123]
beta = 90.0 deg: rank 2, singular values [+1.4142, +1.0000, +0.0000]Rodrigues and the logarithm. For the axis and 30°, the matrix has rows (0.8660, −0.2500, 0.4330), (0.2500, 0.9665, 0.0580) and (−0.4330, 0.0580, 0.8995), with orthonormal columns and determinant 1.000000. Lynch and Park print the same matrix rounded to three decimals; the two diagonal entries 0.9665 and 0.8995 show why four decimals are worth keeping when you compare against a book. The logarithm returns the axis (0, 0.866, 0.500), the angle 30.000° and exponential coordinates (0, 0.453, 0.262), the values of Example 3.12. Example 3.12
Order matters. Applying to gives (0, 1, 0), but gives (0, 0, 1). Section 4 is the same fact read as frames: with and the operator , pre-multiplying (rotation about the fixed -axis) sends the body -axis to (0, 1, 0), while post-multiplying (rotation about the body -axis) sends it to (0, 0, 1).
Transforms. With and , the point (1, 1, 1) in is (0, 1, 1) in , whether we multiply the transforms first or apply them one after the other. with the structured inverse. The origin of is (−1, 0, 0), while the reversed product has origin (1, 2, 0): a different pose. Two test points stay 3.360060 apart after the transform, as an isometry must.
Quaternions. The quaternion of the 30° rotation is (0.9659, 0, 0.2241, 0.1294) with norm 1.000000; converting back gives , and so does . Multiplying by the quaternion of a second rotation (axis (1, −2, 2), 1.1 rad) yields the quaternion of the matrix product, and recovers 30.000°. The simple conversion in rot_to_quat (Lynch and Park’s Eqs. B.10–B.11) divides by , and tends to 0 as θ approaches 180°, so it is only safe away from half-turns. Robust implementations switch to formulas built from the largest diagonal entry in that region (general practice; Lynch and Park’s B.3 does not give them), just as the logarithm needs its separate θ = π branch.
The angle π. For a half-turn about , the logarithm’s special branch returns the axis (0.7071, 0.7071, 0) and 180.0°, and rotating by π about or gives the same matrix. A program that compares axes after a logarithm must treat this sign as arbitrary.
Gimbal lock. and are the same matrix, because in both. To see the degeneration as it approaches, the last block estimates, by central differences, the 3×3 matrix that maps Euler-angle rates to angular velocity in the fixed frame, and prints its rank and singular values. This diagnostic and its numbers are our own computation, not a published result. At the singular values are (1, 1, 1); at 60° they are (1.3660, 1.0000, 0.3660); at 89° the smallest is 0.0123; at 90° it is 0.0000 and the rank drops to 2. Near the singular pitch, a small change of orientation in one direction requires large changes of and , which is what a gimbal-lock warning in a flight display or an animation tool is guarding against.
Every operation in this program costs a fixed number of 3×3 or 4×4 products, so complexity is not a concern; numerical hygiene is. Composing many transforms accumulates round-off, and slowly stops being orthogonal. Common remedies (general numerical practice, not taken from the cited sources) are to re-orthonormalise periodically, for example by replacing it with the nearest orthogonal matrix from its singular value decomposition, to renormalise quaternions after every product, and to prefer the structured inverse over a generic one.
What each representation cannot do
No three-number chart covers all rotations smoothly. Exponential coordinates are sensitive near (division by , the reason Lynch and Park give for quaternions) and ambiguous at ; Euler angles fail at their own singular configurations ( for ZYX); Cayley–Rodrigues parameters blow up at π. The statement that every three-parameter representation has a singularity is quoted from Lynch and Park, who state it without proof; we do not prove it here. Singularities
Quaternions escape the singularity but bring two costs: a unit-norm constraint that optimizers and integrators must maintain, and the q/−q ambiguity, which breaks naive averaging, distance computations and interpolation unless signs are aligned first. Sign choice
Matrices are unambiguous but redundant: nine numbers with six constraints. They are a poor choice for unconstrained optimization or for direct interpolation (averaging two rotation matrices entrywise does not give a rotation).
Conventions are the largest practical risk. Active versus passive rotations, versus , scalar-first versus scalar-last quaternions, intrinsic versus extrinsic Euler sequences, and left- versus right-handed world frames all appear in real software. A single test on a known rotation, such as the 30° example above, catches most of these mismatches.
This article covers a single rigid body. Velocities (twists), forces (wrenches) and the adjoint map are only mentioned; chains of bodies connected by joints are the subject of robot kinematics, and solving for joint angles is inverse kinematics.
Which frame, which order, which chart?
-
Why is not enough to define a rotation, and what does a matrix with but describe?
Answer: only says the columns are orthonormal, which gives . With the columns form a left-handed frame, so the map contains a reflection, for example , a mirror in the -plane. No continuous motion turns a physical body into its mirror image, so SO(3) adds .
-
has and ; has and . (a) Express in . (b) Where is the origin of in ? (c) Apply to (1, 0, 0).
Answer: maps to and maps it to . (a) ; then gives , matching the program. (b) , the program’s origin of . (c) : the point (1, 0, 0) of is the origin of , as it should be.
-
A conversion routine returns ZYX angles for a matrix built from . Is it wrong? Is interpolating from to either triple the same motion?
Answer: It is not wrong. At only is determined, and , so both triples give the same matrix; Lynch and Park’s conversion picks in this case. Interpolating the angles independently, however, traces different paths in orientation space for the two triples, which is one reason Shoemake recommends interpolating quaternions. The program’s rank drop at is the same phenomenon: the chart, not the body, loses a direction.
-
For an animation system you need (i) smooth interpolation between key frames, (ii) unconstrained parameters for an optimizer, (iii) a readable readout for a pilot display. Pick a representation for each and name its failure mode.
Answer: (i) Unit quaternions with Slerp, aligning each quaternion’s sign with the previous one; otherwise the interpolation may take the long way. (ii) Exponential coordinates (three free numbers), with care near and at ; or a quaternion renormalised after each step. (iii) Roll–pitch–yaw angles, readable but singular at pitch ; display them, but never compose or interpolate them directly; convert to matrices or quaternions first.
-
Find the rotation angle and axis of with rows (0, −1, 0), (1, 0, 0), (0, 0, 1).
Answer: , so and . has entries −1 at row 1, column 2 and +1 at row 2, column 1, which is for . The matrix is .
From one body to many
Lynch and Park’s Chapter 3 develops everything above in one notation and continues to twists, wrenches and the adjoint representation; Appendix B collects Euler angles, roll–pitch–yaw, quaternions and Cayley–Rodrigues parameters with conversion formulas. Chapter 3 and Appendix B Shoemake’s paper remains a compact account of why quaternions suit interpolation and how to handle their sign. Quaternion curves
The same SE(3) machinery appears wherever poses are estimated: camera extrinsics in image formation, relative poses in stereo vision and structure from motion, and normalised quaternions that orient the ellipsoids in Gaussian splatting. In each case, write down which frame maps to which, which quaternion layout is used, and test the code on one rotation whose answer you know.
Make a prediction, then check
An orientation is built from ZYX Euler angles (30°, 90°, 10°). A conversion routine returns (50°, 90°, 30°). Which statement is right?
Learning objectives
- Represent, compose and invert rigid-body poses with rotation and homogeneous transformation matrices, change reference frames by subscript cancellation, and distinguish pre-multiplication (fixed frame) from post-multiplication (body frame).
- Convert between rotation matrices, axis-angle/exponential coordinates, Euler angles and unit quaternions, explain the special cases θ = 0, θ = π, gimbal lock and the q/−q double cover, and choose a representation for interpolation, optimization or display.
Prerequisites & connections
Explore related knowledge →References
- Modern Robotics: Mechanics, Planning, and Control — May 2017 preprint, scoped
Kevin M. Lynch; Frank C. Park · 2017 - Animating Rotation with Quaternion Curves (SIGGRAPH '85, Computer Graphics 19(3))
Ken Shoemake · 1985
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Claude · 2026-12-03 · Independent AI check (Claude subagent, not the author; not a human or expert review). Before this check the main session had applied style-only edits suggested by the Gemini app to the opening sections (logged in gemini-edits-016a.json); research was done by a separate research subagent (facts.md) and the prose by a writer subagent. I re-ran example.py with the pinned CPython + numpy 1.26.4 interpreter and diffed it against example.stdout.txt (identical), confirmed the python block in en.mdx and zh.mdx is byte-identical to example.py, the recorded-output block matches the stdout, and the seven display equations are identical across languages. I re-derived Rodrigues' formula and the logarithm, the structured SE(3) inverse, all five exercise answers (including the (0,1,1) and (−1,0,0) hand calculations and the β = 90° Euler case against Lynch & Park's algorithm B.1.1(b)), and checked every number quoted in the prose against the output. I downloaded the Modern Robotics preprint PDF (May 2017) and re-read by text extraction §3 opening (frame conventions), §3.2.3 pp. 84–87 (Example 3.12, matrix log, footnote 5), Fig. 3.13, Prop. 3.18 and §3.3.3 p. 105 (Chasles–Mozzi), and Appendix B pp. 576–583 (ZYX/ZYZ Euler angles, the β = ±90° one-parameter family, Eq. B.7, roll–pitch–yaw, unit quaternions Eqs. B.9–B.15, Cayley–Rodrigues); the code's quaternion-to-matrix function matches Eq. B.12 entry by entry and its product matches B.15. I re-read the Shoemake 1985 scan (CMU copy) by OCR, pp. 245–248: the 1843 date, the 'at least a dozen' conventions, 'no reasonable way' to combine rotations, gimbal lock as loss of one rotational degree of freedom when two axes align, rotation as q^{-1}vq, his matrix (which is the transpose of Lynch & Park's B.12 layout, as the article states), Slerp, antipodal points as one rotation, and the closest-sign rule. I compared zh and en section by section and checked data.json (source rows, catalogue IDs, quiz answer). Not checked: Shoemake §4 onward, the ACM Digital Library copy, and Modern Robotics sections the writer did not cite.
- Code and output: example.py re-run with the pinned interpreter matches example.stdout.txt exactly; the python blocks in both languages are byte-identical to example.py, and every number quoted in the prose (0.9665, 0.8995, (0, 0.453, 0.262), 3.360060, quaternion entries, singular values) matches the output.
- Equations and exercises: Rodrigues' formula, the matrix logarithm and its θ = π branch, the structured SE(3) inverse, the β = 90° one-parameter family of ZYX Euler angles and all five exercise answers re-derived correctly; the quaternion-to-matrix code matches Lynch & Park Eq. B.12 entry by entry and the product matches B.15.
- Sources: Modern Robotics Example 3.12 prints three decimals (0.967, 0.899); the article gives four and does not call the book wrong; footnote 5 is presented as the authors' unproved statement. Shoemake's claims on gimbal lock, Slerp, q/−q and sign choice, and the 1843 date are all found on pp. 245–248; the article states his matrix layout is the transpose of Lynch & Park's and does not mix the two.
- Bilingual and Gemini edits: zh and en compared section by section; definitions, numbers, exercises and caveats agree. The nine logged Gemini edits for this topic are stylistic and change no fact, hedge or attribution.
Source locations checked:
- Modern Robotics: Mechanics, Planning, and Control — May 2017 preprint, scoped · Preprint PDF dated 2017-05-03 fetched 2026-12-03, text extracted with pdftotext; printed page numbers. Checked: §2.1 pp. 14–15 (6 DoF spatial, 3 DoF planar); Ch. 3 opening pp. 59–62 (frames stationary, body frame meaning, right-handed); §3.2.1 pp. 68–76 (Eqs. 3.17–3.21, Definitions 3.1–3.2, Props 3.3–3.6, three uses, Eq. 3.22 subscript cancellation, Rot(x/y/z) matrices, Eqs. 3.23–3.24 fixed vs body rotation); §3.2.3 pp. 79–89 (Prop. 3.10 matrix exponential properties, Eqs. 3.49–3.51 and Prop. 3.11 Rodrigues, Example 3.12 numbers, Eqs. 3.53–3.61 logarithm algorithm incl. θ = π cases, footnote 5 on unavoidable singularities of 3-parameter representations, Fig. 3.13 solid ball of radius π); §3.3.1 pp. 89–93 (Definitions 3.13–3.14, Props 3.15–3.18, three uses, Eqs. 3.66–3.67); §3.3.2.2 pp. 102–104 (screw axis {q, ŝ, h}, Definition 3.24); §3.3.3 pp. 104–107 (Chasles–Mozzi statement, Eqs. 3.86–3.89 Prop. 3.25, SE(3) log algorithm Eqs. 3.91–3.92); Appendix B pp. 575–584 (Eqs. B.1–B.8 ZYX/ZYZ Euler and XYZ roll–pitch–yaw, β = ±90° one-parameter family p. 577, Eq. B.7 orthogonal-axis condition, B.3 Eqs. B.9–B.15 unit quaternions, B.4 Eqs. B.16–B.22 Cayley–Rodrigues). NOT read: §3.1 planar example details (pp. 62–68), §3.2.2 angular velocities, §3.3.2.1 twist/adjoint details beyond p. 101–102 glimpsed, §3.4 wrenches, §3.5–3.8, B.4 Eqs. B.23–B.32 in detail. Noted: Example 3.12 prints entries 0.967 and 0.899 whose exact values are 0.96651 and 0.89952.
- Animating Rotation with Quaternion Curves (SIGGRAPH '85, Computer Graphics 19(3)) · Scanned PDF (841 KB) fetched 2026-12-03, OCR text layer extracted. Checked pp. 245–248: abstract; §1 (Euler angles interpolated independently not ideal; quaternions, 1843); §2.1 (Euler's single-rotation result cited as 1752; Hamilton October 1843; Cayley's rotation formula); §2.2 (rotations preserve dot/cross products and determinants, M^T M = I, det M = +1, trace 1 + 2cos θ); §2.3 (quaternion product rule); §2.4 (Euler angle conventions, at least a dozen; no reasonable way to combine rotations); §3.1 (independent angle interpolation; gimbal lock as loss of one degree of rotational freedom when two axes align; quaternions free of it); §3.2 (rotation as q^{-1} v q; scalar multiples give same rotation; matrix for unit quaternion with w, x, y, z; w = cos θ/2, vector part along axis with magnitude sin θ/2); §3.3 (great-arc interpolation, Slerp formulas); §3.4 (sphere geometry, antipodal points same rotation, choose nearest sign). NOT read: §4 onward (spherical Bézier curves, B-splines, experiments, questions), appendix; reference list only skimmed. OCR is imperfect; formulas were cross-checked against Lynch & Park App. B where possible.
Related topics