This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

RotationMatrix

 RotationMatrix[] gives the 2D rotation matrix that rotates 2D vectors counterclockwise by radians. RotationMatrixgives the 3D rotation matrix for a counterclockwise rotation around the 3D vector w. RotationMatrixgives the matrix that rotates the vector u to the direction of the vector v in any dimension. RotationMatrixgives the matrix that rotates by radians in the hyperplane spanned by u and v.
• RotationMatrix gives matrices for rotations of vectors around the origin.
• Two different conventions for rotation matrices are in common use.
• RotationMatrix is set up to use the vector-oriented convention and to give a matrix m so that yields the rotated version of a vector r.
• Transpose gives rotation matrices with the alternative coordinate-system-oriented convention for which yields the rotated version of a vector r.
• Positive in RotationMatrix corresponds to going from the direction of u towards the direction of v.
• RotationMatrix gives an orthogonal matrix of determinant 1, that in dimensions can be considered an element of the group .
General 2D rotation matrix for rotating a vector about the origin:
Apply rotation by to a unit vector in the direction:
Counterclockwise rotation by 30°:
Rotation that transforms the direction of into the direction of :
3D rotation around the axis:
General 2D rotation matrix for rotating a vector about the origin:
 Out[1]//MatrixForm=
Apply rotation by to a unit vector in the direction:
 Out[2]=

Counterclockwise rotation by 30°:
 Out[1]=

Rotation that transforms the direction of into the direction of :
 Out[1]=

3D rotation around the axis:
 Out[1]//MatrixForm=
 Scope   (6)
A 4D rotation matrix, rotating in the plane:
A general 3D rotation matrix, rotating in the plane given by :
Rotate the vector to the vector :
Generate the rotation matrix for symbolic vectors, assuming that all quantities are real:
Rotating gives the normalized vector:
Transformation applied to a 2D shape:
Transformation applied to a 3D shape:
 Applications   (2)
Rotating 3D shapes:
Produce a basis for all rotations in dimension :
All rotations in 2D:
All rotations in 3D:
All rotations in 4D; in general basis elements are needed for dimension :
A rotation matrix is orthogonal, i.e. the inverse is equal to the transpose:
In the complex case, the rotation matrix is unitary:
A rotation matrix has determinant :
Multiplying by the rotation matrix preserves the norm of a vector:
The inverse of RotationMatrix is given by RotationMatrix:
The inverse of RotationMatrix is also given by RotationMatrix:
If u or v is not real the relationship is more complex:
In 2D the inverse of RotationMatrix[] is given by RotationMatrix:
In 3D the inverse of RotationMatrix is given by RotationMatrix:
If w is not real the relationship is more complex:
The composition of rotations is a rotation:
The order in which rotations are performed is important:
Rotating around and then is not the same as first rotating around and then :
Rotations of a circular sector:
New in 6