Rotation Matrix — Definition, Formula & Examples
A rotation matrix is a square matrix that, when multiplied by a vector, rotates that vector by a specified angle around the origin without changing its length. In two dimensions, a rotation matrix is a 2×2 matrix defined by a single angle θ.
A rotation matrix is an orthogonal matrix with determinant , belonging to the special orthogonal group . It satisfies and , where is the transpose and is the identity matrix. These conditions guarantee that preserves both distances and orientation.
Key Formula
Where:
- = The angle of counterclockwise rotation (in radians or degrees)
- = The 2×2 rotation matrix that rotates vectors by angle θ
How It Works
To rotate a 2D column vector by an angle counterclockwise about the origin, multiply it by the 2D rotation matrix: . The resulting vector has the same magnitude as but points in a new direction. A positive angle corresponds to counterclockwise rotation, while a negative angle rotates clockwise. Because rotation matrices are orthogonal, the inverse of a rotation by is simply the rotation by , which equals the transpose . In 3D, separate rotation matrices exist for rotation about the -, -, and -axes, and general 3D rotations are built by composing these.
Worked Example
Problem: Rotate the vector by 90° counterclockwise about the origin.
Step 1: Write the rotation matrix for θ = 90°. Since cos 90° = 0 and sin 90° = 1:
Step 2: Multiply the rotation matrix by the vector:
Step 3: Verify the result preserves length. The original vector has length 1, and the rotated vector also has length √(0² + 1²) = 1.
Answer: The rotated vector is , which points straight up along the positive -axis — exactly 90° counterclockwise from the original.
Another Example
Problem: Rotate the point by 60° counterclockwise about the origin.
Step 1: Build the rotation matrix for θ = 60°. Use cos 60° = 0.5 and sin 60° ≈ 0.866:
Step 2: Multiply the rotation matrix by the position vector:
Step 3: Check that the distance from the origin is preserved. The original distance is √(9 + 16) = 5, and the new distance is √(1.964² + 4.598²) ≈ √(3.857 + 21.143) = √25 = 5.
Answer: The rotated point is approximately , still at distance 5 from the origin.
Why It Matters
Rotation matrices are foundational in computer graphics, robotics, and aerospace engineering — any field that needs to describe orientation or movement in space. In a linear algebra course, they serve as a key example of orthogonal transformations and connect abstract theory to geometric intuition. Physics and engineering students use them extensively when working with coordinate transformations, rigid-body dynamics, and satellite attitude control.
Common Mistakes
Mistake: Swapping the signs in the rotation matrix, writing in the top-right entry and in the bottom-left.
Correction: The standard counterclockwise rotation matrix has in the top-right and in the bottom-left. Reversing the signs produces a clockwise rotation (or equivalently, the transpose).
Mistake: Using degrees in a calculator set to radians (or vice versa) when evaluating sin and cos.
Correction: Always check your calculator's angle mode. If θ = 90°, using radian mode will compute sin(90) ≈ 0.894 instead of the correct sin(90°) = 1.
