BUILT-IN MATHEMATICA SYMBOL

# RotationMatrix

gives the 2D rotation matrix that rotates 2D vectors counterclockwise by radians.

RotationMatrix[, w]
gives the 3D rotation matrix for a counterclockwise rotation around the 3D vector w.

RotationMatrix[{u, v}]
gives the matrix that rotates the vector u to the direction of the vector v in any dimension.

RotationMatrix[, {u, v}]
gives the matrix that rotates by radians in the hyperplane spanned by u and v.

## DetailsDetails

• 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[RotationMatrix[...]] gives rotation matrices with the alternative coordinate-system-oriented convention for which yields the rotated version of a vector r.
• Angles in RotationMatrix are in radians. or specifies an angle in degrees.
• Positive in RotationMatrix[, {u, v}] corresponds to going from the direction of u towards the direction of v.
• is equivalent to RotationMatrix[, {{1, 0}, {0, 1}}].
• RotationMatrix[, w] is equivalent to RotationMatrix[, {u, v}], where , , and form a right-handed coordinate system.
• RotationMatrix gives an orthogonal matrix of determinant 1, that in dimensions can be considered an element of the group .

## ExamplesExamplesopen allclose all

### Basic Examples (4)Basic Examples (4)

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=