Three-dimensional rotation operator

This article derives the main properties of rotations in 3-dimensional space.
The three Euler rotations are one way to bring a rigid body to any desired orientation by sequentially making rotations about axis' fixed relative to the object. However, this can also be achieved with one single rotation (Euler's rotation theorem). Using the concepts of linear algebra it is shown how this single 
rotation can be performed.
Mathematical formulation.
Let be a coordinate system fixed in the body that through a change in orientation is brought to the new directions
Any vector
rotating with the body is then brought to the new direction
that is to say, this is a linear operator
The matrix of this operator relative to the coordinate system is 
As 
or equivalently in matrix notation
the matrix is orthogonal and as a right-handed base vector system is reorientated into another right-handed system the determinant of this matrix has the value 1.
Rotation around an axis.
Let be an orthogonal positively oriented base vector system in . The linear operator "rotation by angle around the axis defined by " has the matrix representation
relative to this basevector system. This then means that a vector
is rotated to the vector
by the linear operator. The determinant of this matrix is
and the characteristic polynomial is
The matrix is symmetric if and only if , that is, for and . The case is the trivial case of an identity operator. For the case the characteristic polynomial is
so the rotation operator has the eigenvalues
The eigenspace corresponding to is all vectors on the rotation axis, namely all vectors
The eigenspace corresponding to consists of all vectors orthogonal to the rotation axis, namely all vectors
For all other values of the matrix is not symmetric and as there is only the eigenvalue with the one-dimensional eigenspace of the vectors on the rotation axis:
The rotation matrix by angle around a general axis of rotation is given by Rodrigues' rotation formula.
where is the identity matrix and is the dual 2-form of or 
cross product matrix,
Note that satisfies for all vectors .
The general case.
The operator "rotation by angle around a specified axis" discussed above is an orthogonal mapping and its matrix relative to any base vector system is therefore an orthogonal matrix. Furthermore its determinant has the value 1. A non-trivial fact is the opposite, that for any orthogonal linear mapping in with determinant 1 there exist base vectors such that the matrix takes the "canonical form"
for some value of . In fact, if a linear operator has the orthogonal matrix
relative to some base vector system and this matrix is symmetric, the "symmetric operator theorem" valid in (any dimension) applies saying that it has orthogonal eigenvectors. This means for the 3-dimensional case that there exists a coordinate system such that the matrix takes the form
As it is an orthogonal matrix these diagonal elements are either 1 or −1. As the determinant is 1 these elements are either all 1 or one of the elements is 1 and the other two are −1. In the first case it is the trivial identity operator corresponding to . In the second case it has the form
if the basevectors are numbered such that the one with eigenvalue 1 has index 3. This matrix is then of the desired form for .
If the matrix is asymmetric, the vector
where
is nonzero. This vector is an eigenvector with eigenvalue . Setting 
and selecting any two orthogonal unit vectors and in the plane orthogonal to such that form a positively oriented triple, the operator takes the desired form with
The expressions above are in fact valid also for the case of a symmetric rotation operator corresponding to a rotation with or . But the difference is that for the vector 
is zero and of no use for finding the eigenspace of eigenvalue 1, and thence the rotation axis.
Defining as the matrix for the rotation operator is
provided that
that is, except for the cases (the identity operator) and .
Quaternions.
Quaternions are defined similar to with the difference that the half angle is used instead of the full angle . This means that the first 3 components components of a vector defined from
and that the fourth component is the scalar
As the angle defined from the canonical form is in the interval 
one would normally have that . But a "dual" representation of a rotation with quaternions is used, that is to say ("q"1, "q"2, "q"3, "q"4)}} and are two alternative representations of one and the same rotation.
The entities are defined from the quaternions by
Using quaternions the matrix of the rotation operator is
Numerical example.
Consider the reorientation corresponding to the Euler angles , , relative to a given base vector system . The corresponding matrix relative to this base vector system is (see Euler angles#Matrix orientation)
and the quaternion is
The canonical form of this operator
with is obtained with
The quaternion relative to this new system is then
Instead of making the three Euler rotations 10°, 20°, 30° the same orientation can be reached with one single rotation of size 44.537° around .