Papers
Topics
Authors
Recent
Search
2000 character limit reached

Quaternion-Based 3D Rotations

Updated 29 March 2026
  • Quaternion-based 3D rotations are a compact, singularity-free framework using unit quaternions to represent and interpolate rotations in 3D space.
  • They leverage Hamilton's noncommutative quaternion algebra to enable efficient rotation composition, SLERP interpolation, and stable numerical integration.
  • Applications span robotics, computer vision, and deep learning, underpinning tasks like IMU integration, pose estimation, and rotation-invariant feature extraction.

Quaternion-based 3D rotations provide a compact, singularity-free, and computationally efficient framework for representing, manipulating, and interpolating rotations in three-dimensional Euclidean space. Real quaternions, as formalized by Hamilton, form a noncommutative algebra whose unit sphere S³ double-covers the rotation group SO(3) and enables robust geometric and analytic tools that avoid the limitations of alternative parametrizations such as Euler angles or rotation matrices. The algebraic, topological, and differential structure of quaternion-based rotations underpins their extensive use in areas ranging from classical mechanics and robotics to computer vision, pose estimation, and modern deep learning models for rotation-invariant data analysis.

1. Algebraic Structure and Parametrization

A real quaternion qHq \in \mathbb{H} is written as

q=a+bi+cj+dkq = a + b\,i + c\,j + d\,k

with real a,b,c,da,b,c,d and basis elements {1,i,j,k}\{1, i, j, k\} satisfying the multiplication rules

i2=j2=k2=ijk=1;ij=k=ji;jk=i=kj;ki=j=iki^2 = j^2 = k^2 = ijk = -1;\quad ij = k = -ji;\quad jk = i = -kj;\quad ki = j = -ik

The quaternion conjugate is qˉ=abicjdk\bar{q} = a - bi - cj - dk, the norm is N(q)=qqˉ=a2+b2+c2+d2N(q) = q\bar{q} = a^2 + b^2 + c^2 + d^2, and the inverse (when N(q)0N(q)\neq 0) is q1=qˉ/N(q)q^{-1} = \bar{q}/N(q) (Pellat-Finet, 2024).

Unit quaternions (N(q)=1N(q) = 1) lie on the 3-sphere S3R4S^3 \subset \mathbb{R}^4 and form a nonabelian multiplicative group isomorphic to SU(2)\mathrm{SU}(2), which double-covers SO(3)\mathrm{SO}(3). Any 3D rotation of angle θ\theta about a unit axis u^=(ux,uy,uz)\hat{u} = (u_x, u_y, u_z) is represented by the unit quaternion

q=cos(θ2)+sin(θ2)(uxi+uyj+uzk)q = \cos\left(\frac{\theta}{2}\right) + \sin\left(\frac{\theta}{2}\right)(u_x\,i + u_y\,j + u_z\,k)

or equivalently q=exp[(θ/2)(uxi+uyj+uzk)]q = \exp\left[(\theta/2)(u_x\,i + u_y\,j + u_z\,k)\right] (Pellat-Finet, 2024, Díaz et al., 6 Nov 2025).

2. Quaternionic Rotation Action and Matrix Correspondence

A 3-vector v=(vx,vy,vz)v = (v_x, v_y, v_z) is identified with the pure quaternion V=0+vxi+vyj+vzkV = 0 + v_x\,i + v_y\,j + v_z\,k. For a unit quaternion qq, rotation of VV is effected by the sandwich product: V=qVq1V' = q V q^{-1} The vector part of VV' is the rotated vector (Pellat-Finet, 2024, Díaz et al., 6 Nov 2025).

Expanding this action yields Rodrigues’ rotation formula: v=(q02q2)v+2(qv)q+2q0(q×v)v' = (q_0^2 - \|\mathbf{q}\|^2)\,v + 2(\mathbf{q}\cdot v)\mathbf{q} + 2q_0\,(\mathbf{q} \times v) for q=q0+qq = q_0 + \mathbf{q} [(Díaz et al., 6 Nov 2025), eq. (1)]. Substituting q0=cos(θ/2)q_0 = \cos(\theta/2) and q=sin(θ/2)\|\mathbf{q}\| = \sin(\theta/2) gives

v=cosθv+(1cosθ)(u^v)u^+sinθ(u^×v)v' = \cos\theta\,v + (1-\cos\theta)(\hat{u}\cdot v)\hat{u} + \sin\theta\,(\hat{u} \times v)

which is exactly Rodrigues' classical formula.

The corresponding 3×33\times 3 rotation matrix R(q)R(q) derived by expanding qVq1q\,V\,q^{-1} for q=w+xi+yj+zkq = w + xi + yj + zk with w2+x2+y2+z2=1w^2 + x^2 + y^2 + z^2 = 1 is

R(q)=(12(y2+z2)2(xywz)2(xz+wy) 2(xy+wz)12(x2+z2)2(yzwx) 2(xzwy)2(yz+wx)12(x2+y2))R(q) = \left(\begin{array}{ccc} 1-2(y^2+z^2) & 2(xy - wz) & 2(xz + wy) \ 2(xy + wz) & 1-2(x^2+z^2) & 2(yz - wx) \ 2(xz - wy) & 2(yz + wx) & 1-2(x^2+y^2) \end{array}\right)

(Pellat-Finet, 2024). The mapping is surjective and two-to-one: qq and q-q yield the same rotation.

3. Rotation Composition, Interpolation, and Numerical Stability

Composition of rotations corresponds to quaternion multiplication: If q1A, q2B, then q=q2q1,  R(q2q1)=R(q2)R(q1)\text{If } q_1 \leftrightarrow A,\ q_2 \leftrightarrow B,\ \text{then}\ q = q_2 q_1,\ \ R(q_2 q_1) = R(q_2)R(q_1) (Pellat-Finet, 2024). Quaternion multiplication is associative and encodes the noncommutativity of spatial rotations.

Efficient interpolation between orientations uses spherical linear interpolation (SLERP) on S3S^3: slerp(q0,q1;t)=q0(q01q1)t,t[0,1]\operatorname{slerp}(q_0, q_1; t) = q_0 \left(q_0^{-1}q_1\right)^t, \quad t \in [0,1] This traces the shortest geodesic arc between q0q_0 and q1q_1 on S3S^3 [(Pellat-Finet, 2024); (Díaz et al., 6 Nov 2025); (Palais, 2010)].

Quaternions avoid the singularities (gimbal lock) inherent in Euler-angle parametrizations and maintain a continuous, singularity-free mapping to SO(3): all orientations are smoothly reachable and invertible (Díaz et al., 6 Nov 2025, Pellat-Finet, 2024). The unit-norm constraint is readily maintained by normalization, ensuring numerical stability (Solà, 2017).

4. Differential Structure and Kinematic Equations

For time-dependent rotations, the quaternion evolution under angular velocity ωR3\omega \in \mathbb{R}^3 (in the same frame) is

q˙=12q(0,ω)\dot{q} = \frac{1}{2} q \otimes (0, \omega)

Equivalently, the angular velocity is obtained from the quaternion rate via

ω=2G(q)q˙\omega = 2 G(q) \dot{q}

where G(q)G(q) is the standard 3×43\times 4 matrix depending on qq (Zoufaly et al., 21 Jan 2025, Solà, 2017).

Finite rotations are integrated using

qn+1=qnexp(12ω^Δt)q_{n+1} = q_n \exp\left(\frac{1}{2}\hat{\omega}\Delta t\right)

for constant ω\omega over time interval Δt\Delta t (Solà, 2017, Zoufaly et al., 21 Jan 2025). First-order or higher-order integrators may be applied, but unit-norm renormalization is essential for drift-free dynamics.

Quaternion-based kinematics underlies robust formulations in error-state Kalman filtering for numerically stable and singularity-free IMU integration (Solà, 2017), and enables efficient equations of motion for biomechanics systems with arbitrary topology (Zoufaly et al., 21 Jan 2025).

5. Applications to Pose Estimation, Frame Alignment, and Deep Learning

A central computational use is extracting the optimal rotation between two 3D point sets or frames (orthogonal Procrustes problem/RMSD minimization). Defining the cross-covariance E=ixiuiTE = \sum_i x_i u_i^T, the optimal quaternion maximizes qTM(E)qq^T M(E) q under q=1\|q\|=1, where M(E)M(E) is the 4×44\times 4 Davenport or profile matrix. The solution is the eigenvector of the largest eigenvalue of M(E)M(E) (Hanson, 2018, Hanson et al., 2022). Closed-form algebraic solutions via quartic roots, as well as adjugate-matrix approaches for extracting quaternions from 3×33\times 3 rotation matrices, yield singularity-free and globally defined algorithms (Hanson et al., 2022, Hanson, 2018).

Quaternionic averaging, essential for rotation averaging and multi-frame registration, exploits the properties of the chordal distance on S3S^3 and proper handling of the double cover ±q\pm q (Hanson, 2018).

In deep learning, rotation and permutation equivariant architectures leverage quaternionic layers, capsules, and convolutional units to achieve robust, rotation-equivariant representations. Dynamic routing in quaternion capsule networks interprets capsule routing as IRLS rotation averaging on S3S^3 (Zhao et al., 2019). Spherical Bingham distributions allow principled probabilistic modeling of orientation uncertainty in policy parameterization for reinforcement learning agents, outperforming Gaussian-based schemes and ensuring antipodal symmetry (James et al., 2022). Quaternion product units (QPUs) enable disentanglement of rotation-invariant and equivariant features for 3D skeletons and point clouds (Zhang et al., 2019), and rigorous inductive proofs establish layerwise and global rotation-equivariance for quaternion neural networks (Shen et al., 2019).

In geometric algebra, quaternions are recovered as the even subalgebra (rotors), with canonical isomorphism to the Hamilton algebra and direct connections to physical angular momentum and inertia maps (Brechet, 2022).

6. Topological and Geometric Interpretation

The set of unit quaternions S3S^3 forms a double cover of SO(3), i.e., the map qqvq1q \mapsto q\,v\,q^{-1} is 2:1, mapping antipodal points ±q\pm q to the same rotation (Díaz et al., 6 Nov 2025, O'Sullivan, 2015). The topological structure is made explicit via the Hopf fibration: S3S^3 fibers over S2S^2 with S1S^1 fibers, lending a geometric and phase-theoretic perspective to rotation parameterization (O'Sullivan, 2015). The double-cover relation underlies spinor representations (SU(2)), the Dirac belt trick, spinorial 4π\pi-periodicity, and the distinction between geometric phase, dynamical phase, and global phase in rotational kinematics.

The group structure, isomorphism with SU(2), and correspondence to the special unitary group enable sophisticated algebraic and geometric techniques for parameterizing and manipulating frame fields and constructing invariant polynomial forms for higher-order symmetry groups (Beaufort et al., 2019).

7. Implementation Guidance and Numerical Best Practices

Robust numerical algorithms for quaternion-based rotation operations are now established standard. Key best practices include:

  • Maintaining the unit-norm constraint on quaternions by normalization after integration (Solà, 2017, Zoufaly et al., 21 Jan 2025).
  • Using adjugate or quartic-algebraic approaches for extracting quaternions from approximated rotation matrices, rather than axis–angle or Euler conversions (Hanson et al., 2022).
  • Ensuring antipodal symmetry and manifold coverage when designing loss functions and learning pipelines involving quaternion predictions (Hanson et al., 2022, James et al., 2022).
  • Employing SLERP for orientation interpolation, always choosing the shortest geodesic arc on S3S^3 [(Palais, 2010); (Díaz et al., 6 Nov 2025)].
  • Avoiding "straight-line" averaging or naive embeddings in Euclidean spaces, which do not respect the proper manifold structure. When mapping to feature spaces, geometric and topological consistency must be ensured (Beaufort et al., 2019).

Libraries such as Eigen, GLM, and DirectXMath efficiently implement quaternion algebra adhering to these principles (Brechet, 2022). Modern machine learning systems increasingly utilize quaternion, dual-quaternion, and rotation-invariant deep architectures for pose estimation, object recognition, and rigid motion modeling (Zhao et al., 2019, Vieira et al., 2023).


The quaternion representation of 3D rotations is a mathematically rigorous, topologically well-posed, and computationally advantageous approach, with applications extending throughout the applied and theoretical sciences as reflected in the references cited above [(Pellat-Finet, 2024); (Brechet, 2022); (Díaz et al., 6 Nov 2025); (Zhao et al., 2019); (Hanson et al., 2022); (Solà, 2017); (Palais, 2010); (Shen et al., 2019); (Hanson, 2018); (James et al., 2022); (Zoufaly et al., 21 Jan 2025); (Zhang et al., 2019); (Vieira et al., 2023); (O'Sullivan, 2015); (Beaufort et al., 2019)].

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Quaternion-Based 3D Rotations.