Rotation Matrix Calculator
Rotate 2D points and 3D vectors using rotation matrices. Calculate the transformed coordinates, inspect the matrix, and follow each step of the rotation.
Calculate a rotation
Select a rotation type, enter the angle in degrees, and enter the coordinates of the point or vector.
What is a rotation matrix?
A rotation matrix is a square matrix that rotates a vector or point in a coordinate system. Standard rotation matrices preserve lengths and angles and have determinant 1.
2D rotation matrix
For a counterclockwise angle θ about the origin:
[ sin(θ) cos(θ) ]
A point P = (x, y) is represented as a column vector, and its rotated coordinates are calculated with P′ = R(θ)P.
3D rotation matrices
Rotation about the X-axis:
[ 0 cos(θ) −sin(θ) ]
[ 0 sin(θ) cos(θ) ]
Rotation about the Y-axis:
[ 0 1 0 ]
[ −sin(θ) 0 cos(θ) ]
Rotation about the Z-axis:
[ sin(θ) cos(θ) 0 ]
[ 0 0 1 ]
Rotating a 2D point around a center
To rotate a point P about a center C other than the origin, first subtract the center, rotate the relative point, and then add the center back:
Worked example
Rotate the point (1, 0) by 90° counterclockwise about the origin. Since cos(90°) = 0 and sin(90°) = 1, the matrix becomes:
[ 1 0 ]
Multiplying the matrix by (1, 0) gives (0, 1). Tiny floating-point values near zero are displayed as zero.
Applications of rotation matrices
- Computer graphics, animation, and 3D modeling.
- Robotics and coordinate transformations.
- Physics and engineering simulations.
- Geometry and linear algebra.
- Rotating points and vectors between coordinate frames.
Frequently asked questions
Are positive rotation angles clockwise or counterclockwise?
In the standard Cartesian coordinate system, positive angles rotate counterclockwise and negative angles rotate clockwise. In 3D, the positive direction follows the right-hand rule.
Does a rotation matrix change vector length?
No. A standard rotation matrix preserves vector lengths, distances, and angles.
How can I rotate a point around a custom center?
Select the 2D rotation mode, enter the point coordinates, and specify the center coordinates. The calculator translates the point relative to the center, rotates it, and translates it back.
Can I rotate a 3D vector around any arbitrary axis?
This version supports rotations about the X, Y, and Z axes. An arbitrary-axis rotation requires a separate axis-angle or Rodrigues rotation implementation.