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
 [math]\displaystyle{ R = \begin{bmatrix} \cos \theta & \sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} }[/math]
rotates points in the xy plane counterclockwise through an angle θ about the origin of a twodimensional Cartesian coordinate system. To perform the rotation on a plane point with standard coordinates v = (x, y), it should be written as a column vector, and multiplied by the matrix R:
 [math]\displaystyle{ R\mathbf{v} = \begin{bmatrix} \cos \theta & \sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} x\cos\thetay\sin\theta \\ x\sin\theta+y\cos\theta \end{bmatrix}. }[/math]
If x and y are the endpoint coordinates of a vector, where x is cosine and y is sine, then the above equations become the trigonometric summation angle formulae. Indeed, a rotation matrix can be seen as the trigonometric summation angle formulae in matrix form. One way to understand this is to say we have a vector at an angle 30° from the x axis, and we wish to rotate that angle by a further 45°. We simply need to compute the vector endpoint coordinates at 75°.
The examples in this article apply to active rotations of vectors counterclockwise in a righthanded coordinate system (y counterclockwise from x) by premultiplication (R on the left). If any one of these is changed (such as rotating axes instead of vectors, a passive transformation), then the inverse of the example matrix should be used, which coincides with its transpose.
Since matrix multiplication has no effect on the zero vector (the coordinates of the origin), rotation matrices describe rotations about the origin. Rotation matrices provide an algebraic description of such rotations, and are used extensively for computations in geometry, physics, and computer graphics. In some literature, the term rotation is generalized to include improper rotations, characterized by orthogonal matrices with a determinant of −1 (instead of +1). These combine proper rotations with reflections (which invert orientation). In other cases, where reflections are not being considered, the label proper may be dropped. The latter convention is followed in this article.
Rotation matrices are square matrices, with real entries. More specifically, they can be characterized as orthogonal matrices with determinant 1; that is, a square matrix R is a rotation matrix if and only if R^{T} = R^{−1} and det R = 1. The set of all orthogonal matrices of size n with determinant +1 is a representation of a group known as the special orthogonal group SO(n), one example of which is the rotation group SO(3). The set of all orthogonal matrices of size n with determinant +1 or −1 is a representation of the (general) orthogonal group O(n).
In two dimensions
In two dimensions, the standard rotation matrix has the following form:
 [math]\displaystyle{ R(\theta) = \begin{bmatrix} \cos\theta & \sin\theta \\ \sin\theta & \cos\theta \\ \end{bmatrix}. }[/math]
This rotates column vectors by means of the following matrix multiplication,
 [math]\displaystyle{ \begin{bmatrix} x' \\ y' \\ \end{bmatrix} = \begin{bmatrix} \cos\theta & \sin\theta \\ \sin\theta & \cos\theta \\ \end{bmatrix}\begin{bmatrix} x \\ y \\ \end{bmatrix}. }[/math]
Thus, the new coordinates (x′, y′) of a point (x, y) after rotation are
 [math]\displaystyle{ \begin{align} x' &= x \cos\theta  y \sin\theta\, \\ y' &= x \sin\theta + y \cos\theta\, \end{align}. }[/math]
Examples
For example, when the vector
 [math]\displaystyle{ \mathbf{\hat{x}} = \begin{bmatrix} 1 \\ 0 \\ \end{bmatrix} }[/math]
is rotated by an angle θ, its new coordinates are
 [math]\displaystyle{ \begin{bmatrix} \cos\theta \\ \sin\theta \\ \end{bmatrix}, }[/math]
and when the vector
 [math]\displaystyle{ \mathbf{\hat{y}} = \begin{bmatrix} 0 \\ 1 \\ \end{bmatrix} }[/math]
is rotated by an angle θ, its new coordinates are
 [math]\displaystyle{ \begin{bmatrix} \sin\theta \\ \cos\theta \\ \end{bmatrix}. }[/math]
Direction
The direction of vector rotation is counterclockwise if θ is positive (e.g. 90°), and clockwise if θ is negative (e.g. −90°) for [math]\displaystyle{ R(\theta) }[/math]. Thus the clockwise rotation matrix is found as
 [math]\displaystyle{ R(\theta) = \begin{bmatrix} \cos\theta & \sin\theta \\ \sin\theta & \cos\theta \\ \end{bmatrix}. }[/math]
The twodimensional case is the only nontrivial (i.e. not onedimensional) case where the rotation matrices group is commutative, so that it does not matter in which order multiple rotations are performed. An alternative convention uses rotating axes,^{[1]} and the above matrices also represent a rotation of the axes clockwise through an angle θ.
Nonstandard orientation of the coordinate system
If a standard righthanded Cartesian coordinate system is used, with the xaxis to the right and the yaxis up, the rotation R(θ) is counterclockwise. If a lefthanded Cartesian coordinate system is used, with x directed to the right but y directed down, R(θ) is clockwise. Such nonstandard orientations are rarely used in mathematics but are common in 2D computer graphics, which often have the origin in the top left corner and the yaxis down the screen or page.^{[2]}
See below for other alternative conventions which may change the sense of the rotation produced by a rotation matrix.
Common 2D rotations
Particularly useful are the matrices
 [math]\displaystyle{ \begin{bmatrix} 0 & 1 \\[3pt] 1 & 0 \\ \end{bmatrix}, \quad \begin{bmatrix} 1 & 0 \\[3pt] 0 & 1 \\ \end{bmatrix}, \quad \begin{bmatrix} 0 & 1 \\[3pt] 1 & 0 \\ \end{bmatrix} }[/math]
for 90°, 180°, and 270° counterclockwise rotations.
Relationship with complex plane
Since
 [math]\displaystyle{ \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}^2 \ =\ \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \ = I, }[/math]
the matrices of the shape
 [math]\displaystyle{ \begin{bmatrix} x & y \\ y & x \end{bmatrix} }[/math]
form a ring isomorphic to the field of the complex numbers [math]\displaystyle{ \C }[/math]. Under this isomorphism, the rotation matrices correspond to circle of the unit complex numbers, the complex numbers of modulus 1.
If one identifies [math]\displaystyle{ \mathbb R^2 }[/math] with [math]\displaystyle{ \mathbb C }[/math] through the linear isomorphism [math]\displaystyle{ (a,b)\mapsto a+ib, }[/math] the action of a matrix of the above form on vectors of [math]\displaystyle{ \mathbb R^2 }[/math] corresponds to the multiplication by the complex number x + iy, and rotations correspond to multiplication by complex numbers of modulus 1.
As every rotation matrix can be written
 [math]\displaystyle{ \begin{pmatrix}\cos t&\sin t\\ \sin t&\cos t\end{pmatrix}, }[/math]
the above correspondence associates such a matrix with the complex number
 [math]\displaystyle{ \cos t + i\sin t=e^{it} }[/math]
(this last equality is Euler's formula).
In three dimensions
Basic 3D rotations
A basic 3D rotation (also called elemental rotation) is a rotation about one of the axes of a coordinate system. The following three basic rotation matrices rotate vectors by an angle θ about the x, y, or zaxis, in three dimensions, using the righthand rule—which codifies their alternating signs. Notice that the righthand rule only works when multiplying [math]\displaystyle{ R \cdot \vec{x} }[/math]. (The same matrices can also represent a clockwise rotation of the axes.^{[nb 1]})
 [math]\displaystyle{ \begin{alignat}{1} R_x(\theta) &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & \sin \theta \\[3pt] 0 & \sin \theta & \cos \theta \\[3pt] \end{bmatrix} \\[6pt] R_y(\theta) &= \begin{bmatrix} \cos \theta & 0 & \sin \theta \\[3pt] 0 & 1 & 0 \\[3pt] \sin \theta & 0 & \cos \theta \\ \end{bmatrix} \\[6pt] R_z(\theta) &= \begin{bmatrix} \cos \theta & \sin \theta & 0 \\[3pt] \sin \theta & \cos \theta & 0 \\[3pt] 0 & 0 & 1 \\ \end{bmatrix} \end{alignat} }[/math]
For column vectors, each of these basic vector rotations appears counterclockwise when the axis about which they occur points toward the observer, the coordinate system is righthanded, and the angle θ is positive. R_{z}, for instance, would rotate toward the yaxis a vector aligned with the xaxis, as can easily be checked by operating with R_{z} on the vector (1,0,0):
 [math]\displaystyle{ R_z(90^\circ) \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} = \begin{bmatrix} \cos 90^\circ & \sin 90^\circ & 0 \\ \sin 90^\circ & \quad\cos 90^\circ & 0\\ 0 & 0 & 1\\ \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0\\ 0 & 0 & 1\\ \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ 0 \\ \end{bmatrix} }[/math]
This is similar to the rotation produced by the abovementioned twodimensional rotation matrix. See below for alternative conventions which may apparently or actually invert the sense of the rotation produced by these matrices.
General 3D rotations
Other 3D rotation matrices can be obtained from these three using matrix multiplication. For example, the product
 [math]\displaystyle{ \begin{align} R = R_z(\alpha) \, R_y(\beta) \, R_x(\gamma) &= \overset\text{yaw}{\begin{bmatrix} \cos \alpha & \sin \alpha & 0 \\ \sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}}\overset\text{pitch}{\begin{bmatrix} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ \sin \beta & 0 & \cos \beta \\ \end{bmatrix}}\overset\text{roll}{\begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \gamma & \sin \gamma \\ 0 & \sin \gamma & \cos \gamma \\ \end{bmatrix}} \\ &= \begin{bmatrix} \cos\alpha\cos\beta & \cos\alpha\sin\beta\sin\gamma  \sin\alpha\cos\gamma & \cos\alpha\sin\beta\cos\gamma + \sin\alpha\sin\gamma \\ \sin\alpha\cos\beta & \sin\alpha\sin\beta\sin\gamma + \cos\alpha\cos\gamma & \sin\alpha\sin\beta\cos\gamma  \cos\alpha\sin\gamma \\ \sin\beta & \cos\beta\sin\gamma & \cos\beta\cos\gamma \\ \end{bmatrix} \end{align} }[/math]
represents a rotation whose yaw, pitch, and roll angles are α, β and γ, respectively. More formally, it is an intrinsic rotation whose Tait–Bryan angles are α, β, γ, about axes z, y, x, respectively. Similarly, the product
 [math]\displaystyle{ \begin{align} \\ R = R_z(\gamma) \, R_y(\beta) \, R_x(\alpha) &= \begin{bmatrix} \cos \gamma & \sin \gamma & 0 \\ \sin \gamma & \cos \gamma & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}\begin{bmatrix} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ \sin \beta & 0 & \cos \beta \\ \end{bmatrix}\begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \alpha & \sin \alpha \\ 0 & \sin \alpha & \cos \alpha \\ \end{bmatrix} \\ &= \begin{bmatrix} \cos\beta\cos\gamma & \sin\alpha\sin\beta\cos\gamma  \cos\alpha\sin\gamma & \cos\alpha\sin\beta\cos\gamma + \sin\alpha\sin\gamma \\ \cos\beta\sin\gamma & \sin\alpha\sin\beta\sin\gamma + \cos\alpha\cos\gamma & \cos\alpha\sin\beta\sin\gamma  \sin\alpha\cos\gamma \\ \sin\beta & \sin\alpha\cos\beta & \cos\alpha\cos\beta \\ \end{bmatrix} \end{align} }[/math]
represents an extrinsic rotation whose (improper) Euler angles are α, β, γ, about axes x, y, z.
These matrices produce the desired effect only if they are used to premultiply column vectors, and (since in general matrix multiplication is not commutative) only if they are applied in the specified order (see Ambiguities for more details). The order of rotation operations is from right to left; the matrix adjacent to the column vector is the first to be applied, and then the one to the left.^{[3]}
Conversion from rotation matrix to axis–angle
Every rotation in three dimensions is defined by its axis (a vector along this axis is unchanged by the rotation), and its angle — the amount of rotation about that axis (Euler rotation theorem).
There are several methods to compute the axis and angle from a rotation matrix (see also axis–angle representation). Here, we only describe the method based on the computation of the eigenvectors and eigenvalues of the rotation matrix. It is also possible to use the trace of the rotation matrix.
Determining the axis
Given a 3 × 3 rotation matrix R, a vector u parallel to the rotation axis must satisfy
 [math]\displaystyle{ R\mathbf{u} = \mathbf{u}, }[/math]
since the rotation of u around the rotation axis must result in u. The equation above may be solved for u which is unique up to a scalar factor unless R = I.
Further, the equation may be rewritten
 [math]\displaystyle{ R\mathbf{u} = I \mathbf{u} \implies \left(R  I\right) \mathbf{u} = 0, }[/math]
which shows that u lies in the null space of R − I.
Viewed in another way, u is an eigenvector of R corresponding to the eigenvalue λ = 1. Every rotation matrix must have this eigenvalue, the other two eigenvalues being complex conjugates of each other. It follows that a general rotation matrix in three dimensions has, up to a multiplicative constant, only one real eigenvector.
One way to determine the rotation axis is by showing that:
 [math]\displaystyle{ \begin{align} 0 &= R^\mathsf{T} 0 + 0 \\ &= R^\mathsf{T}\left(R  I\right) \mathbf{u} + \left(R  I\right) \mathbf{u} \\ &= \left(R^\mathsf{T}R  R^\mathsf{T} + R  I\right) \mathbf{u} \\ &= \left(I  R^\mathsf{T} + R  I\right) \mathbf{u} \\ &= \left(R  R^\mathsf{T}\right) \mathbf{u} \end{align} }[/math]
Since (R − R^{T}) is a skewsymmetric matrix, we can choose u such that
 [math]\displaystyle{ [\mathbf u]_{\times} = \left(R  R^\mathsf{T}\right). }[/math]
The matrix–vector product becomes a cross product of a vector with itself, ensuring that the result is zero:
 [math]\displaystyle{ \left(R  R^\mathsf{T}\right) \mathbf{u} = [\mathbf u]_{\times} \mathbf{u} = \mathbf{u} \times \mathbf{u} = 0\, }[/math]
Therefore, if
 [math]\displaystyle{ R = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix}, }[/math]
then
 [math]\displaystyle{ \mathbf{u} = \begin{bmatrix} hf \\ cg \\ db \\ \end{bmatrix}. }[/math]
The magnitude of u computed this way is u = 2 sin θ, where θ is the angle of rotation.
This does not work if R is symmetric. Above, if R − R^{T} is zero, then all subsequent steps are invalid. In this case, it is necessary to diagonalize R and find the eigenvector corresponding to an eigenvalue of 1.
Determining the angle
To find the angle of a rotation, once the axis of the rotation is known, select a vector v perpendicular to the axis. Then the angle of the rotation is the angle between v and Rv.
A more direct method, however, is to simply calculate the trace: the sum of the diagonal elements of the rotation matrix. Care should be taken to select the right sign for the angle θ to match the chosen axis:
 [math]\displaystyle{ \operatorname{tr} (R) = 1 + 2\cos\theta , }[/math]
from which follows that the angle's absolute value is
 [math]\displaystyle{ \theta = \arccos\left(\frac{\operatorname{tr}(R)  1}{2}\right). }[/math]
For the rotation axis [math]\displaystyle{ \mathbf{n}=(n_1,n_2,n_3) }[/math], you can get the correct angle^{[4]} from
[math]\displaystyle{ \left\{\begin{matrix} \cos \theta&=&\dfrac{\operatorname{tr}(R)  1}{2}\\ \sin \theta&=&\dfrac{\operatorname{tr}(K_n R)}{2} \end{matrix}\right. }[/math]
where
[math]\displaystyle{ K_n=\begin{bmatrix} 0 & n_3 & n_2\\ n_3 & 0 & n_1\\ n_2 & n_1 & 0\\ \end{bmatrix} }[/math]
Rotation matrix from axis and angle
The matrix of a proper rotation R by angle θ around the axis u = (u_{x}, u_{y}, u_{z}), a unit vector with u2x + u2y + u2z = 1, is given by:^{[5]}
 [math]\displaystyle{ R = \begin{bmatrix} \cos \theta +u_x^2 \left(1\cos \theta\right) & u_x u_y \left(1\cos \theta\right)  u_z \sin \theta & u_x u_z \left(1\cos \theta\right) + u_y \sin \theta \\ u_y u_x \left(1\cos \theta\right) + u_z \sin \theta & \cos \theta + u_y^2\left(1\cos \theta\right) & u_y u_z \left(1\cos \theta\right)  u_x \sin \theta \\ u_z u_x \left(1\cos \theta\right)  u_y \sin \theta & u_z u_y \left(1\cos \theta\right) + u_x \sin \theta & \cos \theta + u_z^2\left(1\cos \theta\right) \end{bmatrix}. }[/math]
A derivation of this matrix from first principles can be found in section 9.2 here.^{[6]} The basic idea to derive this matrix is dividing the problem into few known simple steps.
 First rotate the given axis and the point such that the axis lies in one of the coordinate planes (xy, yz or zx)
 Then rotate the given axis and the point such that the axis is aligned with one of the two coordinate axes for that particular coordinate plane (x, y or z)
 Use one of the fundamental rotation matrices to rotate the point depending on the coordinate axis with which the rotation axis is aligned.
 Reverse rotate the axispoint pair such that it attains the final configuration as that was in step 2 (Undoing step 2)
 Reverse rotate the axispoint pair which was done in step 1 (undoing step 1)
This can be written more concisely as
 [math]\displaystyle{ R = (\cos\theta)\,I + (\sin\theta)\,[\mathbf u]_{\times} + (1\cos\theta)\,(\mathbf{u}\otimes\mathbf{u}), }[/math]
where [u]_{×} is the cross product matrix of u; the expression u ⊗ u is the outer product, and I is the identity matrix. Alternatively, the matrix entries are:
 [math]\displaystyle{ R_{jk}=\begin{cases} \cos^2\frac{\theta}{2}+\sin^2\frac{\theta}{2}\left(2u_j^21\right), \quad &\text{if }j=k\\ 2u_ju_k\sin^2\frac{\theta}{2}\varepsilon_{jkl}u_l\sin\theta, \quad &\text{if }j\neq k \end{cases} }[/math]
where ε_{jkl} is the LeviCivita symbol with ε_{123} = 1. This is a matrix form of Rodrigues' rotation formula, (or the equivalent, differently parametrized Euler–Rodrigues formula) with^{[nb 2]}
 [math]\displaystyle{ \mathbf{u}\otimes\mathbf{u} = \mathbf{u}\mathbf{u}^\mathsf{T} = \begin{bmatrix} u_x^2 & u_x u_y & u_x u_z \\[3pt] u_x u_y & u_y^2 & u_y u_z \\[3pt] u_x u_z & u_y u_z & u_z^2 \end{bmatrix},\qquad [\mathbf u]_{\times} = \begin{bmatrix} 0 & u_z & u_y \\[3pt] u_z & 0 & u_x \\[3pt] u_y & u_x & 0 \end{bmatrix}. }[/math]
In [math]\displaystyle{ \mathbb{R}^3 }[/math] the rotation of a vector x around the axis u by an angle θ can be written as:
 [math]\displaystyle{ R_{\mathbf{u}}(\theta)\mathbf{x}=\mathbf{u}(\mathbf{u}\cdot\mathbf{x})+\cos\left(\theta\right)(\mathbf{u}\times\mathbf{x})\times\mathbf{u}+\sin\left(\theta\right)(\mathbf{u}\times\mathbf{x}) }[/math]
or equiviliently:
 [math]\displaystyle{ R_{\mathbf{u}}(\theta)\mathbf{x}= \mathbf{x} \cos(\theta) + \mathbf{u}(\mathbf{x} \cdot \mathbf{u})(1 \cos(\theta))  \mathbf{x} \times \mathbf{u} \sin{\theta} }[/math]
This can also be written in tensor notation as:
 [math]\displaystyle{ (R_{\mathbf{u}}(\theta)\mathbf{x})_i = (R_{\mathbf{u}}(\theta))_{ij} {\mathbf{x}}_{j} \quad \text{with} \quad (R_{\mathbf{u}}(\theta))_{ij} = \delta_{ij}\cos(\theta) + \mathbf{u}_i\mathbf{u}_j (1 \cos(\theta))  \sin{\theta} \varepsilon_{ijk} \mathbf{u}_{k} }[/math]
If the 3D space is righthanded and θ > 0, this rotation will be counterclockwise when u points towards the observer (Righthand rule). Explicitly, with [math]\displaystyle{ (\boldsymbol{\alpha}, \boldsymbol{\beta},\mathbf u) }[/math] a righthanded orthonormal basis,
 [math]\displaystyle{ R_{\mathbf{u}}(\theta)\boldsymbol{\alpha}= \cos\left(\theta\right) \boldsymbol{\alpha} + \sin\left(\theta\right) \boldsymbol{\beta}, \quad R_{\mathbf{u}}(\theta)\boldsymbol{\beta}=  \sin\left(\theta\right) \boldsymbol{\alpha} + \cos\left(\theta\right) \boldsymbol{\beta}, \quad R_{\mathbf{u}}(\theta)\mathbf{u}=\mathbf{u}. }[/math]
Note the striking merely apparent differences to the equivalent Liealgebraic formulation below.
Properties
For any ndimensional rotation matrix R acting on [math]\displaystyle{ \mathbb{R}^n, }[/math]
 [math]\displaystyle{ R^\mathsf{T} = R^{1} }[/math] (The rotation is an orthogonal matrix)
It follows that:
 [math]\displaystyle{ \det R = \pm 1 }[/math]
A rotation is termed proper if det R = 1, and improper (or a rotoreflection) if det R = –1. For even dimensions n = 2k, the n eigenvalues λ of a proper rotation occur as pairs of complex conjugates which are roots of unity: λ = e^{±iθj} for j = 1, ..., k, which is real only for λ = ±1. Therefore, there may be no vectors fixed by the rotation (λ = 1), and thus no axis of rotation. Any fixed eigenvectors occur in pairs, and the axis of rotation is an evendimensional subspace.
For odd dimensions n = 2k + 1, a proper rotation R will have an odd number of eigenvalues, with at least one λ = 1 and the axis of rotation will be an odd dimensional subspace. Proof:
 [math]\displaystyle{ \begin{align} \det\left(R  I\right) &= \det\left(R^\mathsf{T}\right) \det\left(R  I\right) = \det\left(R^\mathsf{T}R  R^\mathsf{T}\right) = \det\left(I  R^\mathsf{T}\right) \\ &= \det(I  R) = \left(1\right)^n \det\left(R  I\right) = \det\left(R  I\right). \end{align} }[/math]
Here I is the identity matrix, and we use det(R^{T}) = det(R) = 1, as well as (−1)^{n} = −1 since n is odd. Therefore, det(R – I) = 0, meaning there is a null vector v with (R – I)v = 0, that is Rv = v, a fixed eigenvector. There may also be pairs of fixed eigenvectors in the evendimensional subspace orthogonal to v, so the total dimension of fixed eigenvectors is odd.
For example, in 2space n = 2, a rotation by angle θ has eigenvalues λ = e^{iθ} and λ = e^{−iθ}, so there is no axis of rotation except when θ = 0, the case of the null rotation. In 3space n = 3, the axis of a nonnull proper rotation is always a unique line, and a rotation around this axis by angle θ has eigenvalues λ = 1, e^{iθ}, e^{−iθ}. In 4space n = 4, the four eigenvalues are of the form e^{±iθ}, e^{±iφ}. The null rotation has θ = φ = 0. The case of θ = 0, φ ≠ 0 is called a simple rotation, with two unit eigenvalues forming an axis plane, and a twodimensional rotation orthogonal to the axis plane. Otherwise, there is no axis plane. The case of θ = φ is called an isoclinic rotation, having eigenvalues e^{±iθ} repeated twice, so every vector is rotated through an angle θ.
The trace of a rotation matrix is equal to the sum of its eigenvalues. For n = 2, a rotation by angle θ has trace 2 cos θ. For n = 3, a rotation around any axis by angle θ has trace 1 + 2 cos θ. For n = 4, and the trace is 2(cos θ + cos φ), which becomes 4 cos θ for an isoclinic rotation.
Examples


Geometry
In Euclidean geometry, a rotation is an example of an isometry, a transformation that moves points without changing the distances between them. Rotations are distinguished from other isometries by two additional properties: they leave (at least) one point fixed, and they leave "handedness" unchanged. In contrast, a translation moves every point, a reflection exchanges left and righthanded ordering, a glide reflection does both, and an improper rotation combines a change in handedness with a normal rotation.
If a fixed point is taken as the origin of a Cartesian coordinate system, then every point can be given coordinates as a displacement from the origin. Thus one may work with the vector space of displacements instead of the points themselves. Now suppose (p_{1}, ..., p_{n}) are the coordinates of the vector p from the origin O to point P. Choose an orthonormal basis for our coordinates; then the squared distance to P, by Pythagoras, is
 [math]\displaystyle{ d^2(O,P) = \ \mathbf{p} \^2 = \sum_{r=1}^n p_r^2 }[/math]
which can be computed using the matrix multiplication
 [math]\displaystyle{ \ \mathbf{p} \^2 = \begin{bmatrix}p_1 \cdots p_n\end{bmatrix} \begin{bmatrix}p_1 \\ \vdots \\ p_n \end{bmatrix} = \mathbf{p}^\mathsf{T} \mathbf{p} . }[/math]
A geometric rotation transforms lines to lines, and preserves ratios of distances between points. From these properties it can be shown that a rotation is a linear transformation of the vectors, and thus can be written in matrix form, Qp. The fact that a rotation preserves, not just ratios, but distances themselves, is stated as
 [math]\displaystyle{ \mathbf{p}^\mathsf{T} \mathbf{p} = (Q \mathbf{p})^\mathsf{T} (Q \mathbf{p}) , }[/math]
or
 [math]\displaystyle{ \begin{align} \mathbf{p}^\mathsf{T} I \mathbf{p}&{}= \left(\mathbf{p}^\mathsf{T} Q^\mathsf{T}\right) (Q \mathbf{p}) \\ &{}= \mathbf{p}^\mathsf{T} \left(Q^\mathsf{T} Q\right) \mathbf{p} . \end{align} }[/math]
Because this equation holds for all vectors, p, one concludes that every rotation matrix, Q, satisfies the orthogonality condition,
 [math]\displaystyle{ Q^\mathsf{T} Q = I . }[/math]
Rotations preserve handedness because they cannot change the ordering of the axes, which implies the special matrix condition,
 [math]\displaystyle{ \det Q = +1 . }[/math]
Equally important, it can be shown that any matrix satisfying these two conditions acts as a rotation.
Multiplication
The inverse of a rotation matrix is its transpose, which is also a rotation matrix:
 [math]\displaystyle{ \begin{align} \left(Q^\mathsf{T}\right)^\mathsf{T} \left(Q^\mathsf{T}\right) &= Q Q^\mathsf{T} = I\\ \det Q^\mathsf{T} &= \det Q = +1. \end{align} }[/math]
The product of two rotation matrices is a rotation matrix:
 [math]\displaystyle{ \begin{align} \left(Q_1 Q_2\right)^\mathsf{T} \left(Q_1 Q_2\right) &= Q_2^\mathsf{T} \left(Q_1^\mathsf{T} Q_1\right) Q_2 = I \\ \det \left(Q_1 Q_2\right) &= \left(\det Q_1\right) \left(\det Q_2\right) = +1. \end{align} }[/math]
For n > 2, multiplication of n × n rotation matrices is generally not commutative.
 [math]\displaystyle{ \begin{align} Q_1 &= \begin{bmatrix}0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1\end{bmatrix} & Q_2 &= \begin{bmatrix}0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0\end{bmatrix} \\ Q_1 Q_2 &= \begin{bmatrix}0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0\end{bmatrix} & Q_2 Q_1 &= \begin{bmatrix}0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0\end{bmatrix}. \end{align} }[/math]
Noting that any identity matrix is a rotation matrix, and that matrix multiplication is associative, we may summarize all these properties by saying that the n × n rotation matrices form a group, which for n > 2 is nonabelian, called a special orthogonal group, and denoted by SO(n), SO(n,R), SO_{n}, or SO_{n}(R), the group of n × n rotation matrices is isomorphic to the group of rotations in an ndimensional space. This means that multiplication of rotation matrices corresponds to composition of rotations, applied in lefttoright order of their corresponding matrices.
Ambiguities
The interpretation of a rotation matrix can be subject to many ambiguities.
In most cases the effect of the ambiguity is equivalent to the effect of a rotation matrix inversion (for these orthogonal matrices equivalently matrix transpose).
 Alias or alibi (passive or active) transformation
 The coordinates of a point P may change due to either a rotation of the coordinate system CS (alias), or a rotation of the point P (alibi). In the latter case, the rotation of P also produces a rotation of the vector v representing P. In other words, either P and v are fixed while CS rotates (alias), or CS is fixed while P and v rotate (alibi). Any given rotation can be legitimately described both ways, as vectors and coordinate systems actually rotate with respect to each other, about the same axis but in opposite directions. Throughout this article, we chose the alibi approach to describe rotations. For instance,
 [math]\displaystyle{ R(\theta) = \begin{bmatrix} \cos \theta & \sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix} }[/math]
 represents a counterclockwise rotation of a vector v by an angle θ, or a rotation of CS by the same angle but in the opposite direction (i.e. clockwise). Alibi and alias transformations are also known as active and passive transformations, respectively.
 Premultiplication or postmultiplication
 The same point P can be represented either by a column vector v or a row vector w. Rotation matrices can either premultiply column vectors (Rv), or postmultiply row vectors (wR). However, Rv produces a rotation in the opposite direction with respect to wR. Throughout this article, rotations produced on column vectors are described by means of a premultiplication. To obtain exactly the same rotation (i.e. the same final coordinates of point P), the equivalent row vector must be postmultiplied by the transpose of R (i.e. wR^{T}).
 Right or lefthanded coordinates
 The matrix and the vector can be represented with respect to a righthanded or lefthanded coordinate system. Throughout the article, we assumed a righthanded orientation, unless otherwise specified.
 Vectors or forms
 The vector space has a dual space of linear forms, and the matrix can act on either vectors or forms.
Decompositions
Independent planes
Consider the 3 × 3 rotation matrix
 [math]\displaystyle{ Q = \begin{bmatrix} 0.36 & 0.48 & 0.80 \\ 0.80 & 0.60 & 0.00 \\ 0.48 & 0.64 & 0.60 \end{bmatrix} . }[/math]
If Q acts in a certain direction, v, purely as a scaling by a factor λ, then we have
 [math]\displaystyle{ Q \mathbf{v} = \lambda \mathbf{v}, }[/math]
so that
 [math]\displaystyle{ \mathbf{0} = (\lambda I  Q) \mathbf{v} . }[/math]
Thus λ is a root of the characteristic polynomial for Q,
 [math]\displaystyle{ \begin{align} 0 &{}= \det (\lambda I  Q) \\ &{}= \lambda^3  \tfrac{39}{25} \lambda^2 + \tfrac{39}{25} \lambda  1 \\ &{}= (\lambda1) \left(\lambda^2  \tfrac{14}{25} \lambda + 1\right). \end{align} }[/math]
Two features are noteworthy. First, one of the roots (or eigenvalues) is 1, which tells us that some direction is unaffected by the matrix. For rotations in three dimensions, this is the axis of the rotation (a concept that has no meaning in any other dimension). Second, the other two roots are a pair of complex conjugates, whose product is 1 (the constant term of the quadratic), and whose sum is 2 cos θ (the negated linear term). This factorization is of interest for 3 × 3 rotation matrices because the same thing occurs for all of them. (As special cases, for a null rotation the "complex conjugates" are both 1, and for a 180° rotation they are both −1.) Furthermore, a similar factorization holds for any n × n rotation matrix. If the dimension, n, is odd, there will be a "dangling" eigenvalue of 1; and for any dimension the rest of the polynomial factors into quadratic terms like the one here (with the two special cases noted). We are guaranteed that the characteristic polynomial will have degree n and thus n eigenvalues. And since a rotation matrix commutes with its transpose, it is a normal matrix, so can be diagonalized. We conclude that every rotation matrix, when expressed in a suitable coordinate system, partitions into independent rotations of twodimensional subspaces, at most n/2 of them.
The sum of the entries on the main diagonal of a matrix is called the trace; it does not change if we reorient the coordinate system, and always equals the sum of the eigenvalues. This has the convenient implication for 2 × 2 and 3 × 3 rotation matrices that the trace reveals the angle of rotation, θ, in the twodimensional space (or subspace). For a 2 × 2 matrix the trace is 2 cos θ, and for a 3 × 3 matrix it is 1 + 2 cos θ. In the threedimensional case, the subspace consists of all vectors perpendicular to the rotation axis (the invariant direction, with eigenvalue 1). Thus we can extract from any 3 × 3 rotation matrix a rotation axis and an angle, and these completely determine the rotation.
Sequential angles
The constraints on a 2 × 2 rotation matrix imply that it must have the form
 [math]\displaystyle{ Q = \begin{bmatrix} a & b \\ b & a \end{bmatrix} }[/math]
with a^{2} + b^{2} = 1. Therefore, we may set a = cos θ and b = sin θ, for some angle θ. To solve for θ it is not enough to look at a alone or b alone; we must consider both together to place the angle in the correct quadrant, using a twoargument arctangent function.
Now consider the first column of a 3 × 3 rotation matrix,
 [math]\displaystyle{ \begin{bmatrix}a\\b\\c\end{bmatrix} . }[/math]
Although a^{2} + b^{2} will probably not equal 1, but some value r^{2} < 1, we can use a slight variation of the previous computation to find a socalled Givens rotation that transforms the column to
 [math]\displaystyle{ \begin{bmatrix}r\\0\\c\end{bmatrix} , }[/math]
zeroing b. This acts on the subspace spanned by the x and yaxes. We can then repeat the process for the xzsubspace to zero c. Acting on the full matrix, these two rotations produce the schematic form
 [math]\displaystyle{ Q_{xz}Q_{xy}Q = \begin{bmatrix}1&0&0\\0&\ast&\ast\\0&\ast&\ast\end{bmatrix} . }[/math]
Shifting attention to the second column, a Givens rotation of the yzsubspace can now zero the z value. This brings the full matrix to the form
 [math]\displaystyle{ Q_{yz}Q_{xz}Q_{xy}Q = \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} , }[/math]
which is an identity matrix. Thus we have decomposed Q as
 [math]\displaystyle{ Q = Q_{xy}^{1}Q_{xz}^{1}Q_{yz}^{1} . }[/math]
An n × n rotation matrix will have (n − 1) + (n − 2) + ⋯ + 2 + 1, or
 [math]\displaystyle{ \sum_{k=1}^{n1} k = \frac{1}{2}n(n  1) }[/math]
entries below the diagonal to zero. We can zero them by extending the same idea of stepping through the columns with a series of rotations in a fixed sequence of planes. We conclude that the set of n × n rotation matrices, each of which has n^{2} entries, can be parameterized by 1/2n(n − 1) angles.
xzx_{w}  xzy_{w}  xyx_{w}  xyz_{w} 
yxy_{w}  yxz_{w}  yzy_{w}  yzx_{w} 
zyz_{w}  zyx_{w}  zxz_{w}  zxy_{w} 
xzx_{b}  yzx_{b}  xyx_{b}  zyx_{b} 
yxy_{b}  zxy_{b}  yzy_{b}  xzy_{b} 
zyz_{b}  xyz_{b}  zxz_{b}  yxz_{b} 
In three dimensions this restates in matrix form an observation made by Euler, so mathematicians call the ordered sequence of three angles Euler angles. However, the situation is somewhat more complicated than we have so far indicated. Despite the small dimension, we actually have considerable freedom in the sequence of axis pairs we use; and we also have some freedom in the choice of angles. Thus we find many different conventions employed when threedimensional rotations are parameterized for physics, or medicine, or chemistry, or other disciplines. When we include the option of world axes or body axes, 24 different sequences are possible. And while some disciplines call any sequence Euler angles, others give different names (Cardano, Tait–Bryan, rollpitchyaw) to different sequences.
One reason for the large number of options is that, as noted previously, rotations in three dimensions (and higher) do not commute. If we reverse a given sequence of rotations, we get a different outcome. This also implies that we cannot compose two rotations by adding their corresponding angles. Thus Euler angles are not vectors, despite a similarity in appearance as a triplet of numbers.
Nested dimensions
A 3 × 3 rotation matrix such as
 [math]\displaystyle{ Q_{3 \times 3} = \begin{bmatrix} \cos \theta & \sin \theta & {\color{CadetBlue}0} \\ \sin \theta & \cos \theta & {\color{CadetBlue}0} \\ {\color{CadetBlue}0} & {\color{CadetBlue}0} & {\color{CadetBlue}1} \end{bmatrix} }[/math]
suggests a 2 × 2 rotation matrix,
 [math]\displaystyle{ Q_{2 \times 2} = \begin{bmatrix} \cos \theta & \sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}, }[/math]
is embedded in the upper left corner:
 [math]\displaystyle{ Q_{3 \times 3} = \left[ \begin{matrix} Q_{2 \times 2} & \mathbf{0} \\ \mathbf{0}^\mathsf{T} & 1 \end{matrix} \right]. }[/math]
This is no illusion; not just one, but many, copies of ndimensional rotations are found within (n + 1)dimensional rotations, as subgroups. Each embedding leaves one direction fixed, which in the case of 3 × 3 matrices is the rotation axis. For example, we have
 [math]\displaystyle{ \begin{align} Q_{\mathbf{x}}(\theta) &= \begin{bmatrix} {\color{CadetBlue}1} & {\color{CadetBlue}0} & {\color{CadetBlue}0} \\ {\color{CadetBlue}0} & \cos \theta & \sin \theta \\ {\color{CadetBlue}0} & \sin \theta & \cos \theta \end{bmatrix}, \\[8px] Q_{\mathbf{y}}(\theta) &= \begin{bmatrix} \cos \theta & {\color{CadetBlue}0} & \sin \theta \\ {\color{CadetBlue}0} & {\color{CadetBlue}1} & {\color{CadetBlue}0} \\ \sin \theta & {\color{CadetBlue}0} & \cos \theta \end{bmatrix}, \\[8px] Q_{\mathbf{z}}(\theta) &= \begin{bmatrix} \cos \theta & \sin \theta & {\color{CadetBlue}0} \\ \sin \theta & \cos \theta & {\color{CadetBlue}0} \\ {\color{CadetBlue}0} & {\color{CadetBlue}0} & {\color{CadetBlue}1} \end{bmatrix}, \end{align} }[/math]
fixing the xaxis, the yaxis, and the zaxis, respectively. The rotation axis need not be a coordinate axis; if u = (x,y,z) is a unit vector in the desired direction, then
 [math]\displaystyle{ \begin{align} Q_\mathbf{u}(\theta) &= \begin{bmatrix} 0 & z & y \\ z & 0 & x \\ y & x & 0 \end{bmatrix} \sin\theta + \left(I  \mathbf{u}\mathbf{u}^\mathsf{T}\right) \cos\theta + \mathbf{u}\mathbf{u}^\mathsf{T} \\[8px] &= \begin{bmatrix} \left(1  x^2\right) c_\theta + x^2 & z s_\theta  x y c_\theta + x y & y s_\theta  x z c_\theta + x z \\ z s_\theta  x y c_\theta + x y & \left(1  y^2\right) c_\theta + y^2 & x s_\theta  y z c_\theta + y z \\ y s_\theta  x z c_\theta + x z & x s_\theta  y z c_\theta + y z & \left(1  z^2\right) c_\theta + z^2 \end{bmatrix} \\[8px] &= \begin{bmatrix} x^2 (1  c_\theta) + c_\theta & x y (1  c_\theta)  z s_\theta & x z (1  c_\theta) + y s_\theta \\ x y (1  c_\theta) + z s_\theta & y^2 (1  c_\theta) + c_\theta & y z (1  c_\theta)  x s_\theta \\ x z (1  c_\theta)  y s_\theta & y z (1  c_\theta) + x s_\theta & z^2 (1  c_\theta) + c_\theta \end{bmatrix}, \end{align} }[/math]
where c_{θ} = cos θ, s_{θ} = sin θ, is a rotation by angle θ leaving axis u fixed.
A direction in (n + 1)dimensional space will be a unit magnitude vector, which we may consider a point on a generalized sphere, S^{n}. Thus it is natural to describe the rotation group SO(n + 1) as combining SO(n) and S^{n}. A suitable formalism is the fiber bundle,
 [math]\displaystyle{ SO(n) \hookrightarrow SO(n + 1) \to S^n , }[/math]
where for every direction in the base space, S^{n}, the fiber over it in the total space, SO(n + 1), is a copy of the fiber space, SO(n), namely the rotations that keep that direction fixed.
Thus we can build an n × n rotation matrix by starting with a 2 × 2 matrix, aiming its fixed axis on S^{2} (the ordinary sphere in threedimensional space), aiming the resulting rotation on S^{3}, and so on up through S^{n−1}. A point on S^{n} can be selected using n numbers, so we again have 1/2n(n − 1) numbers to describe any n × n rotation matrix.
In fact, we can view the sequential angle decomposition, discussed previously, as reversing this process. The composition of n − 1 Givens rotations brings the first column (and row) to (1, 0, ..., 0), so that the remainder of the matrix is a rotation matrix of dimension one less, embedded so as to leave (1, 0, ..., 0) fixed.
Skew parameters via Cayley's formula
When an n × n rotation matrix Q, does not include a −1 eigenvalue, thus none of the planar rotations which it comprises are 180° rotations, then Q + I is an invertible matrix. Most rotation matrices fit this description, and for them it can be shown that (Q − I)(Q + I)^{−1} is a skewsymmetric matrix, A. Thus A^{T} = −A; and since the diagonal is necessarily zero, and since the upper triangle determines the lower one, A contains 1/2n(n − 1) independent numbers.
Conveniently, I − A is invertible whenever A is skewsymmetric; thus we can recover the original matrix using the Cayley transform,
 [math]\displaystyle{ A \mapsto (I+A)(IA)^{1} , }[/math]
which maps any skewsymmetric matrix A to a rotation matrix. In fact, aside from the noted exceptions, we can produce any rotation matrix in this way. Although in practical applications we can hardly afford to ignore 180° rotations, the Cayley transform is still a potentially useful tool, giving a parameterization of most rotation matrices without trigonometric functions.
In three dimensions, for example, we have (Cayley 1846)
 [math]\displaystyle{ \begin{align} &\begin{bmatrix} 0 & z & y \\ z & 0 & x \\ y & x & 0 \end{bmatrix} \mapsto \\[3pt] \quad \frac{1}{1 + x^2 + y^2 + z^2} &\begin{bmatrix} 1 + x^2  y^2  z^2 & 2xy  2z & 2y + 2xz \\ 2xy + 2z & 1  x^2 + y^2  z^2 & 2yz  2x \\ 2xz  2y & 2x + 2yz & 1  x^2  y^2 + z^2 \end{bmatrix} . \end{align} }[/math]
If we condense the skew entries into a vector, (x,y,z), then we produce a 90° rotation around the xaxis for (1, 0, 0), around the yaxis for (0, 1, 0), and around the zaxis for (0, 0, 1). The 180° rotations are just out of reach; for, in the limit as x → ∞, (x, 0, 0) does approach a 180° rotation around the x axis, and similarly for other directions.
Decomposition into shears
For the 2D case, a rotation matrix can be decomposed into three shear matrices (Paeth 1986):
 [math]\displaystyle{ \begin{align} R(\theta) &{}= \begin{bmatrix} 1 & \tan \frac{\theta}{2}\\ 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0\\ \sin \theta & 1 \end{bmatrix} \begin{bmatrix} 1 & \tan \frac{\theta}{2}\\ 0 & 1 \end{bmatrix} \end{align} }[/math]
This is useful, for instance, in computer graphics, since shears can be implemented with fewer multiplication instructions than rotating a bitmap directly. On modern computers, this may not matter, but it can be relevant for very old or lowend microprocessors.
A rotation can also be written as two shears and scaling (Daubechies & Sweldens 1998):
 [math]\displaystyle{ \begin{align} R(\theta) &{}= \begin{bmatrix} 1 & 0\\ \tan\theta & 1 \end{bmatrix} \begin{bmatrix} 1 & \sin\theta\cos\theta\\ 0 & 1 \end{bmatrix} \begin{bmatrix} \cos\theta & 0\\ 0 & \frac{1}{\cos\theta} \end{bmatrix} \end{align} }[/math]
Group theory
Below follow some basic facts about the role of the collection of all rotation matrices of a fixed dimension (here mostly 3) in mathematics and particularly in physics where rotational symmetry is a requirement of every truly fundamental law (due to the assumption of isotropy of space), and where the same symmetry, when present, is a simplifying property of many problems of less fundamental nature. Examples abound in classical mechanics and quantum mechanics. Knowledge of the part of the solutions pertaining to this symmetry applies (with qualifications) to all such problems and it can be factored out of a specific problem at hand, thus reducing its complexity. A prime example – in mathematics and physics – would be the theory of spherical harmonics. Their role in the group theory of the rotation groups is that of being a representation space for the entire set of finitedimensional irreducible representations of the rotation group SO(3). For this topic, see Rotation group SO(3) § Spherical harmonics.
The main articles listed in each subsection are referred to for more detail.
Lie group
The n × n rotation matrices for each n form a group, the special orthogonal group, SO(n). This algebraic structure is coupled with a topological structure inherited from [math]\displaystyle{ \operatorname{GL}_n(\R) }[/math] in such a way that the operations of multiplication and taking the inverse are analytic functions of the matrix entries. Thus SO(n) is for each n a Lie group. It is compact and connected, but not simply connected. It is also a semisimple group, in fact a simple group with the exception SO(4).^{[7]} The relevance of this is that all theorems and all machinery from the theory of analytic manifolds (analytic manifolds are in particular smooth manifolds) apply and the welldeveloped representation theory of compact semisimple groups is ready for use.
Lie algebra
The Lie algebra so(n) of SO(n) is given by
 [math]\displaystyle{ \mathfrak{so}(n) = \mathfrak{o}(n) = \left\{X \in M_n(\mathbb{R}) \mid X = X^\mathsf{T} \right\}, }[/math]
and is the space of skewsymmetric matrices of dimension n, see classical group, where o(n) is the Lie algebra of O(n), the orthogonal group. For reference, the most common basis for so(3) is
 [math]\displaystyle{ L_{\mathbf{x}} = \begin{bmatrix}0&0&0\\0&0&1\\0&1&0\end{bmatrix} , \quad L_{\mathbf{y}} = \begin{bmatrix}0&0&1\\0&0&0\\1&0&0\end{bmatrix} , \quad L_{\mathbf{z}} = \begin{bmatrix}0&1&0\\1&0&0\\0&0&0\end{bmatrix}. }[/math]
Exponential map
Connecting the Lie algebra to the Lie group is the exponential map, which is defined using the standard matrix exponential series for e^{A}^{[8]} For any skewsymmetric matrix A, exp(A) is always a rotation matrix.^{[nb 3]}
An important practical example is the 3 × 3 case. In rotation group SO(3), it is shown that one can identify every A ∈ so(3) with an Euler vector ω = θu, where u = (x, y, z) is a unit magnitude vector.
By the properties of the identification [math]\displaystyle{ \mathbf{su}(2) \cong \mathbb{R}^3 }[/math], u is in the null space of A. Thus, u is left invariant by exp(A) and is hence a rotation axis.
According to Rodrigues' rotation formula on matrix form, one obtains,
 [math]\displaystyle{ \begin{align} \exp( A ) &= \exp\bigl(\theta(\mathbf{u}\cdot\mathbf{L})\bigr) \\ &= \exp \left( \begin{bmatrix} 0 & z \theta & y \theta \\ z \theta & 0&x \theta \\ y \theta & x \theta & 0 \end{bmatrix} \right) \\ &= I + \sin \theta \ \mathbf{u}\cdot\mathbf{L} + (1\cos \theta)(\mathbf{u}\cdot\mathbf{L} )^2 , \end{align} }[/math]
where
 [math]\displaystyle{ \mathbf{u}\cdot\mathbf{L} = \begin{bmatrix} 0 & z & y \\ z & 0&x \\ y & x & 0 \end{bmatrix} . }[/math]
This is the matrix for a rotation around axis u by the angle θ. For full detail, see exponential map SO(3).
Baker–Campbell–Hausdorff formula
The BCH formula provides an explicit expression for Z = log(e^{X}e^{Y}) in terms of a series expansion of nested commutators of X and Y.^{[9]} This general expansion unfolds as^{[nb 4]}
 [math]\displaystyle{ Z = C(X, Y) = X + Y + \tfrac{1}{2} [X, Y] + \tfrac{1}{12} \bigl[X,[X,Y]\bigr]  \tfrac{1}{12} \bigl[Y,[X,Y]\bigr] + \cdots . }[/math]
In the 3 × 3 case, the general infinite expansion has a compact form,^{[10]}
 [math]\displaystyle{ Z = \alpha X + \beta Y + \gamma[X, Y], }[/math]
for suitable trigonometric function coefficients, detailed in the Baker–Campbell–Hausdorff formula for SO(3).
As a group identity, the above holds for all faithful representations, including the doublet (spinor representation), which is simpler. The same explicit formula thus follows straightforwardly through Pauli matrices; see the 2 × 2 derivation for SU(2). For the general n × n case, one might use Ref.^{[11]}
Spin group
The Lie group of n × n rotation matrices, SO(n), is not simply connected, so Lie theory tells us it is a homomorphic image of a universal covering group. Often the covering group, which in this case is called the spin group denoted by Spin(n), is simpler and more natural to work with.^{[12]}
In the case of planar rotations, SO(2) is topologically a circle, S^{1}. Its universal covering group, Spin(2), is isomorphic to the real line, R, under addition. Whenever angles of arbitrary magnitude are used one is taking advantage of the convenience of the universal cover. Every 2 × 2 rotation matrix is produced by a countable infinity of angles, separated by integer multiples of 2π. Correspondingly, the fundamental group of SO(2) is isomorphic to the integers, Z.
In the case of spatial rotations, SO(3) is topologically equivalent to threedimensional real projective space, RP^{3}. Its universal covering group, Spin(3), is isomorphic to the 3sphere, S^{3}. Every 3 × 3 rotation matrix is produced by two opposite points on the sphere. Correspondingly, the fundamental group of SO(3) is isomorphic to the twoelement group, Z_{2}.
We can also describe Spin(3) as isomorphic to quaternions of unit norm under multiplication, or to certain 4 × 4 real matrices, or to 2 × 2 complex special unitary matrices, namely SU(2). The covering maps for the first and the last case are given by
 [math]\displaystyle{ \mathbb{H} \supset \{q \in \mathbb{H}: \q\ = 1\} \ni w + \mathbf{i}x + \mathbf{j}y + \mathbf{k}z \mapsto \begin{bmatrix} 1  2 y^2  2 z^2 & 2 x y  2 z w & 2 x z + 2 y w \\ 2 x y + 2 z w & 1  2 x^2  2 z^2 & 2 y z  2 x w \\ 2 x z  2 y w & 2 y z + 2 x w & 1  2 x^2  2 y^2 \end{bmatrix} \in \mathrm{SO}(3), }[/math]
and
 [math]\displaystyle{ \mathrm{SU}(2) \ni \begin{bmatrix} \alpha & \beta \\ \overline{\beta} & \overline{\alpha} \end{bmatrix} \mapsto \begin{bmatrix} \frac{1}{2}\left(\alpha^2  \beta^2 + \overline{\alpha^2}  \overline{\beta^2}\right) & \frac{i}{2}\left(\alpha^2  \beta^2 + \overline{\alpha^2} + \overline{\beta^2}\right) & \alpha\beta  \overline{\alpha}\overline{\beta} \\ \frac{i}{2}\left(\alpha^2  \beta^2  \overline{\alpha^2} + \overline{\beta^2}\right) & \frac{i}{2}\left(\alpha^2 + \beta^2 + \overline{\alpha^2} + \overline{\beta^2}\right) & i\left(+\alpha\beta  \overline{\alpha}\overline{\beta}\right) \\ \alpha\overline{\beta} + \overline{\alpha}\beta & i\left(\alpha\overline{\beta} + \overline{\alpha}\beta\right) & \alpha\overline{\alpha}  \beta\overline{\beta} \end{bmatrix} \in \mathrm{SO}(3). }[/math]
For a detailed account of the SU(2)covering and the quaternionic covering, see spin group SO(3).
Many features of these cases are the same for higher dimensions. The coverings are all twotoone, with SO(n), n > 2, having fundamental group Z_{2}. The natural setting for these groups is within a Clifford algebra. One type of action of the rotations is produced by a kind of "sandwich", denoted by qvq^{∗}. More importantly in applications to physics, the corresponding spin representation of the Lie algebra sits inside the Clifford algebra. It can be exponentiated in the usual way to give rise to a 2valued representation, also known as projective representation of the rotation group. This is the case with SO(3) and SU(2), where the 2valued representation can be viewed as an "inverse" of the covering map. By properties of covering maps, the inverse can be chosen onotoone as a local section, but not globally.
Infinitesimal rotations
The matrices in the Lie algebra are not themselves rotations; the skewsymmetric matrices are derivatives, proportional differences of rotations. An actual "differential rotation", or infinitesimal rotation matrix has the form
 [math]\displaystyle{ I + A \, d\theta , }[/math]
where dθ is vanishingly small and A ∈ so(n), for instance with A = L_{x},
 [math]\displaystyle{ dL_{x} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & d\theta \\ 0 & d\theta & 1 \end{bmatrix}. }[/math]
The computation rules are as usual except that infinitesimals of second order are routinely dropped. With these rules, these matrices do not satisfy all the same properties as ordinary finite rotation matrices under the usual treatment of infinitesimals.^{[13]} It turns out that the order in which infinitesimal rotations are applied is irrelevant. To see this exemplified, consult infinitesimal rotations SO(3).
Conversions
We have seen the existence of several decompositions that apply in any dimension, namely independent planes, sequential angles, and nested dimensions. In all these cases we can either decompose a matrix or construct one. We have also given special attention to 3 × 3 rotation matrices, and these warrant further attention, in both directions (Stuelpnagel 1964).
Quaternion
Given the unit quaternion q = w + xi + yj + zk, the equivalent premultiplied (to be used with column vectors) 3 × 3 rotation matrix is ^{[14]}
 [math]\displaystyle{ Q = \begin{bmatrix} 1  2 y^2  2 z^2 & 2 x y  2 z w & 2 x z + 2 y w \\ 2 x y + 2 z w & 1  2 x^2  2 z^2 & 2 y z  2 x w \\ 2 x z  2 y w & 2 y z + 2 x w & 1  2 x^2  2 y^2 \end{bmatrix} . }[/math]
Now every quaternion component appears multiplied by two in a term of degree two, and if all such terms are zero what is left is an identity matrix. This leads to an efficient, robust conversion from any quaternion – whether unit or nonunit – to a 3 × 3 rotation matrix. Given:
 [math]\displaystyle{ \begin{align} n &= w \times w + x \times x + y \times y + z \times z \\ s &= \begin{cases} 0 &\text{if } n = 0 \\ \frac{2}{n} &\text{otherwise} \end{cases} \\ \end{align} }[/math]
we can calculate
 [math]\displaystyle{ Q = \begin{bmatrix} 1  s(yy + zz) & s(xy  wz) & s(xz + wy) \\ s(xy + wz) & 1  s(xx + zz) & s(yz  wx) \\ s(xz  wy) & s(yz + wx) & 1  s(xx + yy) \end{bmatrix} }[/math]
Freed from the demand for a unit quaternion, we find that nonzero quaternions act as homogeneous coordinates for 3 × 3 rotation matrices. The Cayley transform, discussed earlier, is obtained by scaling the quaternion so that its w component is 1. For a 180° rotation around any axis, w will be zero, which explains the Cayley limitation.
The sum of the entries along the main diagonal (the trace), plus one, equals 4 − 4(x^{2} + y^{2} + z^{2}), which is 4w^{2}. Thus we can write the trace itself as 2w^{2} + 2w^{2} − 1; and from the previous version of the matrix we see that the diagonal entries themselves have the same form: 2x^{2} + 2w^{2} − 1, 2y^{2} + 2w^{2} − 1, and 2z^{2} + 2w^{2} − 1. So we can easily compare the magnitudes of all four quaternion components using the matrix diagonal. We can, in fact, obtain all four magnitudes using sums and square roots, and choose consistent signs using the skewsymmetric part of the offdiagonal entries:
 [math]\displaystyle{ \begin{align} t &= \operatorname{tr} Q = Q_{xx} + Q_{yy} + Q_{zz} \quad (\text{the trace of }Q) \\ r &= \sqrt{1 + t} \\ w &= \tfrac{1}{2} r \\ x &= \operatorname{sgn}\left(Q_{zy}  Q_{yz}\right)\left\tfrac12 \sqrt{1 + Q_{xx}  Q_{yy}  Q_{zz}}\right \\ y &= \operatorname{sgn}\left(Q_{xz}  Q_{zx}\right)\left\tfrac12 \sqrt{1  Q_{xx} + Q_{yy}  Q_{zz}}\right \\ z &= \operatorname{sgn}\left(Q_{yx}  Q_{xy}\right)\left\tfrac12 \sqrt{1  Q_{xx}  Q_{yy} + Q_{zz}}\right \end{align} }[/math]
Alternatively, use a single square root and division
 [math]\displaystyle{ \begin{align} t &= \operatorname{tr} Q = Q_{xx} + Q_{yy} + Q_{zz} \\ r &= \sqrt{1 + t} \\ s &= \tfrac{1}{2r} \\ w &= \tfrac{1}{2} r \\ x &= \left(Q_{zy}  Q_{yz}\right)s \\ y &= \left(Q_{xz}  Q_{zx}\right)s \\ z &= \left(Q_{yx}  Q_{xy}\right)s \end{align} }[/math]
This is numerically stable so long as the trace, t, is not negative; otherwise, we risk dividing by (nearly) zero. In that case, suppose Q_{xx} is the largest diagonal entry, so x will have the largest magnitude (the other cases are derived by cyclic permutation); then the following is safe.
 [math]\displaystyle{ \begin{align} r &= \sqrt{1 + Q_{xx}  Q_{yy}  Q_{zz}} \\ s &= \tfrac{1}{2r} \\ w &= \left(Q_{zy}  Q_{yz}\right)s \\ x &= \tfrac12 r \\ y &= \left(Q_{xy} + Q_{yx}\right)s \\ z &= \left(Q_{zx} + Q_{xz}\right)s \end{align} }[/math]
If the matrix contains significant error, such as accumulated numerical error, we may construct a symmetric 4 × 4 matrix,
 [math]\displaystyle{ K = \frac13 \begin{bmatrix} Q_{xx}Q_{yy}Q_{zz} & Q_{yx}+Q_{xy} & Q_{zx}+Q_{xz} & Q_{zy}Q_{yz} \\ Q_{yx}+Q_{xy} & Q_{yy}Q_{xx}Q_{zz} & Q_{zy}+Q_{yz} & Q_{xz}Q_{zx} \\ Q_{zx}+Q_{xz} & Q_{zy}+Q_{yz} & Q_{zz}Q_{xx}Q_{yy} & Q_{yx}Q_{xy} \\ Q_{zy}Q_{yz} & Q_{xz}Q_{zx} & Q_{yx}Q_{xy} & Q_{xx}+Q_{yy}+Q_{zz} \end{bmatrix} , }[/math]
and find the eigenvector, (x, y, z, w), of its largest magnitude eigenvalue. (If Q is truly a rotation matrix, that value will be 1.) The quaternion so obtained will correspond to the rotation matrix closest to the given matrix (BarItzhack 2000) (Note: formulation of the cited article is postmultiplied, works with row vectors).
Polar decomposition
If the n × n matrix M is nonsingular, its columns are linearly independent vectors; thus the Gram–Schmidt process can adjust them to be an orthonormal basis. Stated in terms of numerical linear algebra, we convert M to an orthogonal matrix, Q, using QR decomposition. However, we often prefer a Q closest to M, which this method does not accomplish. For that, the tool we want is the polar decomposition (Fan & Hoffman 1955; Higham 1989).
To measure closeness, we may use any matrix norm invariant under orthogonal transformations. A convenient choice is the Frobenius norm, Q − M_{F}, squared, which is the sum of the squares of the element differences. Writing this in terms of the trace, Tr, our goal is,
 Find Q minimizing Tr( (Q − M)^{T}(Q − M) ), subject to Q^{T}Q = I.
Though written in matrix terms, the objective function is just a quadratic polynomial. We can minimize it in the usual way, by finding where its derivative is zero. For a 3 × 3 matrix, the orthogonality constraint implies six scalar equalities that the entries of Q must satisfy. To incorporate the constraint(s), we may employ a standard technique, Lagrange multipliers, assembled as a symmetric matrix, Y. Thus our method is:
 Differentiate Tr( (Q − M)^{T}(Q − M) + (Q^{T}Q − I)Y ) with respect to (the entries of) Q, and equate to zero.
Consider a 2 × 2 example. Including constraints, we seek to minimize
 [math]\displaystyle{ \begin{align} &\left(Q_{xx}  M_{xx}\right)^2 + \left(Q_{xy}  M_{xy}\right)^2 + \left(Q_{yx}  M_{yx}\right)^2 + \left(Q_{yy}  M_{yy}\right)^2 \\ &\quad {}+ \left(Q_{xx}^2 + Q_{yx}^2  1\right)Y_{xx} + \left(Q_{xy}^2 + Q_{yy}^2  1\right)Y_{yy} + 2\left(Q_{xx} Q_{xy} + Q_{yx} Q_{yy}\right)Y_{xy} . \end{align} }[/math]
Taking the derivative with respect to Q_{xx}, Q_{xy}, Q_{yx}, Q_{yy} in turn, we assemble a matrix.
 [math]\displaystyle{ 2\begin{bmatrix} Q_{xx}  M_{xx} + Q_{xx} Y_{xx} + Q_{xy} Y_{xy} & Q_{xy}  M_{xy} + Q_{xx} Y_{xy} + Q_{xy} Y_{yy} \\ Q_{yx}  M_{yx} + Q_{yx} Y_{xx} + Q_{yy} Y_{xy} & Q_{yy}  M_{yy} + Q_{yx} Y_{xy} + Q_{yy} Y_{yy} \end{bmatrix} }[/math]
In general, we obtain the equation
 [math]\displaystyle{ 0 = 2(Q  M) + 2QY , }[/math]
so that
 [math]\displaystyle{ M = Q(I + Y) = QS , }[/math]
where Q is orthogonal and S is symmetric. To ensure a minimum, the Y matrix (and hence S) must be positive definite. Linear algebra calls QS the polar decomposition of M, with S the positive square root of S^{2} = M^{T}M.
 [math]\displaystyle{ S^2 = \left(Q^\mathsf{T} M\right)^\mathsf{T} \left(Q^\mathsf{T} M\right) = M^\mathsf{T} Q Q^\mathsf{T} M = M^\mathsf{T} M }[/math]
When M is nonsingular, the Q and S factors of the polar decomposition are uniquely determined. However, the determinant of S is positive because S is positive definite, so Q inherits the sign of the determinant of M. That is, Q is only guaranteed to be orthogonal, not a rotation matrix. This is unavoidable; an M with negative determinant has no uniquely defined closest rotation matrix.
Axis and angle
To efficiently construct a rotation matrix Q from an angle θ and a unit axis u, we can take advantage of symmetry and skewsymmetry within the entries. If x, y, and z are the components of the unit vector representing the axis, and
 [math]\displaystyle{ \begin{align} c &= \cos \theta\\ s &= \sin \theta\\ C &= 1c \end{align} }[/math]
then
 [math]\displaystyle{ Q(\theta) = \begin{bmatrix} xxC+c & xyCzs & xzC+ys\\ yxC+zs & yyC+c & yzCxs\\ zxCys & zyC+xs & zzC+c \end{bmatrix} }[/math]
Determining an axis and angle, like determining a quaternion, is only possible up to the sign; that is, (u, θ) and (−u, −θ) correspond to the same rotation matrix, just like q and −q. Additionally, axis–angle extraction presents additional difficulties. The angle can be restricted to be from 0° to 180°, but angles are formally ambiguous by multiples of 360°. When the angle is zero, the axis is undefined. When the angle is 180°, the matrix becomes symmetric, which has implications in extracting the axis. Near multiples of 180°, care is needed to avoid numerical problems: in extracting the angle, a twoargument arctangent with atan2(sin θ, cos θ) equal to θ avoids the insensitivity of arccos; and in computing the axis magnitude in order to force unit magnitude, a bruteforce approach can lose accuracy through underflow (Moler Morrison).
A partial approach is as follows:
 [math]\displaystyle{ \begin{align} x &= Q_{zy}  Q_{yz}\\ y &= Q_{xz}  Q_{zx}\\ z &= Q_{yx}  Q_{xy}\\ r &= \sqrt{x^2 + y^2 + z^2}\\ t &= Q_{xx} + Q_{yy} + Q_{zz}\\ \theta &= \operatorname{atan2}(r,t1)\end{align} }[/math]
The x, y, and zcomponents of the axis would then be divided by r. A fully robust approach will use a different algorithm when t, the trace of the matrix Q, is negative, as with quaternion extraction. When r is zero because the angle is zero, an axis must be provided from some source other than the matrix.
Euler angles
Complexity of conversion escalates with Euler angles (used here in the broad sense). The first difficulty is to establish which of the twentyfour variations of Cartesian axis order we will use. Suppose the three angles are θ_{1}, θ_{2}, θ_{3}; physics and chemistry may interpret these as
 [math]\displaystyle{ Q(\theta_1,\theta_2,\theta_3)= Q_{\mathbf{z}}(\theta_1) Q_{\mathbf{y}}(\theta_2) Q_{\mathbf{z}}(\theta_3) , }[/math]
while aircraft dynamics may use
 [math]\displaystyle{ Q(\theta_1,\theta_2,\theta_3)= Q_{\mathbf{z}}(\theta_3) Q_{\mathbf{y}}(\theta_2) Q_{\mathbf{x}}(\theta_1) . }[/math]
One systematic approach begins with choosing the rightmost axis. Among all permutations of (x,y,z), only two place that axis first; one is an even permutation and the other odd. Choosing parity thus establishes the middle axis. That leaves two choices for the leftmost axis, either duplicating the first or not. These three choices gives us 3 × 2 × 2 = 12 variations; we double that to 24 by choosing static or rotating axes.
This is enough to construct a matrix from angles, but triples differing in many ways can give the same rotation matrix. For example, suppose we use the zyz convention above; then we have the following equivalent pairs:
(90°, 45°, −105°) ≡ (−270°, −315°, 255°) multiples of 360° (72°, 0°, 0°) ≡ (40°, 0°, 32°) singular alignment (45°, 60°, −30°) ≡ (−135°, −60°, 150°) bistable flip
Angles for any order can be found using a concise common routine (Herter & Lott 1993; Shoemake 1994).
The problem of singular alignment, the mathematical analog of physical gimbal lock, occurs when the middle rotation aligns the axes of the first and last rotations. It afflicts every axis order at either even or odd multiples of 90°. These singularities are not characteristic of the rotation matrix as such, and only occur with the usage of Euler angles.
The singularities are avoided when considering and manipulating the rotation matrix as orthonormal row vectors (in 3D applications often named the rightvector, upvector and outvector) instead of as angles. The singularities are also avoided when working with quaternions.
Vector to vector formulation
In some instances it is interesting to describe a rotation by specifying how a vector is mapped into another through the shortest path (smallest angle). In [math]\displaystyle{ \mathbb{R}^3 }[/math] this completely describes the associated rotation matrix. In general, given x, y ∈ [math]\displaystyle{ \mathbb{S} }[/math]^{n}, the matrix
 [math]\displaystyle{ R:=I+y x^\mathsf{T}x y^\mathsf{T}+\frac{1}{1+\langle x,y\rangle}\left(yx^\mathsf{T}xy^\mathsf{T}\right)^2 }[/math]
belongs to SO(n + 1) and maps x to y.^{[15]}
Uniform random rotation matrices
We sometimes need to generate a uniformly distributed random rotation matrix. It seems intuitively clear in two dimensions that this means the rotation angle is uniformly distributed between 0 and 2π. That intuition is correct, but does not carry over to higher dimensions. For example, if we decompose 3 × 3 rotation matrices in axis–angle form, the angle should not be uniformly distributed; the probability that (the magnitude of) the angle is at most θ should be 1/π(θ − sin θ), for 0 ≤ θ ≤ π.
Since SO(n) is a connected and locally compact Lie group, we have a simple standard criterion for uniformity, namely that the distribution be unchanged when composed with any arbitrary rotation (a Lie group "translation"). This definition corresponds to what is called Haar measure. (León Massé) show how to use the Cayley transform to generate and test matrices according to this criterion.
We can also generate a uniform distribution in any dimension using the subgroup algorithm of (Diaconis Shahshahani). This recursively exploits the nested dimensions group structure of SO(n), as follows. Generate a uniform angle and construct a 2 × 2 rotation matrix. To step from n to n + 1, generate a vector v uniformly distributed on the nsphere S^{n}, embed the n × n matrix in the next larger size with last column (0, ..., 0, 1), and rotate the larger matrix so the last column becomes v.
As usual, we have special alternatives for the 3 × 3 case. Each of these methods begins with three independent random scalars uniformly distributed on the unit interval. (Arvo 1992) takes advantage of the odd dimension to change a Householder reflection to a rotation by negation, and uses that to aim the axis of a uniform planar rotation.
Another method uses unit quaternions. Multiplication of rotation matrices is homomorphic to multiplication of quaternions, and multiplication by a unit quaternion rotates the unit sphere. Since the homomorphism is a local isometry, we immediately conclude that to produce a uniform distribution on SO(3) we may use a uniform distribution on S^{3}. In practice: create a fourelement vector where each element is a sampling of a normal distribution. Normalize its length and you have a uniformly sampled random unit quaternion which represents a uniformly sampled random rotation. Note that the aforementioned only applies to rotations in dimension 3. For a generalised idea of quaternions, one should look into Rotors.
Euler angles can also be used, though not with each angle uniformly distributed (Murnaghan 1962; Miles 1965).
For the axis–angle form, the axis is uniformly distributed over the unit sphere of directions, S^{2}, while the angle has the nonuniform distribution over [0,π] noted previously (Miles 1965).
See also
 Euler–Rodrigues formula
 Euler's rotation theorem
 Rodrigues' rotation formula
 Plane of rotation
 Axis–angle representation
 Rotation group SO(3)
 Rotation formalisms in three dimensions
 Rotation operator (vector space)
 Transformation matrix
 Yawpitchroll system
 Kabsch algorithm
 Isometry
 Rigid transformation
 Rotations in 4dimensional Euclidean space
 Trigonometric Identities
 Versor
Remarks
 ↑ Note that if instead of rotating vectors, it is the reference frame that is being rotated, the signs on the sin θ terms will be reversed. If reference frame A is rotated anticlockwise about the origin through an angle θ to create reference frame B, then R_{x} (with the signs flipped) will transform a vector described in reference frame A coordinates to reference frame B coordinates. Coordinate frame transformations in aerospace, robotics, and other fields are often performed using this interpretation of the rotation matrix.
 ↑ Note that
 [math]\displaystyle{ \mathbf{u}\otimes\mathbf{u} = \bigl( [\mathbf u]_{\times}\bigr)^2+{\mathbf I} }[/math]
 [math]\displaystyle{ \mathbf{R} = \mathbf{I} + (\sin\theta) [\mathbf u]_{\times} + (1\cos\theta)\bigl( [\mathbf u]_{\times}\bigr)^2. }[/math]
 ↑ Note that this exponential map of skewsymmetric matrices to rotation matrices is quite different from the Cayley transform discussed earlier, differing to the third order,
 [math]\displaystyle{ e^{2A}  \frac{I+A}{IA}= \tfrac{2}{3} A^3 +\mathrm{O} \left(A^4\right) . }[/math]
 ↑ For a detailed derivation, see Derivative of the exponential map. Issues of convergence of this series to the right element of the Lie algebra are here swept under the carpet. Convergence is guaranteed when X + Y < log 2 and Z < log 2. If these conditions are not fulfilled, the series may still converge. A solution always exists since exp is onto^{[clarification needed]} in the cases under consideration.
Notes
 ↑ Swokowski, Earl (1979). Calculus with Analytic Geometry (Second ed.). Boston: Prindle, Weber, and Schmidt. ISBN 0871502682. https://archive.org/details/studentsupplemen00bron.
 ↑ W3C recommendation (2003). "Scalable Vector Graphics – the initial coordinate system". http://www.w3.org/TR/SVG/coords.html#InitialCoordinateSystem.
 ↑ "Rotation Matrices". http://extranet.nmrfam.wisc.edu/nmrfam_documents/bchm800/notes/chapt4.pdf.
 ↑ Kuo Kan, Liang (6 October 2018). "Efficient conversion from rotating matrix to rotation axis and angle by extending Rodrigues' formula". arXiv:1810.02999 [cs.CG].
 ↑ Taylor, Camillo J.; Kriegman, David J. (1994). "Minimization on the Lie Group SO(3) and Related Manifolds". Technical Report No. 9405 (Yale University). https://www.cis.upenn.edu/~cjtaylor/PUBLICATIONS/pdfs/TaylorTR94b.pdf.
 ↑ Cole, Ian R. (January 2015). Modelling CPV (thesis). Loughborough University. hdl:2134/18050.
 ↑ (Baker 2003); (Fulton Harris)
 ↑ (Wedderburn 1934)
 ↑ Hall 2004, Ch. 3; Varadarajan 1984, §2.15
 ↑ (Engø 2001)
 ↑ Curtright, T L; Fairlie, D B; Zachos, C K (2014). "A compact formula for rotations as spin matrix polynomials". SIGMA 10: 084. doi:10.3842/SIGMA.2014.084. Bibcode: 2014SIGMA..10..084C.
 ↑ Baker 2003, Ch. 5; Fulton & Harris 1991, pp. 299–315
 ↑ (Goldstein Poole)
 ↑ Shoemake, Ken (1985). "Computer Graphics: SIGGRAPH '85 Conference Proceedings". SIGGRAPH '85, 22–26 July 1985, San Francisco. 19. Association for Computing Machinery. pp. 245–254. doi:10.1145/325334.325242. ISBN 0897911660. https://archive.org/details/siggraph85confer0000sigg/page/n2/.
 ↑ Cid, Jose Ángel; Tojo, F. Adrián F. (2018). "A Lipschitz condition along a transversal foliation implies local uniqueness for ODEs". Electronic Journal of Qualitative Theory of Differential Equations 13 (13): 1–14. doi:10.14232/ejqtde.2018.1.13. http://www.math.uszeged.hu/ejqtde/periodica.html?periodica=1¶mtipus_ertek=publication¶m_ertek=6497.
References
 Arvo, James (1992), "Fast random rotation matrices", in David Kirk, Graphics Gems III, San Diego: Academic Press Professional, pp. 117–120, ISBN 9780124096714, Bibcode: 1992grge.book.....K, https://archive.org/details/isbn_9780124096738/page/117
 Baker, Andrew (2003), Matrix Groups: An Introduction to Lie Group Theory, Springer, ISBN 9781852334703, https://archive.org/details/matrixgroupsintr0000bake
 BarItzhack, Itzhack Y. (Nov–Dec 2000), "New method for extracting the quaternion from a rotation matrix", Journal of Guidance, Control and Dynamics 23 (6): 1085–1087, doi:10.2514/2.4654, ISSN 07315090, Bibcode: 2000JGCD...23.1085B
 Björck, Åke; Bowie, Clazett (June 1971), "An iterative algorithm for computing the best estimate of an orthogonal matrix", SIAM Journal on Numerical Analysis 8 (2): 358–364, doi:10.1137/0708036, ISSN 00361429, Bibcode: 1971SJNA....8..358B
 Cayley, Arthur (1846), "Sur quelques propriétés des déterminants gauches", Journal für die reine und angewandte Mathematik 1846 (32): 119–123, doi:10.1515/crll.1846.32.119, ISSN 00754102, https://zenodo.org/record/1448846; reprinted as article 52 in Cayley, Arthur (1889), The collected mathematical papers of Arthur Cayley, I (1841–1853), Cambridge University Press, pp. 332–336, http://www.hti.umich.edu/cgi/t/text/pagevieweridx?c=umhistmath;cc=umhistmath;rgn=full%20text;idno=ABS3153.0001.001;didno=ABS3153.0001.001;view=image;seq=00000349
 Diaconis, Persi; Shahshahani, Mehrdad (1987), "The subgroup algorithm for generating uniform random variables", Probability in the Engineering and Informational Sciences 1: 15–32, doi:10.1017/S0269964800000255, ISSN 02699648
 Engø, Kenth (June 2001), "On the BCHformula in so(3)", BIT Numerical Mathematics 41 (3): 629–632, doi:10.1023/A:1021979515229, ISSN 00063835, http://www.ii.uib.no/publikasjoner/texrap/abstract/2000201.html
 Fan, Ky; Hoffman, Alan J. (February 1955), "Some metric inequalities in the space of matrices", Proceedings of the American Mathematical Society 6 (1): 111–116, doi:10.2307/2032662, ISSN 00029939
 Fulton, William; Harris, Joe (1991), Representation Theory: A First Course, Graduate Texts in Mathematics, 129, New York, Berlin, Heidelberg: Springer, ISBN 9780387974958
 Goldstein, Herbert; Poole, Charles P.; Safko, John L. (2002), Classical Mechanics (third ed.), Addison Wesley, ISBN 9780201657029
 Hall, Brian C. (2004), Lie Groups, Lie Algebras, and Representations: An Elementary Introduction, Springer, ISBN 9780387401225 (GTM 222)
 Herter, Thomas; Lott, Klaus (September–October 1993), "Algorithms for decomposing 3D orthogonal matrices into primitive rotations", Computers & Graphics 17 (5): 517–527, doi:10.1016/00978493(93)90003R, ISSN 00978493
 Higham, Nicholas J. (October 1, 1989), "Matrix nearness problems and applications", in Gover, Michael J. C.; Barnett, Stephen, Applications of Matrix Theory, Oxford University Press, pp. 1–27, ISBN 9780198536253, https://archive.org/details/applicationsofma0000unse/page/1
 León, Carlos A.; Massé, JeanClaude; Rivest, LouisPaul (February 2006), "A statistical model for random rotations", Journal of Multivariate Analysis 97 (2): 412–430, doi:10.1016/j.jmva.2005.03.009, ISSN 0047259X, http://www.mat.ulaval.ca/pages/lpr/
 Miles, Roger E. (December 1965), "On random rotations in R^{3}", Biometrika 52 (3/4): 636–639, doi:10.2307/2333716, ISSN 00063444
 Moler, Cleve; Morrison, Donald (1983), "Replacing square roots by pythagorean sums", IBM Journal of Research and Development 27 (6): 577–581, doi:10.1147/rd.276.0577, ISSN 00188646, http://domino.watson.ibm.com/tchjr/journalindex.nsf/0b9bc46ed06cbac1852565e6006fe1a0/0043d03ee1c1013c85256bfa0067f5a6?OpenDocument
 Murnaghan, Francis D. (1950), "The element of volume of the rotation group", Proceedings of the National Academy of Sciences 36 (11): 670–672, doi:10.1073/pnas.36.11.670, ISSN 00278424, PMID 16589056, Bibcode: 1950PNAS...36..670M
 Murnaghan, Francis D. (1962), The Unitary and Rotation Groups, Lectures on applied mathematics, Washington: Spartan Books
 Cayley, Arthur (1889), The collected mathematical papers of Arthur Cayley, I (1841–1853), Cambridge University Press, pp. 332–336, http://www.hti.umich.edu/cgi/t/text/pagevieweridx?c=umhistmath;cc=umhistmath;rgn=full%20text;idno=ABS3153.0001.001;didno=ABS3153.0001.001;view=image;seq=00000349
 Paeth, Alan W. (1986), "A Fast Algorithm for General Raster Rotation", Proceedings, Graphics Interface '86: 77–81, https://graphicsinterface.org/wpcontent/uploads/gi198615.pdf
 Daubechies, Ingrid; Sweldens, Wim (1998), "Factoring wavelet transforms into lifting steps", Journal of Fourier Analysis and Applications 4 (3): 247–269, doi:10.1007/BF02476026, https://cmbelllabs.github.io/who/wim/papers/factor/factor.pdf
 Pique, Michael E. (1990), "Rotation Tools", in Andrew S. Glassner, Graphics Gems, San Diego: Academic Press Professional, pp. 465–469, ISBN 9780122861666, http://www.graphicsgems.org/
 Press, William H.; Teukolsky, Saul A.; Vetterling, William T.; Flannery, Brian P. (2007), "Section 21.5.2. Picking a Random Rotation Matrix", Numerical Recipes: The Art of Scientific Computing (3rd ed.), New York: Cambridge University Press, ISBN 9780521880688, http://apps.nrbook.com/empanel/index.html#pg=1130, retrieved 20110818
 Shepperd, Stanley W. (May–June 1978), "Quaternion from rotation matrix", Journal of Guidance and Control 1 (3): 223–224, doi:10.2514/3.55767b
 Shoemake, Ken (1994), "Euler angle conversion", in Paul Heckbert, Graphics Gems IV, San Diego: Academic Press Professional, pp. 222–229, ISBN 9780123361554, https://archive.org/details/isbn_9780123361554/page/222
 Stuelpnagel, John (October 1964), "On the parameterization of the threedimensional rotation group", SIAM Review 6 (4): 422–430, doi:10.1137/1006093, ISSN 00361445, Bibcode: 1964SIAMR...6..422S (Also NASACR53568.)
 Varadarajan, Veeravalli S. (1984), Lie Groups, Lie Algebras, and Their Representation, Springer, ISBN 9780387909691 (GTM 102)
 Wedderburn, Joseph H. M. (1934), Lectures on Matrices, AMS, ISBN 9780821832042, https://scholar.google.co.uk/scholar?hl=en&lr=&q=author%3AWedderburn+intitle%3ALectures+on+Matrices&as_publication=&as_ylo=1934&as_yhi=1934&btnG=Search
External links
 Hazewinkel, Michiel, ed. (2001), "Rotation", Encyclopedia of Mathematics, Springer Science+Business Media B.V. / Kluwer Academic Publishers, ISBN 9781556080104, https://www.encyclopediaofmath.org/index.php?title=p/r082620
 Rotation matrices at Mathworld
 Math Awareness Month 2000 interactive demo (requires Java)
 Rotation Matrices at MathPages
 (in Italian) A parametrization of SOn(R) by generalized Euler Angles
 Rotation about any point
Original source: https://en.wikipedia.org/wiki/Rotation matrix.
Read more 