= Rotation Matrix = A '''rotation matrix''' represents the linear transformation of rotation. <> ---- == Description == A rotation matrix is defined for a specific number of dimensions. In ''R^2^'', a rotation matrix is: {{attachment:rot2.svg}} where ''θ'' is the angle of counter-clockwise rotation. Note that a negative ''θ'' represents clockwise rotation. As an example, a counter-clockwise rotation of 90 degrees (or ''π/2'' radians) is represented by: {{attachment:rotex.svg}} In ''R^3^'', there are separate rotation matrices for each dimension. {{attachment:rot3.svg}} where ''α'', ''β'', and ''γ'' represent '''yaw''', '''pitch''', and '''roll''' in the Z, Y, and X dimensions respectively. A complete rotation matrix in three dimensions can then be calculated as '''''R''' = '''R''',,z,,(α)'''R''',,y,,(β)'''R''',,x,,(γ)''. === Properties === A rotation matrix is always [[LinearAlgebra/Orthogonality#Orthonormality|orthonormal]]. It follows that '''''R'''^T^ = '''R'''^-1^''. The [[LinearAlgebra/Determinant|determinant]] of a pure rotation matrix, i.e., one that rotates and does not stretch, is either 1 or -1. === Decomposition of Rotation and Stretching === A 2-dimensional matrix that rotates and stretches can be decomposed between the two components. Consider the example matrix {{attachment:ab.svg}}: * The eigenvalues (''λ'') are ''a + bi'' and ''a - bi'' * Following from the formula for [[Calculus/ComplexVector#Distance|distance of complex vectors]], the stretching factor is ''||λ|| = √(a^2^ + b^2^)''. Therefore the decomposition is: {{attachment:decom.svg}} where: * ''a = ||λ|| cos(θ)'' and ''b = ||λ|| sin(θ)'', or * ''θ = tan^-1^(b/a)'' ---- == Eigenvectors == A matrix that rotates will always have [[Calculus/ComplexVector|complex]] [[LinearAlgebra/EigenvaluesAndEigenvectors|eigenvectors]]. In fact, a complex eigenpair means that the transformation involves rotation. Consider the 2-dimensional case again. There clearly cannot be ''any'' vectors which do not change direction through rotation. Consider now the 3-dimensional rotation matrix for rotation around the Z axis. This is fundamentally the same rotation. But now all vectors along the axis of rotation are unchanged by rotation. ---- CategoryRicottone