<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=80.175.7.191</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=80.175.7.191"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/80.175.7.191"/>
	<updated>2026-05-02T07:49:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0-wmf.28</generator>
	<entry>
		<id>https://en.formulasearchengine.com/index.php?title=Greedy_algorithm_for_Egyptian_fractions&amp;diff=15176</id>
		<title>Greedy algorithm for Egyptian fractions</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=Greedy_algorithm_for_Egyptian_fractions&amp;diff=15176"/>
		<updated>2013-12-29T15:09:31Z</updated>

		<summary type="html">&lt;p&gt;80.175.7.191: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[geometry]], various &#039;&#039;&#039;formalisms&#039;&#039;&#039; exist to express a [[rotation (mathematics)|rotation]] in three [[dimension (vector space)|dimensions]] as a mathematical [[transformation (geometry)|transformation]]. In physics, this concept is applied to [[classical mechanics]] where rotational (or angular) [[kinematics]] is the science of [[quantity|quantitative]] description of a purely rotational [[motion (physics)|motion]]. The [[orientation (geometry)|orientation]] of an object at a given instant is described with the same tools, as it is defined as an imaginary rotation from a reference placement in space, rather than an actually observed rotation from a previous placement in space.&lt;br /&gt;
&lt;br /&gt;
According to [[Euler&#039;s rotation theorem]] the rotation of a [[rigid body]] (or three-dimensional [[coordinate system]] with the fixed [[origin (mathematics)|origin]]) is described by a single rotation about some axis. Such a rotation may be uniquely described by a minimum of three [[real number|real]] parameters. However, for various reasons, there are several ways to represent it. Many of these representations use more than the necessary minimum of three parameters, although each of them still has only three [[degrees of freedom (mechanics)|degrees of freedom]].&lt;br /&gt;
&lt;br /&gt;
An example where rotation representation is used is in [[computer vision]], where an [[automation|automated]] observer needs to track a target. Let&#039;s consider a rigid body, with three [[orthonormal basis|orthogonal unit vectors]]&amp;lt;!-- this kludge works around a sea of blue --&amp;gt; fixed to its body (representing the three axes of the object&#039;s local [[Cartesian coordinate system|coordinate system]]). The basic problem is to specify the orientation of these three [[unit vector]]s, and hence the rigid body, with respect to the observer&#039;s coordinate system, regarded as a reference placement in space.&lt;br /&gt;
&lt;br /&gt;
==Rotations and motions==&lt;br /&gt;
{{main|Motion (geometry)|Rotation (mathematics)}}&lt;br /&gt;
Rotation formalisms are focused on proper ([[orientation (vector space)|orientation-preserving]]) motions of the [[Euclidean space]] with [[stabilizer (group theory)|one fixed point]], that a &#039;&#039;rotation&#039;&#039; refers to. Although physical motions with a fixed point are an important case (such as ones described in the [[center-of-mass frame]], or motions of a [[joint (mechanics)|joint]]), this approach creates a knowledge about all motions. Any proper motion of the Euclidean space decomposes to a rotation around the origin and a [[translation (geometry)|translation]]. Whichever the order of their [[function composition|composition]] will be, the &amp;quot;pure&amp;quot; rotation component wouldn&#039;t change, uniquely determined by the complete motion.&lt;br /&gt;
&lt;br /&gt;
One can also understand &amp;quot;pure&amp;quot; rotations as [[linear map]]s in a [[vector space]] equipped with Euclidean structure, not as maps of [[point (geometry)|points]] of a corresponding [[affine space]]. In other words, a rotation formalism captures only the rotational part of a motion, that contains three degrees of freedom, and ignores the translational part, that contains another three.&lt;br /&gt;
&lt;br /&gt;
==Formalism alternatives==&lt;br /&gt;
&lt;br /&gt;
===Rotation matrix===&lt;br /&gt;
{{Main|Rotation matrix}}&lt;br /&gt;
&lt;br /&gt;
The above mentioned triad of [[unit vector]]s is also called a [[basis (linear algebra)|basis]]. Specifying [[real coordinate space|the coordinates]] (&#039;&#039;components&#039;&#039;&amp;lt;!-- “scalar component” is a gibberish  --Incnis Mrsi --&amp;gt;) of vectors of this basis in its current (rotated) position, in terms of the reference (non-rotated) coordinate axes, will completely describe the rotation. The three unit vectors &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{u}}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{v}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{w}}&amp;lt;/math&amp;gt; which form the rotated basis each consist of 3&amp;amp;nbsp;coordinates, yielding a total of 9&amp;amp;nbsp;parameters. These parameters can be written as the elements of a {{gaps|3|×|3}} matrix &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}&amp;lt;/math&amp;gt;, called a &#039;&#039;&#039;rotation matrix&#039;&#039;&#039;. Typically, the coordinates of each of these vectors are arranged along a column of the matrix (however, beware that an alternative definition of rotation matrix exists and is widely used, where the vectors coordinates defined above are arranged by rows&amp;lt;ref&amp;gt;Rotation Matrix, http://mathworld.wolfram.com/RotationMatrix.html&amp;lt;/ref&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{A} =&lt;br /&gt;
\left[ {\begin{array}{ccc}&lt;br /&gt;
   \hat{\mathbf{u}}_x &amp;amp; \hat{\mathbf{v}}_x &amp;amp; \hat{\mathbf{w}}_x \\&lt;br /&gt;
   \hat{\mathbf{u}}_y &amp;amp; \hat{\mathbf{v}}_y &amp;amp; \hat{\mathbf{w}}_y \\&lt;br /&gt;
   \hat{\mathbf{u}}_z &amp;amp; \hat{\mathbf{v}}_z &amp;amp; \hat{\mathbf{w}}_z \\&lt;br /&gt;
\end{array}} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The elements of the rotation matrix are not all independent—as Euler&#039;s rotation theorem dictates, the rotation matrix has only three degrees of freedom. The rotation matrix has the following properties:&lt;br /&gt;
* &#039;&#039;A&#039;&#039; is a real, [[orthogonal matrix]], hence each of its rows or columns represents a [[unit vector]].&lt;br /&gt;
* The [[eigenvalues]] of &#039;&#039;A&#039;&#039; are&lt;br /&gt;
::&amp;lt;math&amp;gt;\{1, e^{\pm i\theta} \} = \{1,\ \cos(\theta)+i\sin(\theta),\ \cos(\theta)-i\sin(\theta)\}&amp;lt;/math&amp;gt;&lt;br /&gt;
:where &#039;&#039;i&#039;&#039; is the standard [[imaginary unit]] with the property &#039;&#039;i&#039;&#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = −1&lt;br /&gt;
* The [[determinant]] of &#039;&#039;A&#039;&#039; is +1, equivalent to the product of its eigenvalues.&lt;br /&gt;
* The [[Trace (linear algebra)|trace]] of &#039;&#039;A&#039;&#039; is &amp;lt;math&amp;gt;\scriptstyle 1 \,+\, 2\cos(\theta)&amp;lt;/math&amp;gt;, equivalent to the sum of its eigenvalues.&lt;br /&gt;
&lt;br /&gt;
The angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; which appears in the eigenvalue expression corresponds to the angle of the Euler axis and angle representation. The [[eigenvector]] corresponding with the eigenvalue of 1 is the accompanying Euler axis, since the axis is the only (nonzero) vector which remains unchanged by left-multiplying (rotating) it with the rotation matrix.&lt;br /&gt;
&lt;br /&gt;
The above properties are equivalent to:&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
 |\hat{\mathbf u}| = |\hat{\mathbf v}| &amp;amp;= 1\\&lt;br /&gt;
 \hat{\mathbf u} \cdot \hat{\mathbf v} &amp;amp;= 0\\&lt;br /&gt;
 \hat{\mathbf u} \times \hat{\mathbf v} &amp;amp;= \hat{\mathbf w}&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which is another way of stating that &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf u},\, \hat{\mathbf v},\, \hat{\mathbf w}&amp;lt;/math&amp;gt; form a 3D [[orthonormal basis]]. Note that the statements above constitute a total of 6 conditions (the cross product contains 3), leaving the rotation matrix with just 3 degrees of freedom as required.&lt;br /&gt;
&lt;br /&gt;
Two successive rotations represented by matrices &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}_2&amp;lt;/math&amp;gt; are easily combined as follows:&lt;br /&gt;
&amp;lt;math&amp;gt;\scriptstyle \mathbf{A}_\text{total} \;=\; \mathbf{A}_2\mathbf{A}_1&amp;lt;/math&amp;gt; (Note the order, since the vector being rotated is multiplied from the right).&lt;br /&gt;
The ease by which vectors can be rotated using a rotation matrix, as well as the ease of combining successive rotations, make the rotation matrix a very useful and popular way to represent rotations, even though it is less concise than other representations.&lt;br /&gt;
&lt;br /&gt;
===Euler axis and angle (rotation vector)===&lt;br /&gt;
[[Image:Euler AxisAngle.png|thumb|right|A visualization of a rotation represented by an Euler axis and angle.]]&lt;br /&gt;
{{Main|Axis angle}}&lt;br /&gt;
From [[Euler&#039;s rotation theorem]] we know that any rotation can be expressed as a single rotation about some axis. The axis is the unit vector (unique except for sign) which remains unchanged by the rotation. The magnitude of the angle is also unique, with its sign being determined by the sign of the rotation axis.&lt;br /&gt;
&lt;br /&gt;
The axis can be represented as a three-dimensional [[unit vector]] &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{e}} \;=\; [e_x\ e_y\ e_z]^\mathrm{T}&amp;lt;/math&amp;gt;, and the angle by a scalar &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Since the axis is normalized, it has only two [[Degrees of freedom (mechanics)|degrees of freedom]]. The angle adds the third degree of freedom to this rotation representation. &lt;br /&gt;
&lt;br /&gt;
One may wish to express rotation as a &#039;&#039;&#039;rotation vector&#039;&#039;&#039;, a non-normalized three-dimensional vector the direction of which specifies the axis, and the length of which is &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;v = \theta \hat{\mathbf{e}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rotation vector is in some contexts useful, as it represents a three-dimensional rotation with only three [[scalar (mathematics)|scalar]] values (its components), representing the three degrees of freedom. This is also true for representations based on sequences of three Euler angles (see below).&lt;br /&gt;
&lt;br /&gt;
If the rotation angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; is zero, the axis is not uniquely defined.  Combining two successive rotations, each represented by an Euler axis and angle, is not straightforward, and in fact does not satisfy the law of vector addition, which shows that finite rotations are not really vectors at all. It is best to employ the rotation matrix or quaternion notation, calculate the product, and then convert back to Euler axis and angle.&lt;br /&gt;
&lt;br /&gt;
===Euler rotations===&lt;br /&gt;
[[Image:Praezession.svg|thumb|170px|Euler rotations of the Earth. [[Earth&#039;s rotation|Intrinsic]] (green), [[Axial precession|Precession]] (blue) and [[Nutation]] (red)]]&lt;br /&gt;
{{Main|Euler angles#Euler rotations}}&lt;br /&gt;
The idea behind Euler rotations is to split the complete rotation of the coordinate system into three simpler constitutive rotations, called [[Precession]], [[Nutation]], and [[rotation|intrinsic rotation]], being each one of them an increment on one of the [[Euler angles]]. Notice that the outer matrix will represent a rotation around one of the axes of the reference frame, and the inner matrix represents a rotation around one of the moving frame axis. The middle matrix represent a rotation around an intermediate axis called &#039;&#039;&#039;line of nodes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the definition of Euler angles is not unique and in the literature many different conventions are used. These conventions depend on the axes about which the rotations are carried out, and their sequence (since rotations are not [[commutativity|commutative]]). &lt;br /&gt;
&lt;br /&gt;
The convention being used is usually indicated by specifying the axes about which the consecutive rotations (before being composed) take place, referring to them by index (1, 2, 3) or letter (X, Y, Z). The engineering and robotics communities typically use 3-1-3 Euler angles. Notice that after composing the independent rotations, they do not rotate about their axis anymore. The most external matrix rotates the other two, leaving the second rotation matrix over the line of nodes, and the third one in a frame comoving with the body. There are {{gaps|3|×|3|×|3}}&amp;amp;nbsp;=&amp;amp;nbsp;27 possible combinations of three basic rotations but only {{gaps|3|×|2|×|2}}&amp;amp;nbsp;=&amp;amp;nbsp;12 of them can be used for representing arbitrary 3D rotations as Euler angles. These 12&amp;amp;nbsp;combinations avoid consecutive rotations around the same axis (such as XXY) which would reduce the degrees of freedom that can be represented.&lt;br /&gt;
&lt;br /&gt;
Therefore Euler angles are never expressed in terms of the external frame, or in terms of the co-moving rotated body frame, but in a mixture. Other conventions (e.g., [[rotation matrix]] or [[Quaternions and spatial rotation|quaternions]]) are used to avoid this problem.&lt;br /&gt;
&lt;br /&gt;
===Quaternions===&lt;br /&gt;
{{Main|Quaternions and spatial rotation}}&lt;br /&gt;
&lt;br /&gt;
[[Quaternion]]s, that form a four-dimensional [[vector space]], have proven very useful in representing rotations due to several advantages above the other representations mentioned in this article. &lt;br /&gt;
&lt;br /&gt;
A quaternion representation of rotation is written as a [[versor]] (normalized quaternion)&lt;br /&gt;
:&amp;lt;math&amp;gt;\hat{\mathbf{q}} = [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In terms of the Euler axis &lt;br /&gt;
:&amp;lt;math&amp;gt;\hat{\mathbf{e}} = [e_x\ e_y\ e_z]^\mathrm{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and angle &lt;br /&gt;
:&amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this versor&#039;s components are expressed as follows: &lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
 q_1 &amp;amp;= e_x\sin\left(\frac{\theta}{2}\right)\\&lt;br /&gt;
 q_2 &amp;amp;= e_y\sin\left(\frac{\theta}{2}\right)\\&lt;br /&gt;
 q_3 &amp;amp;= e_z\sin\left(\frac{\theta}{2}\right)\\&lt;br /&gt;
 q_4 &amp;amp;= \cos\left(\frac{\theta}{2}\right)&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above definition follows the convention as used in (Wertz 1980) and (Markley 2003). An alternative definition used in some publications defines the &amp;quot;scalar&amp;quot; term as the first quaternion element, with the other elements shifted down one position. (Coutsias 1999), (Schmidt 2001)&lt;br /&gt;
&lt;br /&gt;
Inspection shows that the quaternion parametrization obeys the following constraint:&lt;br /&gt;
:&amp;lt;math&amp;gt;q_1^2 + q_2^2 + q_3^2 + q_4^2 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last term (in our definition) is often called the scalar term, which has its origin in quaternions when understood as the mathematical extension of the complex numbers, written as &lt;br /&gt;
:&amp;lt;math&amp;gt;a + b i + c j + d k&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\{a, b, c, d\} \in \mathbb{R}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and where &amp;lt;math&amp;gt;\scriptstyle \{i,\, j,\, k\}&amp;lt;/math&amp;gt; are the [[hypercomplex number]]s satisfying&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lclrlcl}&lt;br /&gt;
 i^2 &amp;amp;=&amp;amp; j^2 &amp;amp;=&amp;amp; k^2 &amp;amp;=&amp;amp; -1\\&lt;br /&gt;
  ij &amp;amp;=&amp;amp; -ji &amp;amp;=&amp;amp; k&amp;amp;&amp;amp;\\&lt;br /&gt;
  jk &amp;amp;=&amp;amp; -kj &amp;amp;=&amp;amp; i&amp;amp;&amp;amp;\\&lt;br /&gt;
  ki &amp;amp;=&amp;amp; -ik &amp;amp;=&amp;amp; j&amp;amp;&amp;amp;&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quaternion multiplication, that is used to specify a [[function composition|composite]] rotation, is performed in the same manner as multiplication of [[complex numbers]], except that the order of elements must be taken into account, since multiplication is not commutative. In matrix notation we can write quaternion multiplication as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\tilde{\mathbf{q}}\otimes\mathbf{q} =&lt;br /&gt;
\left[ {\begin{array}{rrrr}&lt;br /&gt;
    q_4 &amp;amp;   q_3 &amp;amp; -q_2 &amp;amp;  q_1\\&lt;br /&gt;
   -q_3 &amp;amp;   q_4 &amp;amp;  q_1 &amp;amp;  q_2\\&lt;br /&gt;
    q_2 &amp;amp;  -q_1 &amp;amp;  q_4 &amp;amp;  q_3\\&lt;br /&gt;
   -q_1 &amp;amp;  -q_2 &amp;amp; -q_3 &amp;amp;  q_4&lt;br /&gt;
\end{array}} \right]&lt;br /&gt;
\left[ {\begin{array}{c}&lt;br /&gt;
   \tilde{q}_1\\&lt;br /&gt;
   \tilde{q}_2\\&lt;br /&gt;
   \tilde{q}_3\\&lt;br /&gt;
   \tilde{q}_4&lt;br /&gt;
\end{array}} \right] =&lt;br /&gt;
\left[ {\begin{array}{rrrr}&lt;br /&gt;
    \tilde{q}_4 &amp;amp;  -\tilde{q}_3 &amp;amp;  \tilde{q}_2 &amp;amp;  \tilde{q}_1\\&lt;br /&gt;
    \tilde{q}_3 &amp;amp;   \tilde{q}_4 &amp;amp; -\tilde{q}_1 &amp;amp;  \tilde{q}_2\\&lt;br /&gt;
   -\tilde{q}_2 &amp;amp;   \tilde{q}_1 &amp;amp;  \tilde{q}_4 &amp;amp;  \tilde{q}_3\\&lt;br /&gt;
   -\tilde{q}_1 &amp;amp;  -\tilde{q}_2 &amp;amp; -\tilde{q}_3 &amp;amp;  \tilde{q}_4&lt;br /&gt;
\end{array}} \right]&lt;br /&gt;
\left[ {\begin{array}{c}&lt;br /&gt;
   q_1\\&lt;br /&gt;
   q_2\\&lt;br /&gt;
   q_3\\&lt;br /&gt;
   q_4&lt;br /&gt;
\end{array}} \right]&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Combining two consecutive quaternion rotations is therefore just as simple as using the rotation matrix. Remember that two successive rotation matrices, &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}_1&amp;lt;/math&amp;gt; followed by &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}_2&amp;lt;/math&amp;gt;, are combined as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{A}_3 = \mathbf{A}_2\mathbf{A}_1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can represent this with quaternion parameters in a similarly concise way:&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{q}_3 = \mathbf{q}_2 \otimes \mathbf{q}_1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quaternions are a very popular parametrization due to the following properties:&lt;br /&gt;
*More compact than the matrix representation and less susceptible to [[round-off error]]s&lt;br /&gt;
*The quaternion elements vary continuously over the unit sphere in &amp;lt;math&amp;gt;\scriptstyle \mathbb{R}^4&amp;lt;/math&amp;gt;, (denoted by &amp;lt;math&amp;gt;\scriptstyle S^3&amp;lt;/math&amp;gt;) as the orientation changes, avoiding [[classification of discontinuities|discontinuous]] jumps (inherent to three-dimensional parameterizations)&lt;br /&gt;
*Expression of the rotation matrix in terms of quaternion parameters involves no [[trigonometric function]]s&lt;br /&gt;
*It is simple to combine two individual rotations represented as quaternions using a quaternion product&lt;br /&gt;
&lt;br /&gt;
Like rotation matrices, quaternions must sometimes be re-normalized due to rounding errors, to make sure that they correspond to valid rotations. The computational cost of re-normalizing a quaternion, however, is much less than for normalizing a {{gaps|3|×|3}} matrix.&lt;br /&gt;
&lt;br /&gt;
===Rodrigues parameters===&lt;br /&gt;
{{main|Euler–Rodrigues parameters}}&lt;br /&gt;
{{See also|Rodrigues&#039; rotation formula}}&lt;br /&gt;
&lt;br /&gt;
Rodrigues parameters can be expressed in terms of Euler axis and angle as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{r} = \hat{\mathbf{e}}\theta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This has a discontinuity at 180° (π radians): each vector, &#039;&#039;&#039;r&#039;&#039;&#039;, with a norm of π radians represent the same rotation as −&#039;&#039;&#039;r&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Similarly, the Gibbs representation can be expressed as follows: &lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{g} = \hat{\mathbf{e}}\tan\left(\frac{\theta}{2}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
A rotation g followed by a rotation f in Gibbs representation has the form&lt;br /&gt;
:&amp;lt;math&amp;gt;(\mathbf{g},\mathbf{f}) = \frac{\mathbf{g}+\mathbf{f}-\mathbf{f}\times\mathbf{g}}{1-\mathbf{g}\cdot\mathbf{f}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Gibbs vector&#039;&#039;&#039; has the advantage (or disadvantage, depending on context) that 180° rotations cannot be represented. (Even using [[floating point]] numbers that include infinity, rotation direction cannot be well-defined; for example, naively a 180° rotation about the axis (1, 1, 0) would be &amp;lt;math&amp;gt;\scriptstyle (\infty,\, \infty,\, 0)&amp;lt;/math&amp;gt;, which is the same representation as 180° rotation about (1, 0.0001, 0).)&lt;br /&gt;
&lt;br /&gt;
Modified Rodrigues parameters (MRPs) can be expressed in terms of Euler axis and angle by: &lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{p} = \hat{\mathbf{e}}\tan\left(\frac{\theta}{4}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The modified Rodrigues parameterization shares many characteristics with the rotation vector parametrization, including the occurrence of discontinuous jumps in the parameter space when incrementing the rotation.&lt;br /&gt;
&lt;br /&gt;
===Cayley–Klein parameters===&amp;lt;!--&#039;Cayley–Klein parameters&#039; redirects here--&amp;gt;&lt;br /&gt;
{{section stub|date=September 2013}}&lt;br /&gt;
See definition at [http://mathworld.wolfram.com/Cayley-KleinParameters.html Wolfram Mathworld].&lt;br /&gt;
&lt;br /&gt;
===Higher dimensional analogues===&lt;br /&gt;
{{See also|Rotations in 4-dimensional Euclidean space}}&lt;br /&gt;
&lt;br /&gt;
==Conversion formulae between formalisms==&lt;br /&gt;
&lt;br /&gt;
===Rotation matrix ↔ Euler angles===&lt;br /&gt;
The Euler angles &amp;lt;math&amp;gt;\scriptstyle (\phi,\, \theta,\, \psi)&amp;lt;/math&amp;gt; can be extracted from the rotation matrix &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}&amp;lt;/math&amp;gt; by inspecting the rotation matrix in analytical form. &lt;br /&gt;
&lt;br /&gt;
Using the x-convention, the 3-1-3 Euler angles &amp;lt;math&amp;gt;\scriptstyle \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle \psi&amp;lt;/math&amp;gt; (around the &amp;lt;math&amp;gt;\scriptstyle Z&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\scriptstyle X&amp;lt;/math&amp;gt; and again the &amp;lt;math&amp;gt;\scriptstyle Z&amp;lt;/math&amp;gt;-axis) can be obtained as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
 \phi   &amp;amp;=  \operatorname{arctan2}(A_{31}, A_{32})\\&lt;br /&gt;
 \theta &amp;amp;=  \arccos(A_{33})\\&lt;br /&gt;
 \psi   &amp;amp;= -\operatorname{arctan2}(A_{13}, A_{23})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;math&amp;gt;\scriptstyle \operatorname{arctan2}(a,\, b)&amp;lt;/math&amp;gt; is equivalent to &amp;lt;math&amp;gt;\scriptstyle \arctan(a/b)&amp;lt;/math&amp;gt; where it also takes into account the [[Cartesian coordinate system#Cartesian coordinates in two dimensions|quadrant]] that the point &amp;lt;math&amp;gt;\scriptstyle (a,\, b)&amp;lt;/math&amp;gt; is in; see [[atan2]].&lt;br /&gt;
&lt;br /&gt;
When implementing the conversion, one has to take into account several situations:&amp;lt;ref&amp;gt;[http://cmp.felk.cvut.cz/cmp/courses/ROB/roblec/serial-noteeng.pdf Direct and inverse kinematics] lecture notes, page 5&amp;lt;/ref&amp;gt;&lt;br /&gt;
* There are generally two solutions in (−π,&amp;amp;nbsp;π]&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; interval. The above formula works only when &amp;lt;math&amp;gt;\theta &amp;lt;/math&amp;gt; is from the interval [0,&amp;amp;nbsp;π)&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* For special case &amp;lt;math&amp;gt;\scriptstyle A_{33} \;=\; 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\scriptstyle \phi,\, \psi&amp;lt;/math&amp;gt; shall be derived from &amp;lt;math&amp;gt;\scriptstyle A_{11},\, A_{12}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* There is infinitely many but countably many solutions outside of interval (−π,&amp;amp;nbsp;π]&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* Whether all mathematical solutions apply for given application depends on the situation.&lt;br /&gt;
&lt;br /&gt;
The rotation matrix &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}&amp;lt;/math&amp;gt; is generated from the Euler angles by multiplying the three matrices generated by rotations about the axes. &lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{A} = \mathbf{A}_3\mathbf{A}_2\mathbf{A}_1 = \mathbf{A}_Z\mathbf{A}_Y\mathbf{A}_X&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The axes of the rotation depend on the specific convention being used. For the &#039;&#039;x&#039;&#039;-convention the rotations are about the &amp;lt;math&amp;gt;\scriptstyle X&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\scriptstyle Y&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle Z&amp;lt;/math&amp;gt; axes with angles &amp;lt;math&amp;gt;\scriptstyle \phi&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle \psi&amp;lt;/math&amp;gt;, the individual matrices are as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
 \mathbf{A}_X &amp;amp;= \left[\begin{array}{ccc} 1 &amp;amp; 0 &amp;amp; 0\\ 0 &amp;amp; \cos\phi &amp;amp; \sin\phi\\ 0 &amp;amp; -\sin\phi &amp;amp; \cos\phi \end{array} \right]\\&lt;br /&gt;
 \mathbf{A}_Y &amp;amp;= \left[\begin{array}{ccc} \cos\theta &amp;amp; 0 &amp;amp; -\sin\theta\\ 0 &amp;amp; 1 &amp;amp; 0\\ \sin\theta &amp;amp; 0 &amp;amp; \cos\theta \end{array} \right]\\&lt;br /&gt;
 \mathbf{A}_Z &amp;amp;= \left[\begin{array}{ccc} \cos\psi &amp;amp; \sin\psi &amp;amp; 0\\ -\sin\psi &amp;amp; \cos\psi &amp;amp; 0\\ 0 &amp;amp; 0 &amp;amp; 1 \end{array} \right]&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This yields&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{array}{lcl}&lt;br /&gt;
 \mathbf{A} &amp;amp;=&amp;amp; \begin{bmatrix}&lt;br /&gt;
  \cos\theta \cos\psi &amp;amp; \cos\phi \sin\psi + \sin\phi \sin\theta \cos\psi &amp;amp;   \sin\phi \sin\psi - \cos\phi \sin\theta \cos\psi \\&lt;br /&gt;
  -\cos\theta \sin\psi &amp;amp;  \cos\phi \cos\psi - \sin\phi \sin\theta \sin\psi &amp;amp; \sin\phi \cos\psi + \cos\phi \sin\theta \sin\psi \\&lt;br /&gt;
  \sin\theta             &amp;amp;  -\sin\phi \cos\theta                                          &amp;amp;   \cos\phi \cos\theta \\&lt;br /&gt;
 \end{bmatrix}&lt;br /&gt;
\end{array}&amp;lt;/math&amp;gt;&lt;br /&gt;
Note: This is valid for a right-hand system, which is the convention used in almost all engineering and physics disciplines.&lt;br /&gt;
&lt;br /&gt;
===Rotation matrix ↔ Euler axis/angle===&lt;br /&gt;
{{merge section from|Rotation matrix#Conversion from and to axis-angle|date=September 2013}}&lt;br /&gt;
If the Euler angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; is not a multiple of &amp;lt;math&amp;gt;\scriptstyle \pi&amp;lt;/math&amp;gt;, the Euler axis &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{e}} \;=\; [e_1\ e_2\ e_3]^\mathrm{T}&amp;lt;/math&amp;gt; and angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; can be computed from the elements of the rotation matrix &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}&amp;lt;/math&amp;gt; as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
 \theta &amp;amp;= \arccos\left(\frac{1}{2}[A_{11}+A_{22}+A_{33}-1]\right)\\&lt;br /&gt;
    e_1 &amp;amp;= \frac{A_{32}-A_{23}}{2\sin\theta}\\&lt;br /&gt;
    e_2 &amp;amp;= \frac{A_{13}-A_{31}}{2\sin\theta}\\&lt;br /&gt;
    e_3 &amp;amp;= \frac{A_{21}-A_{12}}{2\sin\theta}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, the following method can be used:&lt;br /&gt;
&lt;br /&gt;
Eigen-decomposition of the rotation matrix yields the eigenvalues 1, and &amp;lt;math&amp;gt;\scriptstyle \cos\theta \pm i\sin\theta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The Euler axis is the eigenvector corresponding to the eigenvalue of 1, and the &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; can be computed from the remaining eigenvalues.&lt;br /&gt;
&lt;br /&gt;
The Euler axis can be also found using Singular Value Decomposition since it is the normalized vector spanning the null-space of the matrix &amp;lt;math&amp;gt;\scriptstyle I \,-\, A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To convert the other way the rotation matrix corresponding to an Euler axis &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{e}} \;=\; [e_1\ e_2\ e_3]^\mathrm{T}&amp;lt;/math&amp;gt; and angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; can be computed according to the [[Rodrigues&#039; rotation formula]] (with appropriate modification&amp;lt;!-- the article referenced describes an active rotation whereas this article describes a passive rotation, thus the sign difference --&amp;gt;) as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{A} = \mathbf{I}_3\cos\theta + (1-\cos\theta)\hat{\mathbf{e}}\hat{\mathbf{e}}^\mathrm{T} + [\hat{\mathbf{e}}]_{\times} \sin\theta&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;\scriptstyle \mathbf{I}_3&amp;lt;/math&amp;gt; the {{gaps|3|×|3}} [[identity matrix]], and&lt;br /&gt;
:&amp;lt;math&amp;gt;[\hat{\mathbf{e}}]_{\times} = \left[\begin{array}{ccc} 0 &amp;amp; -e_3 &amp;amp; e_2\\ e_3 &amp;amp; 0 &amp;amp; -e_1\\ -e_2 &amp;amp; e_1 &amp;amp; 0 \end{array} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is the [[Cross product#Conversion to matrix multiplication|cross-product matrix]].&lt;br /&gt;
&lt;br /&gt;
===Rotation matrix ↔ quaternion===&lt;br /&gt;
When computing a quaternion from the rotation matrix there is a sign ambiguity, since &amp;lt;math&amp;gt;\scriptstyle \mathbf{q}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle -\mathbf{q}&amp;lt;/math&amp;gt; represent the same rotation.&lt;br /&gt;
&lt;br /&gt;
One way of computing the quaternion &amp;lt;math&amp;gt;\scriptstyle \mathbf{q} \;=\; [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt; from the rotation matrix &amp;lt;math&amp;gt;\scriptstyle \mathbf{A}&amp;lt;/math&amp;gt; is as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
 q_4 &amp;amp;= \frac{1}{2}\sqrt{1+A_{11}+A_{22}+A_{33}}\\&lt;br /&gt;
 q_1 &amp;amp;= \frac{1}{4q_4}(A_{32}- A_{23})\\&lt;br /&gt;
 q_2 &amp;amp;= \frac{1}{4q_4}(A_{13}- A_{31})\\&lt;br /&gt;
 q_3 &amp;amp;= \frac{1}{4q_4}(A_{21}- A_{12})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are three other mathematically equivalent ways to compute &amp;lt;math&amp;gt;\scriptstyle \mathbf{q}&amp;lt;/math&amp;gt;. Numerical inaccuracy can be reduced by avoiding situations in which the denominator is close to zero. One of the other three methods looks as follows:&amp;lt;ref&amp;gt;{{cite arxiv|last = Mebius|first = Johan|arxiv = math/0701759|title = Derivation of the Euler–Rodrigues formula for three-dimensional rotations from the general formula for four-dimensional rotations| year = 2007}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
 q_1 &amp;amp;= \frac{1}{2}\sqrt{1 + A_{11} - A_{22} - A_{33}}\\&lt;br /&gt;
 q_2 &amp;amp;= \frac{1}{4q_1}(A_{12} + A_{21})\\&lt;br /&gt;
 q_3 &amp;amp;= \frac{1}{4q_1}(A_{13} + A_{31})\\&lt;br /&gt;
 q_4 &amp;amp;= \frac{1}{4q_1}(A_{32} - A_{23})&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rotation matrix corresponding to the quaternion &amp;lt;math&amp;gt;\scriptstyle \mathbf{q} \;=\; [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt; can be computed as follows:&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{A} = (q_4^2 - \check{\mathbf{q}}^\mathrm{T}\check{\mathbf{q}})\mathbf{I}_3 + 2\check{\mathbf{q}}\check{\mathbf{q}}^\mathrm{T} + 2q_4\mathbf{\mathcal{Q}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;\scriptstyle \mathbf{I}_3&amp;lt;/math&amp;gt; the {{gaps|3|×|3}} identity matrix, and&lt;br /&gt;
:&amp;lt;math&amp;gt;\check{\mathbf{q}} = \left[\begin{array}{c} q_1\\q_2\\q_3\end{array} \right],\ \ \ \mathbf{\mathcal{Q}} = \left[\begin{array}{ccc} 0 &amp;amp; -q_3 &amp;amp; q_2\\ q_3 &amp;amp; 0 &amp;amp; -q_1\\ -q_2 &amp;amp; q_1 &amp;amp; 0 \end{array} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which gives&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{A} = \left[\begin{array}{ccc}&lt;br /&gt;
 1 - 2q_2^2 - 2q_3^2 &amp;amp; 2(q_1q_2 - q_3q_4)  &amp;amp; 2(q_1q_3 + q_2q_4)\\&lt;br /&gt;
 2(q_1q_2 + q_3q_4)  &amp;amp; 1 - 2q_1^2- 2 q_3^2 &amp;amp; 2(q_2q_3 - q_1q_4)\\&lt;br /&gt;
 2(q_1q_3 - q_2q_4)  &amp;amp; 2(q_1q_4 + q_2q_3)  &amp;amp; 1 - 2q_1^2 - 2q_2^2&lt;br /&gt;
\end{array} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or equivalently&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{A} = \left[\begin{array}{ccc}&lt;br /&gt;
 -1 + 2q_1^2 + 2q_4^2 &amp;amp; 2(q_1q_2 - q_3q_4)   &amp;amp; 2(q_1q_3 + q_2q_4)\\&lt;br /&gt;
 2(q_1q_2 + q_3q_4)   &amp;amp; -1 + 2q_2^2 + 2q_4^2 &amp;amp; 2(q_2q_3 - q_1q_4)\\&lt;br /&gt;
 2(q_1q_3 - q_2q_4)   &amp;amp; 2(q_1q_4 + q_2q_3)   &amp;amp; -1 + 2q_3^2 + 2q_4^2&lt;br /&gt;
\end{array} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Euler angles ↔ quaternion===&lt;br /&gt;
{{main|Conversion between quaternions and Euler angles}}&lt;br /&gt;
We will consider the x-convention 3-1-3 Euler Angles for the following algorithm.  The terms of the algorithm depend on the convention used.&lt;br /&gt;
&lt;br /&gt;
We can compute the quaternion &amp;lt;math&amp;gt;\scriptstyle \mathbf{q} = [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt; from the Euler angles &amp;lt;math&amp;gt;\scriptstyle (\phi,\, \theta,\, \psi)&amp;lt;/math&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
 q_1 &amp;amp;= \cos\left(\frac{\phi - \psi}{2}\right)\sin\left(\frac{\theta}{2}\right)\\&lt;br /&gt;
 q_2 &amp;amp;= \sin\left(\frac{\phi - \psi}{2}\right)\sin\left(\frac{\theta}{2}\right)\\&lt;br /&gt;
 q_3 &amp;amp;= \sin\left(\frac{\phi + \psi}{2}\right)\cos\left(\frac{\theta}{2}\right)\\&lt;br /&gt;
 q_4 &amp;amp;= \cos\left(\frac{\phi + \psi}{2}\right)\cos\left(\frac{\theta}{2}\right)&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given the rotation quaternion &amp;lt;math&amp;gt;\scriptstyle \mathbf{q} = [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt;, the x-convention 3-1-3 Euler angles &amp;lt;math&amp;gt;\scriptstyle (\phi,\, \theta,\, \psi)&amp;lt;/math&amp;gt; can be computed by&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
 \phi   &amp;amp;=  \arctan2((q_1q_3 + q_2q_4), -(q_2q_3 - q_1q_4))\\&lt;br /&gt;
 \theta &amp;amp;=  \arccos(-q_1^2 - q_2^2 + q_3^2+q_4^2)\\&lt;br /&gt;
 \psi   &amp;amp;= \arctan2((q_1q_3 - q_2q_4), (q_2q_3 + q_1q_4))&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Euler axis/angle ↔ quaternion===&lt;br /&gt;
Given the Euler axis &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{e}}&amp;lt;/math&amp;gt; and angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt;, the quaternion &lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{q} = [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
can be computed by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
 q_1 &amp;amp;= \hat{e}_1\sin\left(\frac{\theta}{2}\right) \\&lt;br /&gt;
 q_2 &amp;amp;= \hat{e}_2\sin\left(\frac{\theta}{2}\right) \\&lt;br /&gt;
 q_3 &amp;amp;= \hat{e}_3\sin\left(\frac{\theta}{2}\right) \\&lt;br /&gt;
 q_4 &amp;amp;= \cos\left(\frac{\theta}{2}\right)&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given the rotation quaternion &amp;lt;math&amp;gt;\scriptstyle \mathbf{q} \;=\; [q_1\ q_2\ q_3\ q_4]^\mathrm{T}&amp;lt;/math&amp;gt;, define &amp;lt;math&amp;gt;\scriptstyle \check{\mathbf{q}} \;=\; [q_1\ q_2\ q_3]^\mathrm{T}&amp;lt;/math&amp;gt;. Then the Euler axis &amp;lt;math&amp;gt;\scriptstyle \hat{\mathbf{e}}&amp;lt;/math&amp;gt; and angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; can be computed by&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
 \hat{\mathbf{e}} &amp;amp;= \frac{\check{\mathbf{q}}}{\|\check{\mathbf{q}}\|} \\&lt;br /&gt;
 \theta &amp;amp;= 2\arccos(q_4)&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conversion formulae for derivatives==&lt;br /&gt;
&lt;br /&gt;
===Rotation matrix ↔ angular velocities===&lt;br /&gt;
The angular velocity vector &amp;lt;math&amp;gt;\scriptstyle \mathbf{\omega} \;=\; (\omega_x,\, \omega_y,\, \omega_z)&amp;lt;/math&amp;gt; can be extracted from the derivative of the rotation matrix &amp;lt;math&amp;gt;\scriptstyle \frac{d\mathbf{A}}{dt}&amp;lt;/math&amp;gt; by the following relation:&lt;br /&gt;
:&amp;lt;math&amp;gt;[\mathbf{\omega}]_\times = \left[\begin{array}{ccc} 0 &amp;amp; -\omega_z &amp;amp; \omega_y \\ \omega_z &amp;amp; 0 &amp;amp; -\omega_x \\ -\omega_y &amp;amp; \omega_x &amp;amp; 0 \end{array} \right] = \frac{d\mathbf{A}}{dt}\mathbf{A}^\mathrm{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivation is adapted from &amp;lt;ref&amp;gt;[http://www.euclideanspace.com/physics/kinematics/angularvelocity/mark.htm] Physics - Mark Ioffe - W(t) in terms of matrices&amp;lt;/ref&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
For any vector &amp;lt;math&amp;gt;\scriptstyle r_0&amp;lt;/math&amp;gt; consider &amp;lt;math&amp;gt;\scriptstyle r(t) \;=\; \mathbf{A}(t) r_0&amp;lt;/math&amp;gt; and differentiate it:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{dr}{dt} = \frac{d\mathbf{A}}{dt} r_0 = \frac{d\mathbf{A}}{dt} \mathbf{A}^\mathrm{T}(t) r(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of a vector is the [[Velocity vector|linear velocity]] of its tip. Since &#039;&#039;A&#039;&#039; is a rotation matrix, by definition the length of &amp;lt;math&amp;gt;\scriptstyle r(t)&amp;lt;/math&amp;gt; is always equal to the length of &amp;lt;math&amp;gt;\scriptstyle r_0&amp;lt;/math&amp;gt;, and hence it does not change with time. Thus, when &amp;lt;math&amp;gt;\scriptstyle r(t)&amp;lt;/math&amp;gt; rotates, its tip moves along a circle, and the linear velocity of its tip is tangential to the circle; i.e., always perpendicular to &amp;lt;math&amp;gt;\scriptstyle r(t)&amp;lt;/math&amp;gt;. In this specific case, the relationship between the linear velocity vector and the angular velocity vector is &lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{dr}{dt} = \mathbf{\omega}(t)\times r(t) = [\mathbf{\omega}]_\times r(t)&amp;lt;/math&amp;gt; (see [[circular motion]] and [[Cross product#Conversion to matrix multiplication|Cross product]]).&lt;br /&gt;
&lt;br /&gt;
By the [[transitive relation|transitivity]] of the above mentioned equations,  &lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{d\mathbf{A}}{dt} \mathbf{A}^\mathrm{T}(t) r(t) = [\mathbf{\omega}]_\times r(t)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which implies ([[Q.E.D.]]),&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{d\mathbf{A}}{dt} \mathbf{A}^\mathrm{T}(t) = [\mathbf{\omega}]_\times&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quaternion ↔ angular velocities===&lt;br /&gt;
The angular velocity vector &amp;lt;math&amp;gt;\scriptstyle \mathbf{\omega} \;=\; (\omega_x,\, \omega_y,\, \omega_z)&amp;lt;/math&amp;gt; can be obtained from the derivative of the quaternion &amp;lt;math&amp;gt;\scriptstyle \frac{d\mathbf{q}}{dt}&amp;lt;/math&amp;gt; as follows:&amp;lt;ref&amp;gt;[http://www.euclideanspace.com/physics/kinematics/angularvelocity/] Physics - Kinematics - Angular Velocity&amp;lt;/ref&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \left[ {\begin{array}{c}&lt;br /&gt;
   0 \\&lt;br /&gt;
   \omega_x \\&lt;br /&gt;
   \omega_y \\&lt;br /&gt;
   \omega_z&lt;br /&gt;
\end{array}} \right] = 2 \frac{d\mathbf{q}}{dt} \otimes \tilde{\mathbf{q}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt; \tilde{\mathbf{q}} &amp;lt;/math&amp;gt; is the inverse of &amp;lt;math&amp;gt; \mathbf{q} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Conversely, the derivative of the quaternion is&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{d\mathbf{q}}{dt} = \frac{1}{2}\left[ {\begin{array}{c}&lt;br /&gt;
   0 \\&lt;br /&gt;
   \omega_x\\&lt;br /&gt;
   \omega_y\\&lt;br /&gt;
   \omega_z&lt;br /&gt;
\end{array}} \right] \otimes \mathbf{q}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rotors in a geometric algebra==&lt;br /&gt;
{{merge section to|Geometric algebra#Rotations|date=September 2013}}&lt;br /&gt;
The formalism of [[geometric algebra]] (GA) provides an extension and interpretation of the quaternion method.  Central to GA is the geometric product of vectors, an extension of the traditional [[inner product|inner]] and [[cross product]]s, given by&lt;br /&gt;
:&amp;lt;math&amp;gt;ab = a \cdot b + a \wedge b&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the symbol &amp;lt;math&amp;gt;\scriptstyle \wedge&amp;lt;/math&amp;gt; denotes the [[outer product]].  This product of vectors &amp;lt;math&amp;gt;\scriptstyle a,\, b&amp;lt;/math&amp;gt; produces two terms:  a scalar part from the inner product and a [[bivector]] part from the outer product.  This bivector describes the plane perpendicular to what the cross product of the vectors would return.&lt;br /&gt;
&lt;br /&gt;
Bivectors in GA have some unusual properties compared to vectors.  Under the geometric product, bivectors have negative square: the bivector &amp;lt;math&amp;gt;\scriptstyle \hat x \hat y&amp;lt;/math&amp;gt; describes the &amp;lt;math&amp;gt;\scriptstyle xy&amp;lt;/math&amp;gt;-plane.  Its square is &amp;lt;math&amp;gt;\scriptstyle (\hat x \hat y)^2 \;=\; \hat x \hat y \hat x \hat y&amp;lt;/math&amp;gt;.  Because the unit basis vectors are orthogonal to each other, the geometric product reduces to the antisymmetric outer product – &amp;lt;math&amp;gt;\scriptstyle \hat x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle \hat y&amp;lt;/math&amp;gt; can be swapped freely at the cost of a factor of&amp;amp;nbsp;−1.  The square reduces to &amp;lt;math&amp;gt;\scriptstyle -\hat x \hat x \hat y \hat y \;=\; -1&amp;lt;/math&amp;gt; since the basis vectors themselves square to +1.&lt;br /&gt;
&lt;br /&gt;
This result holds generally for all bivectors, and as a result the bivector plays a role similar to the [[imaginary unit]].  Geometric algebra uses bivectors in its analogue to the quaternion, the &#039;&#039;rotor,&#039;&#039; given by &amp;lt;math&amp;gt;\scriptstyle R \;=\; \exp\left(\frac{-\hat B\theta}{2}\right) \;=\; \cos \frac{\theta}{2} \,-\, \hat B \sin \frac{\theta}{2}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt; \scriptstyle \hat B&amp;lt;/math&amp;gt; is a unit bivector that describes the [[plane of rotation]].  Because &amp;lt;math&amp;gt; \scriptstyle \hat B&amp;lt;/math&amp;gt; squares to −1, the [[power series]] expansion of &amp;lt;math&amp;gt;\scriptstyle R&amp;lt;/math&amp;gt; generates the [[trigonometric function]]s.  The rotation formula that maps a vector &amp;lt;math&amp;gt;\scriptstyle a&amp;lt;/math&amp;gt; to a rotated vector &amp;lt;math&amp;gt;\scriptstyle b &amp;lt;/math&amp;gt; is then&lt;br /&gt;
:&amp;lt;math&amp;gt;b = R a R^\dagger&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\scriptstyle R^\dagger \;=\; \exp\left(\frac{1}{2}\hat B \theta\right) \;=\; \cos \frac{1}{2}\theta \,+\, \hat B \sin \frac{1}{2}\theta&amp;lt;/math&amp;gt; is the &#039;&#039;reverse&#039;&#039; of &amp;lt;math&amp;gt;\scriptstyle R&amp;lt;/math&amp;gt; (reversing the order of the vectors in &amp;lt;math&amp;gt;\scriptstyle B&amp;lt;/math&amp;gt; is equivalent to changing its sign).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example.&#039;&#039;&#039;  A rotation about the axis &amp;lt;math&amp;gt;\scriptstyle \hat v \;=\; \frac{1}{\sqrt{3}}(\hat x \,+\, \hat y \,+\, \hat z)&amp;lt;/math&amp;gt; can be accomplished by converting &amp;lt;math&amp;gt;\scriptstyle \hat v&amp;lt;/math&amp;gt; to its dual bivector, &amp;lt;math&amp;gt;\scriptstyle \hat B  \;=\; \hat x \hat y \hat z \hat v \;=\; i \hat v&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\scriptstyle i \;=\; \hat x \hat y \hat z&amp;lt;/math&amp;gt; is the unit volume element, the only trivector (pseudoscalar) in three-dimensional space.  The result is &amp;lt;math&amp;gt;\scriptstyle \hat B \;=\; \frac{1}{\sqrt{3}}(\hat y \hat z \,+\, \hat z \hat x \,+\, \hat x \hat y)&amp;lt;/math&amp;gt;.  In three-dimensional space, however, it is often simpler to leave the expression for &amp;lt;math&amp;gt;\scriptstyle \hat B \;=\; i \hat v&amp;lt;/math&amp;gt;, using the fact that &amp;lt;math&amp;gt;\scriptstyle i&amp;lt;/math&amp;gt; commutes with all objects in 3D and also squares to −1.  A rotation of the &amp;lt;math&amp;gt;\scriptstyle \hat x&amp;lt;/math&amp;gt; vector in this plane by an angle &amp;lt;math&amp;gt;\scriptstyle \theta&amp;lt;/math&amp;gt; is then&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\hat x&#039; = R \hat x R^\dagger = e^{-i\hat v \frac{\theta}{2}} \hat x e^{i \hat v \frac{\theta}{2}} = \hat x \cos^2 \frac{\theta}{2} + i (\hat x \hat v - \hat v \hat x) \cos \frac{\theta}{2} \sin \frac{\theta}{2} + \hat v \hat x \hat v \sin^2 \frac{\theta}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recognizing that &amp;lt;math&amp;gt;\scriptstyle i (\hat x \hat v \,-\, \hat v \hat x) \;=\; 2i (\hat x \,\wedge\, \hat v)&amp;lt;/math&amp;gt; and that &amp;lt;math&amp;gt;\scriptstyle -\hat v \hat x \hat v&amp;lt;/math&amp;gt; is the reflection of &amp;lt;math&amp;gt;\scriptstyle \hat x&amp;lt;/math&amp;gt; about the plane perpendicular to &amp;lt;math&amp;gt;\scriptstyle \hat v&amp;lt;/math&amp;gt; gives a geometric interpretation to the rotation operation:  the rotation preserves the components that are parallel to &amp;lt;math&amp;gt;\scriptstyle \hat v&amp;lt;/math&amp;gt; and changes only those that are perpendicular.  The terms are then computed:&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
 \hat v \hat x \hat v    &amp;amp;= \frac{1}{3} (-\hat x + 2 \hat y + 2 \hat z) \\&lt;br /&gt;
 2i \hat x \wedge \hat v &amp;amp;= 2i \frac{1}{\sqrt{3}} (\hat x \hat y + \hat x \hat z) = \frac{2}{\sqrt{3}} (\hat y - \hat z)&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result of the rotation is then&lt;br /&gt;
:&amp;lt;math&amp;gt;\hat x&#039; = \hat x \left(\cos^2 \frac{\theta}{2} - \frac{1}{3} \sin^2 \frac{\theta}{2}\right) + \frac{2}{3} \hat y \sin \frac{\theta}{2}  \left(\sin \frac{\theta}{2} + \sqrt{3} \cos \frac{\theta}{2}\right)  + \frac{2}{3} \hat z \sin \frac{\theta}{2} \left(\sin \frac{\theta}{2} - \sqrt{3} \cos \frac{\theta}{2}\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple check on this result is the angle &amp;lt;math&amp;gt;\scriptstyle \theta \;=\; \frac{2}{3}\pi&amp;lt;/math&amp;gt;.  Such a rotation should map the &amp;lt;math&amp;gt;\scriptstyle \hat x&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\scriptstyle \hat y&amp;lt;/math&amp;gt;.  Indeed, the rotation reduces to&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
  \hat x&#039; &amp;amp;= \hat x\left(\frac{1}{4} - \frac{1}{3} \frac{3}{4}\right) + \frac{2}{3} \hat y \frac{\sqrt{3}}{2} \left(\frac{\sqrt{3}}{2} + \sqrt{3}\frac{1}{2}\right) + \frac{2}{3} \hat z \frac{\sqrt{3}}{2} \left(\frac{\sqrt{3}}{2} - \sqrt{3}\frac{1}{2}\right) \\&lt;br /&gt;
          &amp;amp;= 0 \hat x + \hat y + 0 \hat z = \hat y&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
exactly as expected.  This rotation formula is valid not only for vectors but for any [[multivector]].  In addition, when Euler angles are used, the complexity of the operation is much reduced.  Compounded rotations come from multiplying the rotors, so the total rotor from Euler angles is&lt;br /&gt;
:&amp;lt;math&amp;gt;R = R_{\gamma&#039;} R_{\beta&#039;} R_\alpha = \exp\left(\frac{-i \hat z&#039; \gamma}{2}\right) \exp\left(\frac{-i \hat x&#039; \beta}{2}\right) \exp\left(\frac{-i \hat z \alpha}{2}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but &amp;lt;math&amp;gt;\scriptstyle \hat x&#039; \;=\; R_\alpha \hat x R_\alpha^\dagger&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle \hat z&#039; \;=\; R_{\beta&#039;} \hat z R_{\beta&#039;}^\dagger&amp;lt;/math&amp;gt;.  These rotors come back out of the exponentials like so:&lt;br /&gt;
:&amp;lt;math&amp;gt;R_{\beta&#039;} = \cos \frac{\beta}{2} - i R_\alpha \hat x R_\alpha^\dagger \sin \frac{\beta}{2} = R_\alpha R_\beta R_\alpha^\dagger&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\scriptstyle R_\beta&amp;lt;/math&amp;gt; refers to rotation in the original coordinates.  Similarly for the &amp;lt;math&amp;gt;\scriptstyle \gamma&amp;lt;/math&amp;gt; rotation, &amp;lt;math&amp;gt;\scriptstyle R_{\gamma&#039;} \;=\; R_{\beta&#039;} R_\gamma R_{\beta&#039;}^\dagger \;=\; R_\alpha R_\beta R_\alpha^\dagger R_\gamma R_\alpha R_\beta^\dagger R_\alpha^\dagger&amp;lt;/math&amp;gt;.  Noting that &amp;lt;math&amp;gt;\scriptstyle R_\gamma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\scriptstyle R_\alpha&amp;lt;/math&amp;gt; commute (rotations in the same plane must commute), and the total rotor becomes&lt;br /&gt;
:&amp;lt;math&amp;gt;R = R_\alpha R_\beta R_\gamma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, the compounded rotations of Euler angles become a series of equivalent rotations in the original fixed frame.&lt;br /&gt;
&lt;br /&gt;
While rotors in geometric algebra work almost identically to quaternions in three dimensions, the power of this formalism is its generality:  this method is appropriate and valid in spaces with any number of dimensions.  In 3D, rotations have three degrees of freedom, a degree for each linearly independent plane (bivector) the rotation can take place in.  It has been known that pairs of quaternions can be used to generate rotations in 4D, yielding six degrees of freedom, and the geometric algebra approach verifies this result:  in 4D, there are six linearly independent bivectors that can be used as the generators of rotations.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Charts on SO(3)]]&lt;br /&gt;
*[[Euler filter]]&lt;br /&gt;
*[[Orientation (geometry)]]&lt;br /&gt;
*[[Rotation around a fixed axis]]&lt;br /&gt;
*[[Rotation (mathematics)]]&lt;br /&gt;
*[[Rotation operator (vector space)]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
*Evangelos A. Coutsias and Louis Romero, (1999) &#039;&#039;The Quaternions with an application to Rigid Body Dynamics&#039;&#039;, Department of Mathematics and Statistics, [[University of New Mexico]].&lt;br /&gt;
*F. Landis Markley, (2003) &#039;&#039;Attitude Error Representations for Kalman Filtering&#039;&#039;, Journal of Guidance, Control and Dynamics.&lt;br /&gt;
*H. Goldstein, (1980) &#039;&#039;Classical Mechanics&#039;&#039;, 2nd. ed., Addison–Wesley. ISBN 0-201-02918-9&lt;br /&gt;
*James R. Wertz, (1980) &#039;&#039;Spacecraft Attitude Determination and Control&#039;&#039;, [[D. Reidel]] Publishing Company. ISBN 90-277-1204-2&lt;br /&gt;
*J. Schmidt and H. Niemann, (2001) &#039;&#039;Using Quaternions for Parametrizing 3-D Rotations in Unconstrained Nonlinear Optimization&#039;&#039;, Vision, Modeling and Visualization (VMV01).&lt;br /&gt;
*Lev D. Landau and E. M. Lifshitz, (1976) &#039;&#039;Mechanics&#039;&#039;, 3rd. ed., [[Pergamon Press]]. ISBN 0-08-021022-8 (hardcover) and ISBN 0-08-029141-4 (softcover).&lt;br /&gt;
*Klumpp, A. R., &#039;&#039;Singularity-Free Extraction of a Quaternion from a Direction-Cosine Matrix&#039;&#039;, Journal of Spacecraft and Rockets, vol. 13, Dec. 1976, p.&amp;amp;nbsp;754, 755.&lt;br /&gt;
*C. Doran and A. Lasenby, (2003) &#039;&#039;Geometric Algebra for Physicists&#039;&#039;, Cambridge University Press.  ISBN 978-0-521-71595-9&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.euclideanspace.com/maths/geometry/rotations/index.htm EuclideanSpace] has a wealth of information on rotation representation&lt;br /&gt;
* [http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q36 Q36. How do I generate a rotation matrix from Euler angles?] and [http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q37 Q37. How do I convert a rotation matrix to Euler angles?] — The Matrix and Quaternions FAQ&lt;br /&gt;
* [http://www.mrao.cam.ac.uk/~clifford/introduction/intro/node9.html#SECTION00030000000000000000 Imaginary numbers are not Real – the Geometric Algebra of Spacetime] – Section &amp;quot;Rotations and Geometric Algebra&amp;quot; derives and applies the rotor description of rotations&lt;br /&gt;
* [http://www.starlino.com/dcm_tutorial.html Starlino&#039;s DCM Tutorial] – Direction cosine matrix theory tutorial and applications. Space orientation estimation algorithm using  accelerometer, gyroscope and magnetometer IMU devices. Using complimentary filter (popular alternative to Kalman filter) with DCM matrix.&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Rotation Representation (Mathematics)}}&lt;br /&gt;
[[Category:Rotation]]&lt;br /&gt;
[[Category:Orientation]]&lt;br /&gt;
[[Category:Rotation in three dimensions| ]]&lt;br /&gt;
[[Category:Euclidean symmetries]]&lt;/div&gt;</summary>
		<author><name>80.175.7.191</name></author>
	</entry>
</feed>