AffineDrift Logo AffineDrift Logo AffineDrift
  • Home
  • Read
    • The Physics of Golf
    • The Geometry of Motion
    • Proximal-to-Distal Technical Monograph
    • Books & Textbooks
    • Drifter Manifesto & Theory
    • Tangent-Space Series
    • Article Index
    • How a Golf Swing Carries Energy
    • Learning Paths
    • Critiques & Responses
    • Bibliography
  • Technology
    • Technology Overview

    • Force Measurement
    • Motion Capture
    • Markerless Mocap Camera Selection
    • Launch Monitors
    • Club Fitting Simulation
    • Multibody Impact Coupling
    • The Reference-Point Problem
  • Build
    • Programming Companion
    • Repositories

    • Datasets
    • Software Catalog
    • Interactive Tools
  • Connect
    • Resources Hub

    • About AffineDrift
    • Contact
    • Collaborate

    • Researchers
    • Websites
    • Videos
    • Papers & Research
    • NotebookLM

On this page

  • Background
  • Interactive Calculator
  • Mathematical Reference

Rotation Representation Converter

Interactive calculator for converting between rotation matrices, quaternions, ZYX Euler angles, axis-angle, and exponential coordinates β€” with 3D screw axis visualization and step-by-step formulas.

Rotation Representation Converter

Interactive calculator for converting between rotation matrices, quaternions, ZYX Euler angles, axis-angle, and exponential coordinates β€” with 3D screw axis visualization and step-by-step formulas.

Background

Every 3-D rotation can be described in multiple equivalent ways. This tool converts between the five most common representations and visualises the underlying screw axis in 3-D. Full derivations live in the Rotation Representations Reference.

Representation Parameters Key property
Rotation matrix \(R \in SO(3)\) 9 numbers \(R^\top R = I\), \(\det R = +1\)
Quaternion \(\mathbf{q} = (w, x, y, z)\) 4 numbers \(\lVert\mathbf{q}\rVert = 1\); double cover of \(SO(3)\)
ZYX Euler angles \((\psi, \theta, \phi)\) 3 numbers Yaw-pitch-roll; gimbal lock at \(\theta = \pm 90Β°\)
Axis-angle \((\hat{\mathbf{n}}, \theta)\) 4 numbers Rodrigues formula; undefined axis at \(\theta = 0\)
Exponential coordinates \(\boldsymbol{\omega} = \theta\hat{\mathbf{n}}\) 3 numbers Lie algebra \(\mathfrak{so}(3)\); \(\lVert\boldsymbol{\omega}\rVert = \theta\)
NoteProvenance

The Rodrigues formula, quaternion algebra, and ZYX Euler extraction follow Park & Lynch, Modern Robotics, Cambridge University Press, 2017, Chapters 3–4. All conversion functions implement the same algorithms as the Python reference in Rotation Representations Reference.


Interactive Calculator

Angle units: Edit any field to update all representations
Rotation Matrix $R \in SO(3)$
Quaternion $(w, x, y, z)$
ZYX Euler Angles $R = R_z(\psi)R_y(\theta)R_x(\phi)$
Axis-Angle $(\hat{\mathbf{n}}, \theta)$
Exponential Coordinates $\boldsymbol{\omega} = \theta\hat{\mathbf{n}}$
Properties
Rotation angle ΞΈ: β€”
Screw axis nΜ‚: β€”
det(R): β€”
β€–Rα΅€R βˆ’ Iβ€–βˆž: β€”
β€–qβ€–: β€”
Presets
Step-by-step Conversion Formulas
3-D Screw Axis Visualisation
πŸ–± Left-drag: orbit πŸ–± Scroll: zoom πŸ–± Right-drag: pan
WebGL not available β€” see Properties panel above for numeric results.

Mathematical Reference

Rodrigues Formula (Axis-Angle β†’ R)

Given unit axis \(\hat{\mathbf{n}}\) and angle \(\theta\):

\[R = I + \sin\theta \,[\hat{\mathbf{n}}]_\times + (1-\cos\theta)\,[\hat{\mathbf{n}}]_\times^2\]

where the skew-symmetric matrix is

\[[\hat{\mathbf{n}}]_\times = \begin{bmatrix}0 & -n_z & n_y \\ n_z & 0 & -n_x \\ -n_y & n_x & 0\end{bmatrix}.\]

Rotation Matrix β†’ Axis-Angle

\[\theta = \arccos\!\left(\frac{\operatorname{tr}(R)-1}{2}\right), \qquad \hat{\mathbf{n}} = \frac{1}{2\sin\theta}\begin{bmatrix}R_{32}-R_{23}\\R_{13}-R_{31}\\R_{21}-R_{12}\end{bmatrix}.\]

Special cases: \(\theta = 0\) (identity, axis undefined) and \(\theta = \pi\) (180Β° rotation, Shepperd’s method on diagonal).

Rotation Matrix β†’ Quaternion (Shepperd)

\[w = \tfrac{1}{2}\sqrt{1+\operatorname{tr}(R)}, \quad x = \frac{R_{32}-R_{23}}{4w}, \quad y = \frac{R_{13}-R_{31}}{4w}, \quad z = \frac{R_{21}-R_{12}}{4w}.\]

At \(\theta = 180Β°\) (where \(w \approx 0\)) the formula is numerically degenerate; the implementation uses the diagonal entries of \((R+I)/2\) instead.

Quaternion β†’ Rotation Matrix

\[R = \begin{bmatrix}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{bmatrix}.\]

Both \(\mathbf{q}\) and \(-\mathbf{q}\) produce identical \(R\) (double cover of \(SO(3)\)).

ZYX Euler Angles

Composition order: \(R = R_z(\psi) R_y(\theta) R_x(\phi)\). Extraction:

\[\psi = \operatorname{atan2}(R_{21}, R_{11}), \quad \theta = -\arcsin(R_{31}), \quad \phi = \operatorname{atan2}(R_{32}, R_{33}).\]

Gimbal lock occurs when \(\theta = \pm 90Β°\) (\(R_{31} = \mp 1\)). In that configuration \(\psi\) and \(\phi\) cannot be independently resolved; the implementation sets \(\phi = 0\) and encodes all remaining rotation in \(\psi\).

Exponential Coordinates

\(\boldsymbol{\omega} = \theta\hat{\mathbf{n}} \in \mathbb{R}^3\). The magnitude \(|\boldsymbol{\omega}| = \theta\) is the rotation angle; the direction \(\hat{\mathbf{n}} = \boldsymbol{\omega}/\theta\) is the screw axis. These are the coordinates of the Lie algebra \(\mathfrak{so}(3)\):

\[R = \exp([\boldsymbol{\omega}]_\times).\]


See also: Rotation Representations Reference β€” full derivations and Python implementation. Screw Theory Reference β€” SE(3) twists, wrenches, and product of exponentials.

AffineDrift β€” independent open research and governed technical publication

 
  • About & Authority

  • AffineDrift Source

  • UpstreamDrift Programs