Dynamics (MIT 16.07) - Lecture 12: Quaternion Algebra and Kinematics
Overview
MIT 16.07 develops quaternion algebra as a compact, simulation-friendly representation of 3D rotations, mapping axis-angle vectors to unit quaternions and defining conjugation, multiplication, vector rotation, and matrix equivalents. The lecture derives body-frame kinematics, q̇ = 1/2 G(q)ω with a 4×3 attitude Jacobian, and shows why quaternion normalization is easier than correcting rotation-matrix drift; the planned Newton-Euler and quadrotor examples are postponed.
Key takeaways
- For a rotation of angle θ about unit axis a, the unit quaternion is (cos(θ/2), a sin(θ/2)); the half-angle structure makes q and −q represent the same orientation.
- A unit quaternion's inverse is its conjugate, obtained by preserving the scalar part and negating the vector part, directly paralleling the transpose of a rotation matrix.
- Quaternion multiplication combines a dot product in its scalar component with a cross product in its vector component, which explains why 3D rotation composition is noncommutative.
- A vector rotates by quaternion sandwiching, q(0, x)q†; the equivalent 3×3 rotation matrix is HᵀL(q)Rᵀ(q)H.
- For body-frame angular velocity, quaternion kinematics are q̇ = 1/2 G(q)ω, where G(q) = L(q)H maps three angular-velocity components to four quaternion-derivative components.
- Quaternion norm drift is inexpensive to correct by normalization, whereas projecting a drifting rotation matrix back to orthogonality can require an SVD.
Chapters
- The previous lecture connected the matrix exponential of a skew-symmetric angular-velocity matrix to rotation matrices and axis-angle coordinates.
- Euler angles have wraparound and singularity problems, while rotation matrices use nine numbers and can drift from orthogonality during simulation.
- Unit quaternions use four numbers, represent each orientation twice, and are intended as a practical rotation representation for dynamics and control.
- An axis-angle vector φ is the unit rotation axis multiplied by the rotation angle in radians: its direction gives the axis and its norm gives the angle.
- The quaternion for axis a and angle θ has scalar part cos(θ/2) and vector part a sin(θ/2).
- The same mapping can be written using φ as cos(‖φ‖/2) for the scalar and (φ/‖φ‖) sin(‖φ‖/2) for the vector part.
- A quaternion splits into a scalar part and a three-dimensional vector part, analogous in a limited way to real and imaginary parts of a complex number.
- For a unit rotation axis, the quaternion norm is one because cos²(θ/2) + sin²(θ/2) = 1.
- The identity quaternion is (1, 0, 0, 0); a non-unit quaternion can introduce scaling when used to transform vectors.
- For a unit quaternion, the inverse rotation is its conjugate: keep the scalar part and negate the three vector components.
- A matrix T = diag(1, −I₃) implements conjugation on the four-component quaternion.
- The conjugate plays the role of the transpose for rotation matrices, whose inverse equals their transpose.
- Adding 2π to an axis-angle rotation leaves the physical orientation unchanged but changes the quaternion sign because its trigonometric arguments use half-angles.
- Thus q and −q represent the same 3D rotation, giving quaternions a two-to-one mapping, or double cover, of rotations.
- The antipodal pair matches the earlier geometric construction of joining two hemispheres into the unit sphere in four dimensions.
- For q₁ = (s₁, v₁) and q₂ = (s₂, v₂), the product has scalar part s₁s₂ − v₁·v₂ and vector part s₁v₂ + s₂v₁ + v₁×v₂.
- The dot product contributes to the scalar component, while the cross product encodes the noncommutative 3D part of composition.
- Hamilton developed quaternions before modern vector notation; the lecture also notes Gibbs's later popularization of dot and cross products.
- Quaternion products can be implemented as L(q₁)q₂ or R(q₂)q₁, with each multiplication operator represented by a 4×4 matrix.
- The left and right operators differ in the sign of the skew-symmetric cross-product block, reflecting reversal of cross-product order.
- Unlike the planar case, 3D rotations do not commute, so left and right multiplication are distinct; for unit quaternions, their matrices are orthogonal.
- A 3D vector x is embedded as a pure-vector quaternion with zero scalar part, then rotated using q(0, x)q†.
- The lifting matrix H = [0; I₃] maps a 3D vector to its four-component pure quaternion, while Hᵀ extracts the resulting vector part.
- The rotation matrix equivalent is Q = HᵀL(q)Rᵀ(q)H, which also equals HᵀRᵀ(q)L(q)H by associativity.
- Quaternion unit norm corresponds to rotation-matrix orthogonality, and quaternion multiplication corresponds to matrix composition.
- The conjugate q† replaces the matrix transpose when undoing a rotation, while a pure-vector quaternion corresponds to a skew-symmetric matrix.
- These correspondences let users transfer familiar rotation-matrix operations to quaternion calculations while preserving the order-sensitive behavior of 3D rotations.
- For body-to-inertial attitude q, a small body-frame rotation is composed on the right: q₂ = q₁δq.
- Using the small-angle approximation, δq is approximately the identity quaternion plus one-half the lifted incremental axis-angle vector.
- Taking the time-step limit gives q̇ = 1/2 L(q)Hω, or q̇ = 1/2 G(q)ω, where ω is body-frame angular velocity.
- G(q) = L(q)H is a 4×3 attitude Jacobian mapping a three-component angular velocity to a four-component quaternion derivative.
- The lecture describes G as the shared angular-velocity mapping across local attitude parameterizations, while constants such as the one-half factor depend on the chosen coordinates.
- The quaternion exponential maps an axis-angle vector to a quaternion using half-angle sine and cosine terms; a quaternion logarithm provides the reverse mapping.
- Numerical integration can make quaternion norm drift from one, just as rotation-matrix integration can produce orthogonality error.
- A proportional-derivative correction can keep quaternion norm near one, or a simple post-processing step can divide the quaternion by its norm.
- Correcting a rotation matrix instead can require an SVD projection that sets the singular-value matrix to identity, a more expensive operation; the quadrotor simulation was deferred to the next lecture.
Transcript excerpt
0:00 So, let's see. What are we doing in here last time? This is hopefully going to be, you know, a good one. We're going to kind of get to the the real stuff today and like going to finish up all this mathy stuff and actually do some stuff, some dynamics. So, it should be good. So, last time we I I mentioned this like exponential thing, matrix exponential thing, and we talked about how that maps skew-symmetric matrices into rotation matrices. If you take the exponential, it's basically just the solution to a first-order ODE, which is the ODE for the rotation matrix from omega, if you have constant omega. And we talked about this whole axis-angle thing. That axis-angle thing is called the Lie algebra of the rotation group. So, you have a
0:49 group, you have an algebra. The group is the rotation matrix. The algebra is the axis-angle vectors. And that exponential map maps you from the algebra to the group. We're going to talk a little bit more about this today in the context of quaternions, which have the same stuff. And there it's a little more geometrically clear what's going on. And there's some connections between this whole Lie algebra idea and and basically angular velocities and derivatives. That's that's really what it's about. So, what are we doing today? Then we talked about we kind of built up quaternions for planar rotations, which is my effort to kind of give you some idea of where these things come from, why they're weirdly higher-dimensional, uh where the double cover thing comes from, the unit norm thing, all all the kind of like weird stuff about quaternions that trips people up kind of
1:37 shows up in planar rotation land, too, if you and we kind of made a special
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, MIT Robotic Exploration Lab.