# Euler–Rodrigues formula

In mathematics and mechanics, the Euler–Rodrigues formula describes the rotation of a vector in three dimensions. It is based on Rodrigues' rotation formula, but uses a different parametrization.
The rotation is described by four Euler parameters due to Leonhard Euler. The Rodrigues' rotation formula (named after Olinde Rodrigues), a method of calculating the position of a rotated point, is used in some software applications, such as flight simulators and computer games.

## Definition

A rotation about the origin is represented by four real numbers, a, b, c, d such that
    $a^{2}+b^{2}+c^{2}+d^{2}=1.$
When the rotation is applied, a point at position ${\vec {x}}$ rotates to its new position,
    ${\vec {x}}'={\begin{pmatrix}a^{2}+b^{2}-c^{2}-d^{2}&2(bc-ad)&2(bd+ac)\\2(bc+ad)&a^{2}+c^{2}-b^{2}-d^{2}&2(cd-ab)\\2(bd-ac)&2(cd+ab)&a^{2}+d^{2}-b^{2}-c^{2}\end{pmatrix}}{\vec {x}}.$

### Vector formulation

The parameter a may be called the scalar parameter and ${\vec {\omega }}=(b,c,d)$ the vector parameter. In standard vector notation, the Rodrigues rotation formula takes the compact form
${\vec {x}}'={\vec {x}}+2a({\vec {\omega }}\times {\vec {x}})+2\left({\vec {\omega }}\times ({\vec {\omega }}\times {\vec {x}})\right)$

### Symmetry

The parameters (a, b, c, d) and (−a, −b, −c, −d) describe the same rotation. Apart from this symmetry, every set of four parameters describes a unique rotation in three-dimensional space.

### Composition of rotations

The composition of two rotations is itself a rotation. Let (a$_1$, b$_1$, c$_1$, d$_1$) and (a$_2$, b$_2$, c$_2$, d$_2$) be the Euler parameters of two rotations. The parameters for the compound rotation (rotation 2 after rotation 1) are as follows:
    ${\begin{aligned}a&=a_{1}a_{2}-b_{1}b_{2}-c_{1}c_{2}-d_{1}d_{2};\\b&=a_{1}b_{2}+b_{1}a_{2}-c_{1}d_{2}+d_{1}c_{2};\\c&=a_{1}c_{2}+c_{1}a_{2}-d_{1}b_{2}+b_{1}d_{2};\\d&=a_{1}d_{2}+d_{1}a_{2}-b_{1}c_{2}+c_{1}b_{2}.\end{aligned}}$
It is straightforward, though tedious, to check that a$^2$ + b$^2$ + c$^2$ + d$^2$ = 1. (This is essentially Euler's four-square identity.)

## Rotation angle and rotation axis

Any central rotation in three dimensions is uniquely determined by its axis of rotation (represented by a unit vector k→ = (k$_x$, k$_y$, k$_z$)) and the rotation angle φ. The Euler parameters for this rotation are calculated as follows:
    ${\begin{aligned}a&=\cos {\frac {\varphi }{2}};\\b&=k_{x}\sin {\frac {\varphi }{2}};\\c&=k_{y}\sin {\frac {\varphi }{2}};\\d&=k_{z}\sin {\frac {\varphi }{2}}.\end{aligned}}$
Note that if φ is increased by a full rotation of 360 degrees, the arguments of sine and cosine only increase by 180 degrees. The resulting parameters are the opposite of the original values, (−a, −b, −c, −d); they represent the same rotation.
In particular, the identity transformation (null rotation, φ = 0) corresponds to parameter values (a, b, c, d) = (±1, 0, 0, 0). Rotations of 180 degrees about any axis result in a = 0.

## Connection with quaternions

The Euler parameters can be viewed as the coefficients of a quaternion; the scalar parameter a is the real part, the vector parameters b, c, d are the imaginary parts. Thus we have the quaternion
    $q=a+bi+cj+dk,$
which is a quaternion of unit length (or versor) since
    $\left\|q\right\|^{2}=a^{2}+b^{2}+c^{2}+d^{2}=1.$
Most importantly, the above equations for composition of rotations are precisely the equations for multiplication of quaternions $q=q_{2}\,q_{1}$. In other words, the group of unit quaternions with multiplication, modulo the negative sign, is isomorphic to the group of rotations with composition.
A rotation in 3D can thus be represented by a quaternion q:
    $q=\cos {\frac {\varphi }{2}}+\mathbf {k} \sin {\frac {\varphi }{2}},$
where:
* $\cos {\tfrac {\varphi }{2}}$ is the scalar (real) part,
* $\mathbf {k} \sin {\tfrac {\varphi }{2}}$ is the vector (imaginary) part,
* $\mathbf {k}$ is a unit vector representing the axis of rotation.
For a pure quaternion $X=0+\mathbf {v}$, the rotated vector $X'$ is given by:
    $X'=qXq^{-1},$
where $q^{-1}=\cos {\tfrac {\varphi }{2}}-\mathbf {k} \sin {\tfrac {\varphi }{2}}.$
To derive the quaternionic equivalent of the Euler-Rodrigues equation, substitute $q,q^{-1}$ and $X$ into $X'=qXq^{-1}$:
    $X'=\left(\cos {\frac {\varphi }{2}}+\mathbf {k} \sin {\frac {\varphi }{2}}\right)\left(0+\mathbf {v} \right)\left(\cos {\frac {\varphi }{2}}-\mathbf {k} \sin {\frac {\varphi }{2}}\right).$
Compute $qX$ first:
    $qX=\left(\cos {\frac {\varphi }{2}}+\mathbf {k} \sin {\frac {\varphi }{2}}\right)(0+\mathbf {v} ).$
Using quaternion multiplication rules:
    $qX=\underbrace {-\sin {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )} _{\text{scalar}}+\underbrace {\cos {\frac {\varphi }{2}}\mathbf {v} +\sin {\frac {\varphi }{2}}(\mathbf {k} \times \mathbf {v} )} _{\text{vector}}$
Now multiply $qX$ by $q^{-1}$:
    $X'=\left[-\sin {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )+\cos {\frac {\varphi }{2}}\mathbf {v} +\sin {\frac {\varphi }{2}}(\mathbf {k} \times \mathbf {v} )\right]\left(\cos {\frac {\varphi }{2}}-\mathbf {k} \sin {\frac {\varphi }{2}}\right).$
Expand the product into three parts:
Part 1: Scalar Term $\times q^{-1}$
    $-\sin {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\cdot \left(\cos {\frac {\varphi }{2}}-\mathbf {k} \sin {\frac {\varphi }{2}}\right).$
The scalar contribution is:
    $-\sin {\frac {\varphi }{2}}\cos {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} ).$
The vector contribution is:
    $\sin ^{2}{\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\mathbf {k} .$
Part 2: Vector Term $\times$ Scalar Part of $q^{-1}$
    $\cos {\frac {\varphi }{2}}\mathbf {v} \cdot \cos {\frac {\varphi }{2}}=\cos ^{2}{\frac {\varphi }{2}}\mathbf {v} .$
Part 3: Vector Term $\times$ Vector Part of $q^{-1}$
The vector term $\sin {\frac {\varphi }{2}}(\mathbf {k} \times \mathbf {v} )$ multiplied by $-\mathbf {k} \sin {\frac {\varphi }{2}}$ gives:
    $-\sin ^{2}{\frac {\varphi }{2}}(\mathbf {k} \times \mathbf {v} )\times \mathbf {k} .$
Using the vector identity $\mathbf {a} \times (\mathbf {b} \times \mathbf {c} )=\mathbf {b} (\mathbf {a} \cdot \mathbf {c} )-\mathbf {c} (\mathbf {a} \cdot \mathbf {b} )$, we get:
    $\sin ^{2}{\frac {\varphi }{2}}\left[\mathbf {k} (\mathbf {k} \cdot \mathbf {v} )-\mathbf {v} \right].$
Combine all terms
    $X'=\underbrace {\cos ^{2}{\frac {\varphi }{2}}\mathbf {v} } _{\text{Term 1}}-\underbrace {\sin ^{2}{\frac {\varphi }{2}}\mathbf {v} } _{\text{Term 2}}+\underbrace {2\cos {\frac {\varphi }{2}}\sin {\frac {\varphi }{2}}(\mathbf {k} \times \mathbf {v} )} _{\text{Term 3}}+\underbrace {2\sin ^{2}{\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\mathbf {k} } _{\text{Term 4}}.$
The factor of 2 in $2\sin ^{2}{\frac {\varphi }{2}}$ comes from two identical terms in the quaternion product expansion. These terms combine naturally due to the symmetry of the quaternion conjugation operation. The first term comes from the scalar-vector product
    $-\sin {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\cdot \left(-\mathbf {k} \sin {\frac {\varphi }{2}}\right)=\sin ^{2}{\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\mathbf {k} .$
The second term comes from the vector-vector product:
    $\sin ^{2}{\frac {\varphi }{2}}\left(\mathbf {k} \times \mathbf {v} \right)\times (-\mathbf {k} )=\sin ^{2}{\frac {\varphi }{2}}\left(\mathbf {k} \times \left(\mathbf {k} \times \mathbf {v} \right)\right)=\sin ^{2}{\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\mathbf {k} -\sin ^{2}{\frac {\varphi }{2}}\mathbf {v} .$
These two terms are identical and arise from different parts of the quaternion multiplication.
Simplify each term
1. Term 1 + Term 2:
    $\cos ^{2}{\frac {\varphi }{2}}\mathbf {v} -\sin ^{2}{\frac {\varphi }{2}}\mathbf {v} =\mathbf {v} \left(2\cos ^{2}{\frac {\varphi }{2}}-1\right)=\mathbf {v} \cos {\varphi }.$
2. Term 3:
Using $\sin \varphi =2\sin {\frac {\varphi }{2}}\cos {\frac {\varphi }{2}}$:
    $2\cos {\frac {\varphi }{2}}\sin {\frac {\varphi }{2}}(\mathbf {k} \times \mathbf {v} )=\sin \varphi (\mathbf {k} \times \mathbf {v} ).$
3. Term 4:
Using the double-angle identity $\sin ^{2}{\frac {\varphi }{2}}={\frac {1-\cos \varphi }{2}}$:
    $2\sin ^{2}{\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )\mathbf {k} =\left(1-\cos \varphi \right)(\mathbf {k} \cdot \mathbf {v} )\mathbf {k} .$
Combining all terms, we get the standard Euler-Rodrigues formula:
    $X'=\mathbf {v} '=\mathbf {v} \cos {\varphi }+(\mathbf {k} \times \mathbf {v} )\sin \varphi +\mathbf {k} (\mathbf {k} \cdot \mathbf {v} )(1-\cos \varphi ).$
When multiplying quaternions, the scalar part of the product arises from scalar $\times$ scalar terms and vector $\cdot$ vector terms (dot products). In the expansion of $qXq^{-1}$, the scalar contribution comes from:
    $-\sin {\frac {\varphi }{2}}\cos {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} ).$
The result of $X'=qXq^{-1}$ must be a pure quaternion (i.e., it has no scalar part) because $X$ is a pure quaternion (its scalar part is 0) and the conjugation $qXq^{-1}$ preserves the pure quaternion property.
Thus, any scalar terms generated during the intermediate steps of the quaternion multiplication must cancel out in the final result. The scalar contribution $-\sin {\frac {\varphi }{2}}\cos {\frac {\varphi }{2}}(\mathbf {k} \cdot \mathbf {v} )$ is canceled by an equal and opposite scalar term that arises from another part of the quaternion multiplication. After cancellation of the scalar terms, the result $X'$ is a pure quaternion $X'=0+\mathbf {v} '$. The vector part $\mathbf {v} '$ is given by the above Euler-Rodrigues formula.
It is important to note that $\mathbf {k} \not \equiv {\vec {\omega }}$. $\mathbf {k}$ is a unit vector along the axis of rotation. But ${\vec {\omega }}$ is defined to be
    ${\vec {\omega }}\equiv (b,c,d)=\mathbf {k} \sin {\frac {\varphi }{2}}$.
Using the identity:
    ${\vec {\omega }}\times ({\vec {\omega }}\times {\vec {x}})={\vec {\omega }}({\vec {\omega }}\cdot {\vec {x}})-{\vec {x}}({\vec {\omega }}\cdot {\vec {\omega }})$,
we arrive at the Euler-Rodrigues equation:
    $X'={\vec {x}}+2a({\vec {\omega }}\times {\vec {x}})+2({\vec {\omega }}\times ({\vec {\omega }}\times {\vec {x}})).$

## Connection with SU(2) spin matrices

The Lie group SU(2) can be used to represent three-dimensional rotations in complex 2 × 2 matrices. The SU(2)-matrix corresponding to a rotation, in terms of its Euler parameters, is
    $U={\begin{pmatrix}\ a-di&-c-bi\\c-bi&a+di\end{pmatrix}}.$
which can be written as the sum
    ${\begin{aligned}U&=a\ {\begin{pmatrix}1&0\\0&1\end{pmatrix}}-ib\ {\begin{pmatrix}0&1\\1&0\end{pmatrix}}-ic\ {\begin{pmatrix}0&-i\\i&0\end{pmatrix}}-id\ {\begin{pmatrix}1&0\\0&-1\end{pmatrix}}\\&=a\,I-ib\,\sigma _{x}-ic\,\sigma _{y}-id\,\sigma _{z},\end{aligned}}$
where the σ$_i$ are the Pauli spin matrices.
Rotation is given by $X^{\prime }\equiv (x_{1}^{\prime }\sigma _{x}+x_{2}^{\prime }\sigma _{y}+x_{3}^{\prime }\sigma _{z})=U\;X\;U^{\dagger }=(a\,I-ib\,\sigma _{x}-ic\,\sigma _{y}-id\,\sigma _{z})(x_{1}\sigma _{x}+x_{2}\sigma _{y}+x_{3}\sigma _{z})(a\,I+ib\,\sigma _{x}+ic\,\sigma _{y}+id\,\sigma _{z})$, which it can be confirmed by multiplying out gives the Euler–Rodrigues formula as stated above.
Thus, the Euler parameters are the real and imaginary coordinates in an SU(2) matrix corresponding to an element of the spin group Spin(3), which maps by a double cover mapping to a rotation in the orthogonal group SO(3). This realizes $\mathbb {R} ^{3}$ as the unique three-dimensional irreducible representation of the Lie group SU(2) ≈ Spin(3).

### Cayley–Klein parameters

The elements of the matrix $U$ are known as the Cayley–Klein parameters, after the mathematicians Arthur Cayley and Felix Klein,
    ${\begin{aligned}\alpha &=a-di&\beta &=-c-bi\\\gamma &=c-bi&\delta &=\ a+di\end{aligned}}$
In terms of these parameters the Euler–Rodrigues formula can then also be written
    ${\vec {x}}'={\begin{pmatrix}{\frac {1}{2}}(\alpha ^{2}-\gamma ^{2}+\delta ^{2}-\beta ^{2})&{\frac {1}{2}}i(\gamma ^{2}-\alpha ^{2}+\delta ^{2}-\beta ^{2})&\gamma \delta -\alpha \beta \\{\frac {1}{2}}i(\alpha ^{2}+\gamma ^{2}-\beta ^{2}-\delta ^{2})&{\frac {1}{2}}(\alpha ^{2}+\gamma ^{2}+\beta ^{2}+\delta ^{2})&-i(\alpha \beta +\gamma \delta )\\\beta \delta -\alpha \gamma &i(\alpha \gamma +\beta \delta )&\alpha \delta +\beta \gamma \end{pmatrix}}{\vec {x}}.$
Klein and Sommerfeld used the parameters extensively in connection with Möbius transformations and cross-ratios in their discussion of gyroscope dynamics.