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,
,
and
, 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)
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
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
which is another way of stating that
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,
(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 ...
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 ,
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):
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
and angle this versor's components are expressed as follows:
Inspection shows that the quaternion parametrization obeys the following constraint:
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
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
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
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
we can represent this with quaternion parameters in a similarly concise way:
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:
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,
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,
that is
Expand this quaternion product to
Divide both sides of this equation by the identity resulting from the previous one,
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
Its components can be expressed in terms of the components of a unit quaternion representing the same rotation as
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 than the projection of the original quaternion q. Comparing components one obtains that
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:
wherein
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 ...
,
is the transverse component of p with respect to n, and
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 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 -axis) can be obtained as follows:
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.
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:
This yields
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 .
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:
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:
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
is the cross-product matrix.
This expands to:
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
from the rotation matrix is as follows:
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:
The rotation matrix corresponding to the quaternion can be computed as follows:
where
which gives
or equivalently
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
from the Euler angles as follows:
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
Quaternion → Euler angles ( extrinsic)
Given the rotation quaternion
the -convention 3-1-3 extrinsic Euler Angles can be computed by
Quaternion → Euler angles ( intrinsic)
Given the rotation quaternion
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
Euler axis–angle ↔ quaternion
Given the Euler axis and angle , the quaternion
can be computed by
Given the rotation quaternion , define
Then the Euler axis and angle can be computed by
Rotation matrix ↔ Rodrigues vector
Rodrigues vector → Rotation matrix
Since the definition of the Rodrigues vector can be related to rotation quaternions:By making use of the following propertyThe formula can be obtained by factoring from the final expression obtained for quaternions:
Leading to the final formula:
Conversion formulae for derivatives
Rotation matrix ↔ angular velocities
The angular velocity vector
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:
The derivation is adapted from Ioffe as follows:
For any vector , consider and differentiate it:
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
(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,
which implies
Quaternion ↔ angular velocities
The angular velocity vector
can be obtained from the derivative of the quaternion as follows:
where is the conjugate (inverse) of .
Conversely, the derivative of the quaternion is
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
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
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
where
is the ''reverse'' of (reversing the order of the vectors in is equivalent to changing its sign).
Example. A rotation about the axis
can be accomplished by converting to its dual bivector,
where is the unit volume element, the only trivector (pseudoscalar) in three-dimensional space. The result is
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
Recognizing that
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:
The result of the rotation is then
A simple check on this result is the angle . Such a rotation should map to . Indeed, the rotation reduces to
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
but
These rotors come back out of the exponentials like so:
where refers to rotation in the original coordinates. Similarly for the rotation,
Noting that and commute (rotations in the same plane must commute), and the total rotor becomes
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 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 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 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 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.
Other related values are immediately derivable:
The total angle of rotation....
The axis of rotation...
Quaternion Representation
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