# 四元数旋转探索器

交互式四元数旋转探索器——单位四元数、SO(3) 双重覆盖、Slerp 球面插值与万向锁

> 标准页面: https://elysiatools.com/zh/visualizations/quaternion-rotation-explorer

- **分类:** Math

## 概述

Interactive quaternion rotation explorer rendered with Three.js — the first case in the collection devoted to a NON-commutative algebraic structure (existing geometry cases like rose-mathematics, heart-curve, cycloid-trochoid live in commutative Euclidean space). Models the quaternion algebra H={a+b·i+c·j+d·k}, i²=j²=k²=ijk=−1 (Hamilton 1843): full Hamilton-product multiplication, conjugate, inverse, norm, and normalisation; axis-angle↔quaternion (q=(cos θ/2, n·sin θ/2)); quaternion↔rotation-matrix conversion (Shepperd's branch-stable matrix→quaternion method, verified round-trip to 1e-9); ZYX aerospace Euler-angle (yaw-pitch-roll) ↔ quaternion with PRECISE gimbal-lock detection (|sin(pitch)|>0.9999 flags the singularity where yaw and roll collapse). The unit quaternions form the 3-sphere S³ and DOUBLE-COVER SO(3): q and −q give the same rotation — the 2-to-1 map SU(2)→SO(3) is why quaternions parameterise ALL of SO(3) smoothly with no singularity (the edu card is careful to state gimbal lock is an EULER-angle phenomenon, not inherent to rotation matrices or quaternions). SLERP (spherical linear interpolation) walks the shortest great-circle arc: slerp(t)=(q₀·sin((1−t)Ω)+q₁·sin(tΩ))/sin(Ω), choosing the sign so q₀·q₁≥0 (the short way, ≤180°), with a near-linear fallback when the endpoints are within 0.0005. Composition = Hamilton product (q₂⊗q₁ applies q₁ first; order matters since quaternions do not commute). Core interaction: a deliberately ASYMMETRIC 3D object (six differently-coloured faces + forward arrow + local axes) is rotated by dragging it — an arc-ball delta quaternion in CAMERA space is left-multiplied onto the current orientation, so the handle behaves like grabbing the object itself; dragging empty space orbits the camera independently (separate yaw/pitch/dist), wheel zooms. Controls: live q=(w,x,y,z), axis·angle, |q|, double-cover readouts; ZYX Euler sliders (yaw ±180°, pitch ±90°, roll ±180°) with a pulsing GIMBAL LOCK badge when the pitch singularity is hit; a slerp timeline (t slider + ▶ animate loop, set-start / set-end from current orientation, start/end quaternion readouts); a composition chain (append current, apply, clear, per-item remove). 7 presets (identity, 90° about X/Y/Z, diagonal axis, gimbal-lock demo, 180° flip). Educational content covers the algebra H and non-commutativity, the SO(3) double cover, gimbal lock as an Euler-specific singularity, slerp on S³, composition via Hamilton product, and real applications (spacecraft/satellite attitude control, IMU sensor fusion, robotics, game engines, VR head tracking, molecular docking). Verified by 213 model tests (i·j=k / ijk=−1 defining relations, non-commutativity, identity/inverse, norm, axis-angle round-trip, quaternion↔matrix round-trip across 6 cases incl. near-180°, Euler round-trip in non-gimbal region, gimbal-lock detection at ±90° pitch, slerp endpoints/midpoint/monotonicity/short-path, composition order, double-cover equivalence of q and −q, length-preserving isometry, presets, world defaults). Multi-language support (zh, en, es, fr, de, ru, pt).

## 相关内容

- [零级反应 - Zero-Order Reaction](https://elysiatools.com/zh/visualizations/zero-order-reaction): 零级反应动力学和浓度随时间变化的交互式可视化
- [一级反应 - First-Order Reaction](https://elysiatools.com/zh/visualizations/first-order-reaction): 一级反应动力学和指数浓度衰减的交互式可视化
- [二级反应 - Second-Order Reaction](https://elysiatools.com/zh/visualizations/second-order-reaction): 二级反应动力学和双分子碰撞动力学的交互式可视化
- [阿伦尼乌斯方程 - Arrhenius Equation](https://elysiatools.com/zh/visualizations/arrhenius-equation): 温度对反应速率影响的交互式可视化 - 探索活化能、指数因子和速率常数的关系
- [可逆反应 - Reversible Reaction](https://elysiatools.com/zh/visualizations/reversible-reaction): A ⇌ B 可逆反应动力学的交互式可视化 - 探索正逆反应速率、平衡常数和浓度随时间的变化
- [连续反应 - Consecutive Reaction](https://elysiatools.com/zh/visualizations/consecutive-reaction): A → B → C 连续反应动力学的交互式可视化 - 探索中间物浓度峰值、决速步和所有物种的完整演化
- [链式反应 - Chain Reaction](https://elysiatools.com/zh/visualizations/chain-reaction): 自由基链式反应聚合的交互式可视化 - 探索引发、增长、终止步骤，链增长动画和分子量分布
- [勒夏特列原理 - Le Chatelier's Principle](https://elysiatools.com/zh/visualizations/le-chateliers-principle): 勒夏特列原理的交互式可视化 - 探索浓度、压强和温度变化如何影响化学平衡，配合分子动力学动画展示平衡移动过程
