HOME

TheInfoList



OR:

In
geometry Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space such as the distance, shape, size, and relative position of figures. A mathematician who works in the field of geometry is c ...
, various formalisms exist to express a
rotation Rotation, or spin, is the circular movement of an object around a '' central axis''. A two-dimensional rotating object has only one possible central axis and can rotate in either a clockwise or counterclockwise direction. A three-dimensional ...
in three
dimensions In physics and mathematics, the dimension of a mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any point within it. Thus, a line has a dimension of one (1D) because only one coordina ...
as a mathematical
transformation Transformation may refer to: Science and mathematics In biology and medicine * Metamorphosis, the biological process of changing physical form after birth or hatching * Malignant transformation, the process of cells becoming cancerous * Trans ...
. In physics, this concept is applied to
classical mechanics Classical mechanics is a physical theory describing the motion of macroscopic objects, from projectiles to parts of machinery, and astronomical objects, such as spacecraft, planets, stars, and galaxies. For objects governed by classical ...
where rotational (or angular)
kinematics Kinematics is a subfield of physics, developed in classical mechanics, that describes the Motion (physics), motion of points, Physical object, bodies (objects), and systems of bodies (groups of objects) without considering the forces that cause ...
is the science of
quantitative Quantitative may refer to: * Quantitative research, scientific investigation of quantitative properties * Quantitative analysis (disambiguation) * Quantitative verse, a metrical system in poetry * Statistics, also known as quantitative analysis ...
description of a purely rotational
motion In physics, motion is the phenomenon in which an object changes its position with respect to time. Motion is mathematically described in terms of displacement, distance, velocity, acceleration, speed and frame of reference to an observer and mea ...
. The
orientation Orientation may refer to: Positioning in physical space * Map orientation, the relationship between directions on a map and compass directions * Orientation (housing), the position of a building with respect to the sun, a concept in building de ...
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. According to
Euler's rotation theorem In geometry, Euler's rotation theorem states that, in three-dimensional space, any displacement of a rigid body such that a point on the rigid body remains fixed, is equivalent to a single rotation about some axis that runs through the fixed p ...
the rotation of a
rigid body In physics, a rigid body (also known as a rigid object) is a solid body in which deformation is zero or so small it can be neglected. The distance between any two given points on a rigid body remains constant in time regardless of external force ...
(or three-dimensional
coordinate system In geometry, a coordinate system is a system that uses one or more numbers, or coordinates, to uniquely determine the position of the points or other geometric elements on a manifold such as Euclidean space. The order of the coordinates is sig ...
with the fixed
origin Origin(s) or The Origin may refer to: Arts, entertainment, and media Comics and manga * Origin (comics), ''Origin'' (comics), a Wolverine comic book mini-series published by Marvel Comics in 2002 * The Origin (Buffy comic), ''The Origin'' (Bu ...
) is described by a single rotation about some axis. Such a rotation may be uniquely described by a minimum of three
real Real may refer to: Currencies * Brazilian real (R$) * Central American Republic real * Mexican real * Portuguese real * Spanish real * Spanish colonial real Music Albums * ''Real'' (L'Arc-en-Ciel album) (2000) * ''Real'' (Bright album) (2010) ...
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. An example where rotation representation is used is in
computer vision Computer vision is an interdisciplinary scientific field that deals with how computers can gain high-level understanding from digital images or videos. From the perspective of engineering, it seeks to understand and automate tasks that the hum ...
, where an
automated Automation describes a wide range of technologies that reduce human intervention in processes, namely by predetermining decision criteria, subprocess relationships, and related actions, as well as embodying those predeterminations in machines ...
observer needs to track a target. Consider a rigid body, with three orthogonal unit vectors fixed to its body (representing the three axes of the object's local
coordinate system In geometry, a coordinate system is a system that uses one or more numbers, or coordinates, to uniquely determine the position of the points or other geometric elements on a manifold such as Euclidean space. The order of the coordinates is sig ...
). The basic problem is to specify the orientation of these three
unit vector In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) of length 1. A unit vector is often denoted by a lowercase letter with a circumflex, or "hat", as in \hat (pronounced "v-hat"). The term ''direction vecto ...
s, and hence the rigid body, with respect to the observer's coordinate system, regarded as a reference placement in space.


Rotations and motions

Rotation formalisms are focused on proper (
orientation-preserving The orientation of a real vector space or simply orientation of a vector space is the arbitrary choice of which ordered bases are "positively" oriented and which are "negatively" oriented. In the three-dimensional Euclidean space, right-handed ...
) motions of the
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's Elements, Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics ther ...
with one fixed point, that a ''rotation'' refers to. Although physical motions with a fixed point are an important case (such as ones described in the
center-of-mass frame In physics, the center-of-momentum frame (also zero-momentum frame or COM frame) of a system is the unique (up to velocity but not origin) inertial frame in which the total momentum of the system vanishes. The ''center of momentum'' of a system i ...
, or motions of a
joint A joint or articulation (or articular surface) is the connection made between bones, ossicles, or other hard structures in the body which link an animal's skeletal system into a functional whole.Saladin, Ken. Anatomy & Physiology. 7th ed. McGraw ...
), 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 Translation is the communication of the Meaning (linguistic), meaning of a #Source and target languages, source-language text by means of an Dynamic and formal equivalence, equivalent #Source and target languages, target-language text. The ...
. Whichever the order of their
composition Composition or Compositions may refer to: Arts and literature *Composition (dance), practice and teaching of choreography *Composition (language), in literature and rhetoric, producing a work in spoken tradition and written discourse, to include v ...
will be, the "pure" rotation component wouldn't change, uniquely determined by the complete motion. One can also understand "pure" rotations as
linear map In mathematics, and more specifically in linear algebra, a linear map (also called a linear mapping, linear transformation, vector space homomorphism, or in some contexts linear function) is a Map (mathematics), mapping V \to W between two vect ...
s in a
vector space In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called ''vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but can ...
equipped with Euclidean structure, not as maps of points of a corresponding
affine space In mathematics, an affine space is a geometric structure that generalizes some of the properties of Euclidean spaces in such a way that these are independent of the concepts of distance and measure of angles, keeping only the properties relate ...
. 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. When representing a rotation as numbers in a computer, some people prefer the quaternion representation or the axis+angle representation, because they avoid the
gimbal lock Gimbal lock is the loss of one degree of freedom in a three-dimensional, three-gimbal mechanism that occurs when the axes of two of the three gimbals are driven into a parallel configuration, "locking" the system into rotation in a degenerate t ...
that can occur with Euler rotations.


Formalism alternatives


Rotation matrix

The above-mentioned triad of
unit vector In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) of length 1. A unit vector is often denoted by a lowercase letter with a circumflex, or "hat", as in \hat (pronounced "v-hat"). The term ''direction vecto ...
s is also called a
basis Basis may refer to: Finance and accounting * Adjusted basis, the net cost of an asset after adjusting for various tax-related items *Basis point, 0.01%, often used in the context of interest rates * Basis trading, a trading strategy consisting ...
. Specifying the coordinates (''components'') 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, \hat, \hat and \hat, that form the rotated basis each consist of 3 coordinates, yielding a total of 9 parameters. These parameters can be written as the elements of a matrix , called a rotation matrix. 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) \mathbf = \begin \hat_x & \hat_x & \hat_x \\ \hat_y & \hat_y & \hat_y \\ \hat_z & \hat_z & \hat_z \\ \end The elements of the rotation matrix are not all independent—as Euler's rotation theorem dictates, the rotation matrix has only three degrees of freedom. The rotation matrix has the following properties: * is a real,
orthogonal matrix In linear algebra, an orthogonal matrix, or orthonormal matrix, is a real square matrix whose columns and rows are orthonormal vectors. One way to express this is Q^\mathrm Q = Q Q^\mathrm = I, where is the transpose of and is the identity ma ...
, hence each of its rows or columns represents a
unit vector In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) of length 1. A unit vector is often denoted by a lowercase letter with a circumflex, or "hat", as in \hat (pronounced "v-hat"). The term ''direction vecto ...
. * The
eigenvalues In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denoted b ...
of are \left\ = \ where is the standard
imaginary unit The imaginary unit or unit imaginary number () is a solution to the quadratic equation x^2+1=0. Although there is no real number with this property, can be used to extend the real numbers to what are called complex numbers, using addition an ...
with the property * The
determinant In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix. It characterizes some properties of the matrix and the linear map represented by the matrix. In particular, the determinant is nonzero if and ...
of is +1, equivalent to the product of its eigenvalues. * The
trace Trace may refer to: Arts and entertainment Music * ''Trace'' (Son Volt album), 1995 * ''Trace'' (Died Pretty album), 1993 * Trace (band), a Dutch progressive rock band * ''The Trace'' (album) Other uses in arts and entertainment * ''Trace'' ...
of is , equivalent to the sum of its eigenvalues. The angle which appears in the eigenvalue expression corresponds to the angle of the Euler axis and angle representation. The
eigenvector In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denoted b ...
corresponding to 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. The above properties are equivalent to \begin , \hat, = , \hat, = , \hat, &= 1\\ \hat \cdot \hat &= 0\\ \hat \times \hat &= \hat \,, \end which is another way of stating that (\hat, \hat, \hat) form a 3D
orthonormal basis In mathematics, particularly linear algebra, an orthonormal basis for an inner product space ''V'' with finite dimension is a basis for V whose vectors are orthonormal, that is, they are all unit vectors and orthogonal to each other. For example, ...
. These statements comprise a total of 6 conditions (the cross product contains 3), leaving the rotation matrix with just 3 degrees of freedom, as required. Two successive rotations represented by matrices and are easily combined as elements of a group, \mathbf_\text = \mathbf_2\mathbf_1 (Note the order, since the vector being rotated is multiplied from the right). 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 useful and popular way to represent rotations, even though it is less concise than other representations.


Euler axis and angle (rotation vector)

From
Euler's rotation theorem In geometry, Euler's rotation theorem states that, in three-dimensional space, any displacement of a rigid body such that a point on the rigid body remains fixed, is equivalent to a single rotation about some axis that runs through the fixed p ...
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. The axis can be represented as a three-dimensional
unit vector In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) of length 1. A unit vector is often denoted by a lowercase letter with a circumflex, or "hat", as in \hat (pronounced "v-hat"). The term ''direction vecto ...
\hat = \begin e_x \\ e_y \\ e_z \end and the angle by a scalar . Since the axis is normalized, it has only two degrees of freedom. The angle adds the third degree of freedom to this rotation representation. One may wish to express rotation as a rotation vector, or Euler vector, an un-normalized three-dimensional vector the direction of which specifies the axis, and the length of which is , \mathbf = \theta \hat\,. The rotation vector is useful in some contexts, as it represents a three-dimensional rotation with only three
scalar Scalar may refer to: *Scalar (mathematics), an element of a field, which is used to define a vector space, usually the field of real numbers * Scalar (physics), a physical quantity that can be described by a single element of a number field such ...
values (its components), representing the three degrees of freedom. This is also true for representations based on sequences of three Euler angles (see below). If the rotation angle 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.


Euler rotations

The idea behind Euler rotations is to split the complete rotation of the coordinate system into three simpler constitutive rotations, called
precession Precession is a change in the orientation of the rotational axis of a rotating body. In an appropriate reference frame it can be defined as a change in the first Euler angle, whereas the third Euler angle defines the rotation itself. In othe ...
,
nutation Nutation () is a rocking, swaying, or nodding motion in the axis of rotation of a largely axially symmetric object, such as a gyroscope, planet, or bullet in flight, or as an intended behaviour of a mechanism. In an appropriate reference frame ...
, and intrinsic rotation, being each one of them an increment on one of the
Euler angles The Euler angles are three angles introduced by Leonhard Euler to describe the Orientation (geometry), orientation of a rigid body with respect to a fixed coordinate system.Novi Commentarii academiae scientiarum Petropolitanae 20, 1776, pp. 189 ...
. 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 axes. The middle matrix represents a rotation around an intermediate axis called line of nodes. However, 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
commutative In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name o ...
). 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 or letter . 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 possible combinations of three basic rotations but only of them can be used for representing arbitrary 3D rotations as Euler angles. These 12 combinations avoid consecutive rotations around the same axis (such as XXY) which would reduce the degrees of freedom that can be represented. 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 In linear algebra, a rotation matrix is a transformation matrix that is used to perform a rotation in Euclidean space. For example, using the convention below, the matrix :R = \begin \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end ...
or
quaternions In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. Hamilton defined a quater ...
) are used to avoid this problem. In
aviation Aviation includes the activities surrounding mechanical flight and the aircraft industry. ''Aircraft'' includes fixed-wing and rotary-wing types, morphable wings, wing-less lifting bodies, as well as lighter-than-air craft such as hot air ...
orientation of the aircraft is usually expressed as
intrinsic In science and engineering, an intrinsic property is a property of a specified subject that exists itself or within the subject. An extrinsic property is not essential or inherent to the subject that is being characterized. For example, mass ...
Tait-Bryan angles The Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid body with respect to a fixed coordinate system.Novi Commentarii academiae scientiarum Petropolitanae 20, 1776, pp. 189–207 (E478PDF/ref> Th ...
following the convention, which are called ''heading'', ''elevation'', and ''bank'' (or synonymously, ''yaw'', ''pitch'', and ''roll'').


Quaternions

Quaternion In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. Hamilton defined a quatern ...
s, which form a four-dimensional
vector space In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called ''vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but can ...
, have proven very useful in representing rotations due to several advantages over the other representations mentioned in this article. A quaternion representation of rotation is written as a
versor In mathematics, a versor is a quaternion of norm one (a ''unit quaternion''). The word is derived from Latin ''versare'' = "to turn" with the suffix ''-or'' forming a noun from the verb (i.e. ''versor'' = "the turner"). It was introduced by Will ...
(normalized quaternion): \hat =q_i\mathbf+q_j\mathbf+q_k\mathbf+q_r = \begin q_i \\ q_j \\ q_k \\ q_r \end The above definition stores the quaternion as an array following the convention used in (Wertz 1980) and (Markley 2003). An alternative definition, used for example in (Coutsias 1999) and (Schmidt 2001), defines the "scalar" term as the first quaternion element, with the other elements shifted down one position. In terms of the Euler axis \hat = \begin e_x \\ e_y \\ e_z \end and angle this versor's components are expressed as follows: \begin q_i &= e_x\sin\frac\\ q_j &= e_y\sin\frac\\ q_k &= e_z\sin\frac\\ q_r &= \cos\frac \end Inspection shows that the quaternion parametrization obeys the following constraint: q_i^2 + q_j^2 + q_k^2 + q_r^2 = 1 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 a + b i + c j + d k \qquad \text a, b, c, d \in \R and where are the
hypercomplex number In mathematics, hypercomplex number is a traditional term for an element of a finite-dimensional unital algebra over the field of real numbers. The study of hypercomplex numbers in the late 19th century forms the basis of modern group represent ...
s satisfying \begin i^2 &=& j^2 &=& k^2 &=& -1\\ ij &=& -ji &=& k&&\\ jk &=& -kj &=& i&&\\ ki &=& -ik &=& j&& \end Quaternion multiplication, which is used to specify a
composite Composite or compositing may refer to: Materials * Composite material, a material that is made from several different substances ** Metal matrix composite, composed of metal and other parts ** Cermet, a composite of ceramic and metallic materials ...
rotation, is performed in the same manner as multiplication of
complex numbers In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form a ...
, except that the order of the elements must be taken into account, since multiplication is not commutative. In matrix notation we can write quaternion multiplication as \tilde\otimes\mathbf = \begin \;\;\, q_r & \;\;\, q_k & -q_j & \;\;\, q_i\\ -q_k & \;\;\, q_r & \;\;\, q_i & \;\;\, q_j\\ \;\;\, q_j & -q_i & \;\;\, q_r & \;\;\, q_k\\ -q_i & -q_j & -q_k & \;\;\, q_r \end \begin \tilde_i\\ \tilde_j\\ \tilde_k\\ \tilde_r \end = \begin \;\;\, \tilde_r & -\tilde_k & \;\;\, \tilde_j & \;\;\, \tilde_i\\ \;\;\, \tilde_k & \;\;\, \tilde_r & -\tilde_i & \;\;\, \tilde_j\\ -\tilde_j & \;\;\, \tilde_i & \;\;\, \tilde_r & \;\;\, \tilde_k\\ -\tilde_i & -\tilde_j & -\tilde_k & \;\;\, \tilde_r \end \begin q_i\\ q_j\\ q_k\\ q_r \end Combining two consecutive quaternion rotations is therefore just as simple as using the rotation matrix. Just as two successive rotation matrices, followed by , are combined as \mathbf_3 = \mathbf_2\mathbf_1, we can represent this with quaternion parameters in a similarly concise way: \mathbf_3 = \mathbf_2 \otimes \mathbf_1 Quaternions are a very popular parametrization due to the following properties: *More compact than the matrix representation and less susceptible to
round-off error A roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic. Rounding errors are d ...
s *The quaternion elements vary continuously over the unit sphere in , (denoted by ) as the orientation changes, avoiding
discontinuous Continuous functions are of utmost importance in mathematics, functions and applications. However, not all functions are continuous. If a function is not continuous at a point in its domain, one says that it has a discontinuity there. The set of a ...
jumps (inherent to three-dimensional parameterizations) *Expression of the rotation matrix in terms of quaternion parameters involves no
trigonometric function In mathematics, the trigonometric functions (also called circular functions, angle functions or goniometric functions) are real functions which relate an angle of a right-angled triangle to ratios of two side lengths. They are widely used in all ...
s *It is simple to combine two individual rotations represented as quaternions using a quaternion product Like rotation matrices, quaternions must sometimes be renormalized due to rounding errors, to make sure that they correspond to valid rotations. The computational cost of renormalizing a quaternion, however, is much less than for normalizing a matrix. Quaternions also capture the spinorial character of rotations in three dimensions. For a three-dimensional object connected to its (fixed) surroundings by slack strings or bands, the strings or bands can be untangled after ''two'' complete turns about some fixed axis from an initial untangled state. Algebraically, the quaternion describing such a rotation changes from a scalar +1 (initially), through (scalar + pseudovector) values to scalar −1 (at one full turn), through (scalar + pseudovector) values back to scalar +1 (at two full turns). This cycle repeats every 2 turns. After turns (integer ), without any intermediate untangling attempts, the strings/bands can be partially untangled back to the turns state with each application of the same procedure used in untangling from 2 turns to 0 turns. Applying the same procedure times will take a -tangled object back to the untangled or 0 turn state. The untangling process also removes any rotation-generated twisting about the strings/bands themselves. Simple 3D mechanical models can be used to demonstrate these facts.


Rodrigues vector

The Rodrigues vector (sometimes called the Gibbs vector, with coordinates called Rodrigues parameters)online
/ref> can be expressed in terms of the axis and angle of the rotation as follows: \mathbf = \hat\tan\frac This representation is a higher-dimensional analog of the gnomonic projection, mapping unit quaternions from a 3-sphere onto the 3-dimensional pure-vector hyperplane. It has a discontinuity at 180° ( radians): as any rotation vector tends to an angle of radians, its tangent tends to infinity. A rotation followed by a rotation in the Rodrigues representation has the simple rotation composition form Today, the most straightforward way to prove this formula is in the (faithful) doublet representation, where , etc. The combinatoric features of the Pauli matrix derivation just mentioned are also identical to the equivalent
quaternion In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. Hamilton defined a quatern ...
derivation below. Construct a quaternion associated with a spatial rotation R as, S = \cos\frac + \sin\frac \mathbf. Then the composition of the rotation RB with RA is the rotation RC=RBRA, with rotation axis and angle defined by the product of the quaternions, A=\cos\frac+ \sin\frac\mathbf\quad \text \quad B=\cos\frac+ \sin\frac\mathbf, that is C = \cos\frac+\sin\frac\mathbf = \left(\cos\frac+\sin\frac\mathbf\right) \left(\cos\frac + \sin\frac\mathbf\right). Expand this quaternion product to \cos\frac+\sin\frac \mathbf = \left(\cos\frac\cos\frac - \sin\frac\sin\frac \mathbf\cdot \mathbf\right) + \left(\sin\frac \cos\frac \mathbf + \sin\frac \cos\frac \mathbf + \sin\frac \sin\frac \mathbf\times \mathbf\right). Divide both sides of this equation by the identity resulting from the previous one, \cos\frac = \cos\frac\cos\frac - \sin\frac\sin\frac \mathbf\cdot \mathbf, and evaluate This is Rodrigues' formula for the axis of a composite rotation defined in terms of the axes of the two component rotations. He derived this formula in 1840 (see page 408). The three rotation axes A, B, and C form a spherical triangle and the dihedral angles between the planes formed by the sides of this triangle are defined by the rotation angles. Modified Rodrigues parameters (MRPs) can be expressed in terms of Euler axis and angle by \mathbf = \hat\tan\frac\,. Its components can be expressed in terms of the components of a unit quaternion representing the same rotation as p_ = \frac\,. The modified Rodrigues vector is a
stereographic projection In mathematics, a stereographic projection is a perspective projection of the sphere, through a specific point on the sphere (the ''pole'' or ''center of projection''), onto a plane (geometry), plane (the ''projection plane'') perpendicular to ...
mapping unit quaternions from a 3-sphere onto the 3-dimensional pure-vector hyperplane. The projection of the opposite quaternion -q results in a different modified Rodrigues vector \mathbf^s than the projection of the original quaternion q. Comparing components one obtains that p^s_ = \frac =\frac\,. Notably, if one of these vectors lies inside the unit 3-sphere, the other will lie outside.


Cayley–Klein parameters

See definition a
Wolfram Mathworld


Higher-dimensional analogues


Vector transformation law

Active rotations of a 3D vector p in Euclidean space around an axis n over an angle ''η'' can be easily written in terms of dot and cross products as follows: \mathbf' = p_\parallel \mathbf + \cos \, \mathbf_\perp + \sin \, \mathbf \wedge \mathbf wherein p_\parallel = \mathbf \cdot \mathbf is the longitudinal component of p along n, given by the
dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
, \mathbf_\perp = \mathbf - (\mathbf \cdot \mathbf) \mathbf is the transverse component of p with respect to n, and \mathbf \wedge \mathbf is the
cross product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and is ...
, of p with n. The above formula shows that the longitudinal component of p remains unchanged, whereas the transverse portion of p is rotated in the plane perpendicular to n. This plane is spanned by the transverse portion of p itself and a direction perpendicular to both p and n. The rotation is directly identifiable in the equation as a 2D rotation over an angle ''η''. Passive rotations can be described by the same formula, but with an inverse sign of either η or n.


Conversion formulae between formalisms


Rotation matrix ↔ Euler angles

The Euler angles can be extracted from the rotation matrix \mathbf by inspecting the rotation matrix in analytical form.


Rotation matrix → Euler angles ( extrinsic)

Using the -convention, the 3-1-3
extrinsic In science and engineering, an intrinsic property is a property of a specified subject that exists itself or within the subject. An extrinsic property is not essential or inherent to the subject that is being characterized. For example, mass ...
Euler angles , and (around the -axis, -axis and again the Z-axis) can be obtained as follows: \begin \phi &= \operatorname\left(A_, A_\right)\\ \theta &= \arccos\left(A_\right)\\ \psi &= -\operatorname\left(A_, A_\right) \end Note that is equivalent to where it also takes into account the quadrant that the point is in; see
atan2 In computing and mathematics, the function atan2 is the 2-argument arctangent. By definition, \theta = \operatorname(y, x) is the angle measure (in radians, with -\pi < \theta \leq \pi) between the positive
. When implementing the conversion, one has to take into account several situations: * There are generally two solutions in the interval . The above formula works only when is within the interval . * For the special case , and will be derived from and . * There are infinitely many but countably many solutions outside of the interval . * Whether all mathematical solutions apply for a given application depends on the situation.


Euler angles ( intrinsic) → rotation matrix

The rotation matrix is generated from the 3-2-1
intrinsic In science and engineering, an intrinsic property is a property of a specified subject that exists itself or within the subject. An extrinsic property is not essential or inherent to the subject that is being characterized. For example, mass ...
Euler angles by multiplying the three matrices generated by rotations about the axes. \mathbf = \mathbf_3\mathbf_2\mathbf_1 = \mathbf_Z\mathbf_Y\mathbf_X The axes of the rotation depend on the specific convention being used. For the -convention the rotations are about the -, - and -axes with angles , and , the individual matrices are as follows: \begin \mathbf_X &= \begin 1 & 0 & 0\\ 0 & \cos\phi & -\sin\phi\\ 0 & \sin\phi & \cos\phi \end \\ px \mathbf_Y &= \begin \cos\theta & 0 & \sin\theta\\ 0 & 1 & 0\\ -\sin\theta & 0 & \cos\theta \end \\ px \mathbf_Z &= \begin \cos\psi & -\sin\psi & 0\\ \sin\psi & \cos\psi & 0\\ 0 & 0 & 1 \end \end This yields \mathbf = \begin \cos\theta \cos\psi & -\cos\phi \sin\psi + \sin\phi \sin\theta \cos\psi & \sin\phi \sin\psi + \cos\phi \sin\theta \cos\psi \\ \cos\theta\sin\psi & \cos\phi \cos\psi + \sin\phi \sin\theta \sin\psi & - \sin\phi \cos\psi + \cos\phi \sin\theta \sin\psi \\ -\sin\theta & \sin\phi \cos\theta & \cos\phi \cos\theta \\ \end Note: This is valid for a right-hand system, which is the convention used in almost all engineering and physics disciplines. The interpretation of these right-handed rotation matrices is that they express coordinate transformations (
passive Passive may refer to: * Passive voice, a grammatical voice common in many languages, see also Pseudopassive * Passive language, a language from which an interpreter works * Passivity (behavior), the condition of submitting to the influence of o ...
) as opposed to point transformations (
active Active may refer to: Music * ''Active'' (album), a 1992 album by Casiopea * Active Records, a record label Ships * ''Active'' (ship), several commercial ships by that name * HMS ''Active'', the name of various ships of the British Royal ...
). Because expresses a rotation from the local frame to the global frame (i.e., encodes the axes of frame w.r.t frame ), the elementary rotation matrices are composed as above. Because the inverse rotation is just the rotation transposed, if we wanted the global-to-local rotation from frame to frame , we would write \mathbf^\top = (\mathbf_Z\mathbf_Y\mathbf_X)^\top = \mathbf_X^\top\mathbf_Y^\top\mathbf_Z^\top.


Rotation matrix ↔ Euler axis/angle

If the Euler angle is not a multiple of , the Euler axis and angle can be computed from the elements of the rotation matrix as follows: \begin \theta &= \arccos\frac\\ e_1 &= \frac\\ e_2 &= \frac\\ e_3 &= \frac \end Alternatively, the following method can be used: Eigendecomposition of the rotation matrix yields the eigenvalues 1 and . The Euler axis is the eigenvector corresponding to the eigenvalue of 1, and can be computed from the remaining eigenvalues. The Euler axis can be also found using singular value decomposition since it is the normalized vector spanning the null-space of the matrix . To convert the other way the rotation matrix corresponding to an Euler axis and angle can be computed according to
Rodrigues' rotation formula In the theory of three-dimensional rotation, Rodrigues' rotation formula, named after Olinde Rodrigues, is an efficient algorithm for rotating a vector in space, given an axis and angle of rotation. By extension, this can be used to transform al ...
(with appropriate modification) as follows: \mathbf = \mathbf_3\cos\theta + (1-\cos\theta)\hat\hat^\mathsf + \left hat\right \sin\theta with the
identity matrix In linear algebra, the identity matrix of size n is the n\times n square matrix with ones on the main diagonal and zeros elsewhere. Terminology and notation The identity matrix is often denoted by I_n, or simply by I if the size is immaterial o ...
, and \left hat\right = \begin 0 & -e_3 & e_2\\ e_3 & 0 & -e_1\\ -e_2 & e_1 & 0 \end is the cross-product matrix. This expands to: \begin A_ &= (1-\cos\theta) e_1^2 + \cos\theta \\ A_ &= (1-\cos\theta) e_1 e_2 - e_3 \sin\theta \\ A_ &= (1-\cos\theta) e_1 e_3 + e_2 \sin\theta \\ A_ &= (1-\cos\theta) e_2 e_1 + e_3 \sin\theta \\ A_ &= (1-\cos\theta) e_2^2 + \cos\theta \\ A_ &= (1-\cos\theta) e_2 e_3 - e_1 \sin\theta \\ A_ &= (1-\cos\theta) e_3 e_1 - e_2 \sin\theta \\ A_ &= (1-\cos\theta) e_3 e_2 + e_1 \sin\theta \\ A_ &= (1-\cos\theta) e_3^2 + \cos\theta \end


Rotation matrix ↔ quaternion

When computing a quaternion from the rotation matrix there is a sign ambiguity, since and represent the same rotation. One way of computing the quaternion \mathbf = \begin q_i \\ q_j \\ q_k \\ q_r \end = q_i\mathbf+q_j\mathbf+q_k\mathbf+q_r from the rotation matrix is as follows: \begin q_r &= \frac\sqrt\\ q_i &= \frac\left(A_- A_\right)\\ q_j &= \frac\left(A_- A_\right)\\ q_k &= \frac\left(A_- A_\right) \end There are three other mathematically equivalent ways to compute . 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: \begin q_i &= \frac\sqrt\\ q_j &= \frac\left(A_ + A_\right)\\ q_k &= \frac\left(A_ + A_\right)\\ q_r &= \frac\left(A_ - A_\right) \end The rotation matrix corresponding to the quaternion can be computed as follows: \mathbf = \left(q_r^2 - \check^\mathsf\check\right)\mathbf_3 + 2\check\check^\mathrm + 2q_r\mathbf where \check = \begin q_i\\q_j\\q_k\end \,, \quad \mathbf = \begin 0 & -q_k & q_j\\ q_k & 0 & -q_i\\ -q_j & q_i & 0 \end which gives \mathbf = \begin 1 - 2q_j^2 - 2q_k^2 & 2\left(q_iq_j - q_kq_r\right) & 2\left(q_iq_k + q_jq_r\right)\\ 2\left(q_iq_j + q_kq_r\right) & 1 - 2q_i^2- 2 q_k^2 & 2\left(q_jq_k - q_iq_r\right)\\ 2\left(q_iq_k - q_jq_r\right) & 2\left(q_jq_k + q_iq_r\right) & 1 - 2q_i^2 - 2q_j^2 \end or equivalently \mathbf = \begin -1 + 2q_i^2 + 2q_r^2 & 2\left(q_iq_j - q_kq_r\right) & 2\left(q_iq_k + q_jq_r\right)\\ 2\left(q_iq_j + q_kq_r\right) & -1 + 2q_j^2 + 2q_r^2 & 2\left(q_jq_k - q_iq_r\right)\\ 2\left(q_iq_k - q_jq_r\right) & 2\left(q_jq_k + q_iq_r\right) & -1 + 2q_k^2 + 2q_r^2 \end


Euler angles ↔ quaternion


Euler angles ( extrinsic) → quaternion

We will consider the -convention 3-1-3 extrinsic Euler angles for the following algorithm. The terms of the algorithm depend on the convention used. We can compute the quaternion \mathbf = \begin q_i \\ q_j \\ q_k \\ q_r \end = q_i\mathbf+q_j\mathbf+q_k\mathbf+q_r from the Euler angles as follows: \begin q_i &= \cos\frac\sin\frac\\ q_j &= \sin\frac\sin\frac\\ q_k &= \sin\frac\cos\frac\\ q_r &= \cos\frac\cos\frac \end


Euler angles ( intrinsic) → quaternion

A quaternion equivalent to yaw (), pitch () and roll () angles. or
intrinsic In science and engineering, an intrinsic property is a property of a specified subject that exists itself or within the subject. An extrinsic property is not essential or inherent to the subject that is being characterized. For example, mass ...
Tait–Bryan angles The Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid body with respect to a fixed coordinate system.Novi Commentarii academiae scientiarum Petropolitanae 20, 1776, pp. 189–207 (E478PDF/ref> The ...
following the convention, can be computed by \begin q_i &= \sin \frac \cos \frac \cos \frac - \cos \frac \sin \frac \sin \frac\\ q_j &= \cos \frac \sin \frac \cos \frac + \sin \frac \cos \frac \sin \frac\\ q_k &= \cos \frac \cos \frac \sin \frac - \sin \frac \sin \frac \cos \frac\\ q_r &= \cos \frac \cos \frac \cos \frac + \sin \frac \sin \frac \sin \frac \end


Quaternion → Euler angles ( extrinsic)

Given the rotation quaternion \mathbf = \begin q_i \\ q_j \\ q_k \\ q_r \end = q_i\mathbf+q_j\mathbf+q_k\mathbf+q_r \,, the -convention 3-1-3 extrinsic Euler Angles can be computed by \begin \phi &= \operatorname\left(\left(q_iq_k + q_jq_r\right), -\left(q_jq_k - q_iq_r\right)\right)\\ \theta &= \arccos\left(-q_i^2 - q_j^2 + q_k^2+q_r^2\right)\\ \psi &= \operatorname\left(\left(q_iq_k - q_jq_r\right), \left(q_jq_k + q_iq_r\right)\right) \end


Quaternion → Euler angles ( intrinsic)

Given the rotation quaternion \mathbf = \begin q_i \\ q_j \\ q_k \\ q_r \end = q_i\mathbf+q_j\mathbf+q_k\mathbf+q_r \,, yaw, pitch and roll angles, or
intrinsic In science and engineering, an intrinsic property is a property of a specified subject that exists itself or within the subject. An extrinsic property is not essential or inherent to the subject that is being characterized. For example, mass ...
Tait–Bryan angles The Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid body with respect to a fixed coordinate system.Novi Commentarii academiae scientiarum Petropolitanae 20, 1776, pp. 189–207 (E478PDF/ref> The ...
following the convention, can be computed by \begin \text &= \operatorname \left(2\left(q_r q_i + q_j q_k\right),1 - 2\left(q_i^2 + q_j^2\right)\right) \\ \text &= \arcsin \left(2\left(q_r q_j - q_k q_i\right)\right) \\ \text &= \operatorname \left(2\left(q_r q_k + q_i q_j\right),1 - 2\left(q_j^2 + q_k^2\right)\right) \end


Euler axis–angle ↔ quaternion

Given the Euler axis and angle , the quaternion \mathbf = \begin q_i \\ q_j \\ q_k \\ q_r \end = q_i\mathbf+q_j\mathbf+q_k\mathbf+q_r \,, can be computed by \begin q_i &= \hat_1\sin\frac \\ q_j &= \hat_2\sin\frac \\ q_k &= \hat_3\sin\frac \\ q_r &= \cos\frac \end Given the rotation quaternion , define \check = \begin q_i \\ q_j \\ q_k \end\,. Then the Euler axis and angle can be computed by \begin \hat &= \frac \\ \theta &= 2\arccos q_r \end


Rotation matrix ↔ Rodrigues vector


Rodrigues vector → Rotation matrix

Since the definition of the Rodrigues vector can be related to rotation quaternions: \begin g_i = \dfrac = e_x \tan\left(\dfrac\right) \\ g_j = \dfrac = e_y \tan\left(\dfrac\right)\\ g_k = \dfrac = e_z \tan\left(\dfrac\right) \endBy making use of the following property 1 = q_r^2 + q_i^2 + q_j^2 + q_k^2 = q_r^2 \left(1 + \frac + \frac + \frac\right) = q_r^2 \left(1 + g_i^2 + g_j^2 + g_k^2\right)The formula can be obtained by factoring q_r^2 from the final expression obtained for quaternions: \mathbf = q_r^2 \begin \frac - 2\frac - 2\frac & 2\left(\frac\frac - \frac\right) & 2\left(\frac\frac + \frac\right)\\ 2\left(\frac\frac + \frac\right) & \frac - 2\frac - 2 \frac & 2\left(\frac\frac - \frac\right)\\ 2\left(\frac\frac - \frac\right) & 2\left(\frac\frac + \frac\right) & \frac - 2\frac - 2\frac \end Leading to the final formula: \mathbf = \frac \begin 1 + g_i^2 - g_j^2 - g_k^2 & 2\left(g_i g_j - g_k\right) & 2\left(g_i g_k + g_j\right)\\ 2\left(g_i g_j + g_k\right) &1 - g_i^2 + g_j^2 - g_k^2 & 2\left(g_j g_k - g_i\right)\\ 2\left(g_i g_k - g_j\right) & 2\left(g_j g_k + g_i\right) &1 - g_i^2 - g_j^2 + g_k^2 \end


Conversion formulae for derivatives


Rotation matrix ↔ angular velocities

The angular velocity vector \boldsymbol = \begin \omega_x \\ \omega_y \\ \omega_z \end can be extracted from the
time derivative A time derivative is a derivative of a function with respect to time, usually interpreted as the rate of change of the value of the function. The variable denoting time is usually written as t. Notation A variety of notations are used to denote th ...
of the rotation matrix by the following relation: boldsymbol\times = \begin 0 & -\omega_z & \omega_y \\ \omega_z & 0 & -\omega_x \\ -\omega_y & \omega_x & 0 \end = \frac\mathbf^\mathsf The derivation is adapted from Ioffe as follows: For any vector , consider and differentiate it: \frac = \frac \mathbf_0 = \frac \mathbf^\mathsf(t) \mathrm(t) The derivative of a vector is the
linear velocity Velocity is the directional speed of an object in motion as an indication of its rate of change in position as observed from a particular frame of reference and as measured by a particular standard of time (e.g. northbound). Velocity is ...
of its tip. Since is a rotation matrix, by definition the length of is always equal to the length of , and hence it does not change with time. Thus, when rotates, its tip moves along a circle, and the linear velocity of its tip is tangential to the circle; i.e., always perpendicular to . In this specific case, the relationship between the linear velocity vector and the angular velocity vector is \frac = \boldsymbol(t)\times \mathbf(t) = boldsymbol\times \mathbf(t) (see
circular motion In physics, circular motion is a movement of an object along the circumference of a circle or rotation along a circular path. It can be uniform, with constant angular rate of rotation and constant speed, or non-uniform with a changing rate of ro ...
and
cross product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and is ...
). By the transitivity of the abovementioned equations, \frac \mathbf^\mathsf(t) \mathbf(t) = boldsymbol\times \mathbf(t) which implies \frac \mathbf^\mathsf(t) = boldsymbol\times


Quaternion ↔ angular velocities

The angular velocity vector \boldsymbol = \begin \omega_x \\ \omega_y \\ \omega_z \end can be obtained from the derivative of the quaternion as follows: \begin 0 \\ \omega_x \\ \omega_y \\ \omega_z \end = 2 \frac\tilde where \tilde is the conjugate (inverse) of \mathbf. Conversely, the derivative of the quaternion is \frac = \frac\begin 0 \\ \omega_x \\ \omega_y \\ \omega_z \end\mathbf \,.


Rotors in a geometric algebra

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 Interior may refer to: Arts and media * ''Interior'' (Degas) (also known as ''The Rape''), painting by Edgar Degas * ''Interior'' (play), 1895 play by Belgian playwright Maurice Maeterlinck * ''The Interior'' (novel), by Lisa See * Interior de ...
and
cross product In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and is ...
s, given by \mathbf = \mathbf \cdot \mathbf + \mathbf \wedge \mathbf where the symbol denotes the exterior product or wedge product. This product of vectors , and produces two terms: a scalar part from the inner product and a
bivector In mathematics, a bivector or 2-vector is a quantity in exterior algebra or geometric algebra that extends the idea of scalars and vectors. If a scalar is considered a degree-zero quantity, and a vector is a degree-one quantity, then a bivector ca ...
part from the wedge product. This bivector describes the plane perpendicular to what the cross product of the vectors would return. Bivectors in GA have some unusual properties compared to vectors. Under the geometric product, bivectors have a negative square: the bivector describes the -plane. Its square is . Because the unit basis vectors are orthogonal to each other, the geometric product reduces to the antisymmetric outer product – and can be swapped freely at the cost of a factor of −1. The square reduces to since the basis vectors themselves square to +1. This result holds generally for all bivectors, and as a result the bivector plays a role similar to the
imaginary unit The imaginary unit or unit imaginary number () is a solution to the quadratic equation x^2+1=0. Although there is no real number with this property, can be used to extend the real numbers to what are called complex numbers, using addition an ...
. Geometric algebra uses bivectors in its analogue to the quaternion, the ''rotor'', given by \mathbf = \exp\left(\frac\right) = \cos \frac - \hat\mathbf \sin \frac\,, where is a unit bivector that describes the
plane of rotation In geometry, a plane of rotation is an abstract object used to describe or visualize rotations in space. In three dimensions it is an alternative to the axis of rotation, but unlike the axis of rotation it can be used in other dimensions, such as ...
. Because squares to −1, the
power series In mathematics, a power series (in one variable) is an infinite series of the form \sum_^\infty a_n \left(x - c\right)^n = a_0 + a_1 (x - c) + a_2 (x - c)^2 + \dots where ''an'' represents the coefficient of the ''n''th term and ''c'' is a const ...
expansion of generates the
trigonometric function In mathematics, the trigonometric functions (also called circular functions, angle functions or goniometric functions) are real functions which relate an angle of a right-angled triangle to ratios of two side lengths. They are widely used in all ...
s. The rotation formula that maps a vector to a rotated vector is then \mathbf = \mathbf^\dagger where \mathbf^\dagger = \exp\left(\frac\hat\mathbf \theta\right) = \cos \frac + \hat\mathbf \sin \frac is the ''reverse'' of \scriptstyle R (reversing the order of the vectors in B is equivalent to changing its sign). Example. A rotation about the axis \hat \mathbf = \frac\left(\hat \mathbf + \hat \mathbf + \hat \mathbf\right) can be accomplished by converting to its dual bivector, \hat \mathbf = \hat \mathbf \hat \mathbf \hat \mathbf \hat \mathbf = \mathbf \hat \mathbf \,, where is the unit volume element, the only trivector (pseudoscalar) in three-dimensional space. The result is \hat \mathbf = \frac\left(\hat \mathbf \hat \mathbf + \hat \mathbf \hat \mathbf + \hat \mathbf \hat \mathbf\right) \,. In three-dimensional space, however, it is often simpler to leave the expression for , using the fact that commutes with all objects in 3D and also squares to −1. A rotation of the vector in this plane by an angle is then \hat \mathbf' = \mathbf \hat \mathbf \mathbf^\dagger = e^ \hat \mathbf e^ = \hat \mathbf \cos^2 \frac + \mathbf \left(\hat \mathbf \hat \mathbf - \hat \mathbf \hat \mathbf\right) \cos \frac \sin \frac + \hat \mathbf \hat \mathbf \hat \mathbf \sin^2 \frac Recognizing that \mathbf (\hat \mathbf \hat \mathbf - \hat \mathbf \hat \mathbf) = 2\mathbf (\hat \mathbf \wedge \hat \mathbf) and that is the reflection of about the plane perpendicular to gives a geometric interpretation to the rotation operation: the rotation preserves the components that are parallel to and changes only those that are perpendicular. The terms are then computed: \begin \hat \mathbf \hat \mathbf \hat \mathbf &= \frac \left(-\hat \mathbf + 2 \hat \mathbf + 2 \hat \mathbf\right) \\ 2\mathbf \hat \mathbf \wedge \hat \mathbf &= 2\mathbf \frac \left(\hat \mathbf \hat \mathbf + \hat \mathbf \hat \mathbf\right) = \frac \left(\hat \mathbf - \hat \mathbf\right) \end The result of the rotation is then \hat \mathbf' = \hat \mathbf \left(\cos^2 \frac - \frac \sin^2 \frac\right) + \frac \hat \mathbf \sin \frac \left(\sin \frac + \sqrt \cos \frac\right) + \frac \hat \mathbf \sin \frac \left(\sin \frac - \sqrt \cos \frac\right) A simple check on this result is the angle . Such a rotation should map to . Indeed, the rotation reduces to \begin \hat \mathbf' &= \hat \mathbf\left(\frac - \frac \frac\right) + \frac \hat \mathbf \frac \left(\frac + \sqrt\frac\right) + \frac \hat \mathbf \frac \left(\frac - \sqrt\frac\right) \\ &= 0 \hat \mathbf + \hat \mathbf + 0 \hat \mathbf = \hat \mathbf \end 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 \mathbf = \mathbf_ \mathbf_ \mathbf_\alpha = \exp\left(\frac\right) \exp\left(\frac\right) \exp\left(\frac\right) but \begin \hat \mathbf' &= \mathbf_\alpha \hat \mathbf \mathbf_\alpha^\dagger \quad \text \\ \hat \mathbf' &= \mathbf_ \hat \mathbf \mathbf_^\dagger \,. \end These rotors come back out of the exponentials like so: \mathbf_ = \cos \frac - \mathbf \mathbf_\alpha \hat \mathbf \mathbf_\alpha^\dagger \sin \frac = \mathbf_\alpha \mathbf_\beta \mathbf_\alpha^\dagger where refers to rotation in the original coordinates. Similarly for the rotation, \mathbf_ = \mathbf_ \mathbf_\gamma \mathbf_^\dagger = \mathbf_\alpha \mathbf_\beta \mathbf_\alpha^\dagger \mathbf_\gamma \mathbf_\alpha \mathbf_\beta^\dagger \mathbf_\alpha^\dagger \,. Noting that and commute (rotations in the same plane must commute), and the total rotor becomes \mathbf = \mathbf_\alpha \mathbf_\beta \mathbf_\gamma Thus, the compounded rotations of Euler angles become a series of equivalent rotations in the original fixed frame. 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.


Angle-Angle-Angle

Rotations can be modeled as an axis and an angle; as illustrated with a
gyroscope A gyroscope (from Ancient Greek γῦρος ''gŷros'', "round" and σκοπέω ''skopéō'', "to look") is a device used for measuring or maintaining orientation and angular velocity. It is a spinning wheel or disc in which the axis of rota ...
which has an axis through the rotor, and the amount of spin around that axis demonstrated by the rotation of the rotor; this rotation can be expressed as \text*(\text) where axis is a unit vector specifying the direction of the rotor axis. From the origin, in any direction, is the same rotation axis, with the scale of the angle equivalent to the distance from the origin. From any other point in space, similarly the same direction vector applied relative to the orientation represented by the starting point rather than the origin applies the same change around the same axes that the unit vector specifies. The \text*\text scaling each point gives a unique coordinate in Angle-Angle-Angle notation. The difference between two coordinates immediately yields the single axis of rotation and angle between the two orientations. The natural log of a quaternion represents curving space by 3 angles around 3 axles of rotation, and is expressed in arc-length; similar to Euler angles, but order independent. There is a
Lie product formula In mathematics, the Lie product formula, named for Sophus Lie (1875), but also widely called the Trotter product formula, named after Hale Trotter, states that for arbitrary ''m'' × ''m'' real or complex matrices ''A'' and ''B'', :e^ = \li ...
definition of the addition of rotations, which is that they are sum of infinitesimal steps of each rotation applied in series; this would imply that rotations are the result of all rotations in the same instant are applied, rather than a series of rotations applied subsequently. The axes of rotation are aligned to the standard Cartesian X,Y,Z axes. These rotations may be simply added and subtracted, especially when the frames being rotated are fixed to each other as in IK chains. Differences between two objects that are in the same reference frame are found by simply subtracting their orientations. Rotations that are applied from external sources, or are from sources relative to the current rotation still require multiplications, application of the Rodriguez Formula is provided. The rotation from each axle coordinate represent rotating the plane perpendicular to the specified axis simultaneously with all other axles. Although the measures can be considered in angles, the representation is actually the arc-length of the curve; an angle implies a rotation around a point, where a curvature is a delta applied to the current point in an inertial direction. Just an observational note: log quaternions have rings, or octaves of rotations; that is for rotations greater than 4\pi have related curves. Curvatures of things that approach this boundary appear to chaotically jump orbits. For 'human readable' angles the 1-norm can be used to rescale the angles to look more 'appropriate'; much like Celsius might be considered more correct than Fahrenheit. = \begin X \\ Y \\ Z \end Other related values are immediately derivable: \begin \, V\, \text\, V\, _2 = \sqrt\\ \, V\, _1 = , X, +, Y, +, Z, \end The total angle of rotation.... \theta = \, V\, The axis of rotation... \text(\ln Q) = \begin \frac \theta \\ \frac \theta \\ \frac \theta \end


Quaternion Representation

q = \begin \cos \frac \theta \\ \sin \frac \theta \\ \sin \frac\theta \\ \sin\frac\theta \end


Basis Matrix Computation

This was built from rotating the vectors (1,0,0), (0,1,0), (0,0,1), and reducing constants. Given an input = , /math>, \begin q_r = \cos\theta \\ q_i = \sin\theta \cdot \frac\\ q_j = \sin\theta \cdot \frac\\ q_k = \sin\theta \cdot \frac \end Which are used to compute the resulting matrix... \begin 1 - 2 q_j^2 - 2 q_k^2 & 2(q_i q_j - q_k q_r) & 2(q_i q_k + q_j q_r)\\ 2(q_i q_j + q_k q_r) & 1 - 2 q_i^2 - 2q_k^2 & 2(q_j q_k - q_i q_r)\\ 2(q_i q_k - q_j q_r) & 2(q_j q_k + q_i q_r) & 1 - 2 q_i^2 - 2 q_j^2 \end


Alternate Basis Calculation

Alternatively this can be used given: = , Y ,Z convert to angle-axis \theta = \, A\, , and ,y,z= \frac Compute some partial expressions:\begin x_y = xy(1-\cos \theta) & w_x = x\sin \theta & x_x = xx(1-\cos \theta) \\ y_z = yz(1-\cos \theta) & w_y = y\sin \theta & y_y = yy(1-\cos \theta) \\ x_z = xz(1-\cos \theta) & w_z = z\sin \theta & z_z = zz(1-\cos \theta) \end Compute the resulting matrix: \begin \cos \theta+x_x & x_y + w_z & w_y + x_z \\ w_z + x_y & \cos \theta+y_y & y_z - w_x \\ x_z - w_y & w_x + y_z & \cos \theta+z_z \end Expanded: \begin \cos \theta+x^2 (1-\cos \theta) & xy(1-\cos \theta) - z\sin \theta & y\sin \theta + xz(1-\cos \theta) \\ z\sin \theta + xy(1-\cos \theta) & \cos \theta+y^2 (1-\cos \theta) & yz(1-\cos \theta) - x\sin \theta \\ xz(1-\cos \theta) - y\sin \theta & x\sin \theta + yz(1-\cos \theta) & \cos \theta+z^(1-\cos \theta) \end


Vector Rotation

Rotate the vector v = (X, Y, Z) around the rotation vector Q = (X,Y,Z) . The angle of rotation will be = . Calculate the cosine of the angle times the vector to rotate, plus sine of the angle times the axis of rotation, plus one minus cosine of the angle times the dot product of the vector and rotation axis times the axis of rotation. V' = \cos(\theta) * v + \sin(\theta) * \left( \frac Q \times v \right) + (1-\cos(\theta) ) \left( \frac Q \cdot v \right) * \frac Q Some notes: the dot product includes the cosine of the angle between the vector being rotated and the axis of rotation times the length of V; the cross product includes the sine of the angle between the vector being rotated and the axis of rotation.


Rotate a Rotation Vector

Using Rodrigues Composite Rotation Formula For a given rotation vector = (X,Y,Z), and another rotation vector =(X,Y,Z) to rotate the frame around. From the initial rotation vectors, extract the angles and axes: \theta = \frac \gamma = \frac Normalized axis of rotation for the current frame: Q_n = \frac Normalized axis of rotation to rotate the frame around: A_n = \frac The result angle angle of the rotation is \alpha = 2 \cos^( \cos(\theta) \cos(\gamma) + \sin(\theta) \sin(\gamma) Q_n \cdot A_n ) or \alpha = 2 cos^( ( 1 - (Q_n \cdot A_n) ) + (1 + (Q_n \cdot A_n)) ) The result, un-normalized axis of rotation: r = \sin(\gamma) \cos(\theta) A_n + \sin(\theta) \cos(\gamma) Q_n + \sin(\theta) \sin(\gamma) A_n \times Q_n or r = ( A_n \times Q_n ) ( - ) + A_n (+) + Q_n (-) The Rodrigues Rotation Formula would lead that the sin of above resulting angle can be used to normalize the vector, however this fails for large ranges; so normalize the result axis as any other vector. R_n = \frac r And the final frame rotation coordinate: R = \alpha R_n


Spin rotation around a fixed axis

A rotation vector represents three axes; these may be used as a shorthand to rotate the rotation around using the above 'Rotate a Rotation Vector'. These expressions are best represented as code fragments. Setup some constants used in other expressions. \begin n_x &= \frac \\ n_y &= \frac \\ n_z &= \frac \\ \text &= \, Q\, \\ s &= \sin(\text) \\ c_1 &= \cos(\text) \\ c &= 1 - c_1 \end using the above values... \text = \left = c n_x^2 + c_1, \; y = c n_x n_y + s n_z, \; z = c n_x n_z - s n_y\right/math> or \text = \left = c n_y n_x - s n_z, \; y = c n_y^2 + c_1, \; z = c n_y n_z + s n_x\right/math> or \text = \left = c n_z n_x + s n_y, \; y = c n_z n_y - s n_x, \; z = c n_z^2 + c_1\right/math>


Conversion from Basis Matrix

Compute the determinant of the matrix... d = \frac Convert to the angle of rotation... \theta = 2 \arccos(d) yz = \text_ - \text_ xz = \text_ - \text_ xy = \text_ - \text_ compute the normal factor... \text = \frac 1 \sqrt n = \begin yz \cdot \text\\ xz \cdot \text\\ xy \cdot \text \end the resulting angle-angle-angle: \cdot \theta


Conversion from Normal Vector(Y)

Representation of a normal as a rotation, this assumes that the vector (0,1,0) is 'up'. If some other axle is considered primary, the coordinates can be simply swapped. This assume a normalized input vector in the direction of the normal N = \begin \text_X \\ \text_Y \\ \text_Z \end The angle is simply the sum of the x/z coordinate(or y,x if Z is 'up', or y,z if X is 'up')... \text = , N_x, + , N_z, if angle is 0, the job is done, result with (0,0,0) r = 1/(\text) Some temporary values; these values are just partials referenced later... t = \begin N_x \cdot r\\ N_y\\ N_z \cdot r \end Use the projected normal on the Y axis as the angle to rotate... \text_\text = \cos^( t_Y ) \text = \begin t_Z \cdot \text_\text\\ 0\\ -t_X \cdot \text_\text \end


Align Normal using Basis

The default tangent and bi-tangent of rotations which only have their normal set, results in tangents and bi-tangents that are irregular. Alternatively build a basis matrix, and convert from basis using the above mentioned method. Compute the normal of the above, and the matrix to convert... \text_\text = \begin \left(N_y \cdot \frac \right)&N_x&\frac \\ \left(N_z \cdot \frac \right)-\left(N_x \cdot \frac \right)&N_y&0\\ \left(-N_y \cdot \frac \right)&N_z&\frac \end And then use the basis to log quaternion conversion...


Align Normal Directly

Or This is the direct computation to result with a log quaternion; compute the above result vector and then... \begin t_ = t_X\cdot \text_\text \\ t_ = t_Z\cdot \text_\text \\ s = \sin( \text_\text ) \\ c = 1- \cos( \text_\text ) \end This is the angle \text = \arccos( ( t_Y + 1 ) * ( 1 - t_ ) / 2 - 1 ); These partial products are used below... \begin yz = s \cdot n_X \\ xz = ( 2 - c \cdot (n_X^2 + n_Z^2) ) \cdot t_\\ xy = s \cdot n_X * t_ + s \cdot n_Z \cdot (1-t_) \end Compute the normalized rotation vector (axle of rotation)... n = \begin \frac\\ \frac\\ \frac \end and finally compute the resulting log quaternion. \text_\text = \text \cdot


Conversion from axis-angle

This assumes the input axis = , /math> is normalized. If there is 0 rotation, result with (0,0,0) \theta = \text \text = \theta *


See also

* Euler filter *
Orientation (geometry) In geometry, the orientation, angular position, attitude, bearing, or direction of an object such as a line, plane or rigid body is part of the description of how it is placed in the space it occupies. More specifically, it refers to the imagin ...
*
Rotation around a fixed axis Rotation around a fixed axis is a special case of rotational motion. The fixed-axis hypothesis excludes the possibility of an axis changing its orientation and cannot describe such phenomena as wobbling or precession. According to Euler's rota ...
*
Three-dimensional rotation operator This article derives the main properties of rotations in 3-dimensional space. The three Euler rotations are one way to bring a rigid body to any desired orientation by sequentially making rotations about axis' fixed relative to the object. Ho ...


References


Further reading

* * * * * * * * * * * *


External links


EuclideanSpace
has a wealth of information on rotation representation

and ttp://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
Imaginary numbers are not Real – the Geometric Algebra of Spacetime
– Section "Rotations and Geometric Algebra" derives and applies the rotor description of rotations

– 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. {{DEFAULTSORT:Rotation Formalisms In 3 Dimensions Rotation Euclidean symmetries Orientation (geometry) Rigid bodies mechanics