Notes while reading Joan Solà’s Quaternion Kinematics for the Error-State Kalman Filter. This is a condensed study record of the source material.
1. Quaternion definition and basic properties
Definition
A quaternion has one real part and three imaginary parts:
Q=qw+qxi+qyj+qzk∈H.
Equivalent notation is
Q=qw+qv=⟨qw,qv⟩=[qw,qx,qy,qz]T.
A quaternion with zero real part is pure imaginary; one with zero vector part is a real number.
Properties
Sum
p+q=[pw+qwpv+qv].
Product
p⊗q=[pwqw−pvTqvpwqv+qwpv+pv×qv].
Quaternion multiplication is not commutative,
p⊗q=q⊗p,
but is associative and distributive:
(p⊗q)⊗r=p⊗(q⊗r),
p⊗(q+r)=p⊗q+p⊗r,(p+q)⊗r=p⊗r+q⊗r.
Products can be written as matrix multiplication:
q1⊗q2=[q1]Lq2=[q2]Rq1,
[q]L=qwI+[0qv−qvT[qv]×],[q]R=qwI+[0qv−qvT−[qv]×].
The cross-product matrix is
[a]×=0az−ay−az0axay−ax0,a×b=[a]×b.
Identity, conjugate, norm, and inverse
1=[10],q∗=[qw−qv].
q∗⊗q=q⊗q∗=qw2+qx2+qy2+qz2,(p⊗q)∗=q∗⊗p∗.
∥q∥=q⊗q∗=qw2+qx2+qy2+qz2,∥p⊗q∥=∥p∥∥q∥.
q−1=∥q∥2q∗.
For a unit quaternion, inverse equals conjugate:
q−1=q∗,q=[cosθusinθ].
Unit quaternions represent rigid-body rotations.
Useful identities
The quaternion commutator is
p⊗q−q⊗p=2pv×qv.
For pure quaternions,
pv⊗qv=−pvTqv+pv×qv,qv⊗qv=−∥qv∥2.
If v=uθ, then
v2=−θ2,v3=−uθ3,v4=θ4,v5=uθ5.
Therefore, the exponential of a pure quaternion is
ev=euθ=k=0∑∞k!vk=cosθ+usinθ.
It is a unit quaternion. For a general quaternion,
eq=eqw+qv=eqw[cos∥qv∥∥qv∥qvsin∥qv∥].
For a unit quaternion,
logq=uθ,u=∥qv∥qv,θ=atan2(∥qv∥,qw).
For a general quaternion,
logq=log∥q∥+uθ.
Quaternion powers follow:
qt=exp(tlogq),qt=[cos(tθ)usin(tθ)]for a unit quaternion.
2. Rotations and cross-relations
The rotation group SO(3) preserves vector norms, angles, and orientation:
∥r(v)∥=∥v∥,⟨r(v),r(w)⟩=⟨v,w⟩,
u×v=w⟺r(u)×r(v)=r(w).
Matrix representation of SO(3)
r(v)=Rv,RTR=I,R−1=RT,detR=1.
The exponential maps are
exp:so(3)→SO(3),[v]×↦e[v]×,
Exp:R3→SO(3),v↦Exp(v)=e[v]×.
Rodrigues’ formula for v=ϕu is
R=I+sinϕ[u]×+(1−cosϕ)[u]×2=Icosϕ+[u]×sinϕ+uuT(1−cosϕ).
The logarithmic maps are
log:SO(3)→so(3),log(R)=[uϕ]×,
ϕ=arccos(2trace(R)−1),u=2sinϕ(R−RT)∨,
Log:SO(3)→R3,Log(R)=uϕ=log(R)∨.
Quaternion representation of SO(3)
The quaternion exponential is
exp:Hp→S3,V↦eV.

The capitalized map is
Exp:R3→S3,Exp(v)=ev/2.
Thus
q˙=21q⊗ω,q=eωt/2,
and for a rotation vector ϕu,
q=Exp(ϕu)=[cos(ϕ/2)usin(ϕ/2)].
The quaternion logarithms are
log(q)=uθ,Log(q)=uϕ=2log(q),
ϕ=2atan2(∥qv∥,qw),u=∥qv∥qv.

Spherical linear interpolation is
q(t)=q0⊗(q0∗⊗q1)t=q0⊗[cos(tΔϕ/2)usin(tΔϕ/2)],
R(t)=R0Exp(tLog(R0TR1)).
3. Quaternion conventions
Hamilton uses a right-handed convention; JPL uses a left-handed convention.

4. Perturbations, derivatives, and integrals
Plus and minus operators on SO(3)
Define plus by
S=R⊕θ=RExp(θ),
with equivalent quaternion form
qs=qr⊕θ=qr⊗Exp(θ).
Define minus by
θ=S⊖R=Log(R−1S),
θ=qs⊖qr=Log(qr∗⊗qs).
Four derivative definitions
For vector-space functions,
∂x∂f(x)=δx→0limδxf(x+δx)−f(x),
f(x+Δx)≈f(x)+∂x∂f(x)Δx.
For SO(3)→SO(3),
∂θ∂f(R)=δθ→0limδθf(R⊕δθ)⊖f(R),
f(R⊕Δθ)≈f(R)Exp(∂θ∂f(R)Δθ).
For vector-space to SO(3),
∂x∂f(x)=δx→0limδxf(x+δx)⊖f(x).
For SO(3) to vector space,
∂θ∂f(R)=δθ→0limδθf(RExp(δθ))−f(R).
Useful rotation Jacobians
∂a∂(q⊗a⊗q∗)=∂a∂(Ra)=R.
For q=[w,v]T,
∂q∂(q⊗a⊗q∗)=2[wa+v×avTaI+vaT−avT−w[a]×].
The right Jacobian of SO(3) is
Jr(θ)=δθ→0limδθLog(Exp(θ)TExp(θ+δθ)).
It enables first-order expansions:
Exp(θ+δθ)≈Exp(θ)Exp(Jr(θ)δθ),
Log(Exp(θ)Exp(δθ))≈θ+Jr−1(θ)δθ.
Time derivatives and integration
q˙=21Ω(ωL)q=21q⊗ωL,R˙=R[ωL]×.
Zeroth-order integration is
qn+1≈qn⊗Exp(ωnΔt)
for forward Euler, or use ωn+1 for backward Euler. Midpoint integration uses
ωˉ=2ωn+1+ωn,qn+1≈qn⊗Exp(ωˉΔt).
The first-order approximation is
qn+1≈qn⊗(Exp(ωˉΔt)+24Δt2[0ωn×ωn+1]).