Rotation Matrix
Rotates a point by angle θ around the origin.
X = x cos θ − y sin θ Y = x sin θ + y cos θ
With the y-axis up, a positive θ turns counter-clockwise.
To rotate around another point, move it to the origin, rotate, then move it back.
Calculator
Change a value and the result and picture update instantly.
Result
Rotated X
Rotated Y
Animated picture
The picture follows your values. Some points and shapes can be dragged.
Use in game development
Turrets, orbiting satellites and rotating screens all use it.
Code example (JavaScript)
const c = Math.cos(t), s = Math.sin(t);
const X = x*c - y*s, Y = x*s + y*c;
What the symbols mean
| Symbol | Meaning |
|---|---|
x | Point x |
y | Point y |
deg | Angle θ (°) |
X | Rotated X |
Y | Rotated Y |
More formulas in this category
- Vector Addition and Length
- Unit Vectors (Normalization)
- Dot Product and the Angle Between Vectors
- Cross Product (2D)
- Matrix–Vector Multiplication and Determinant
Frequently asked questions
- What is the formula for Rotation Matrix?
- The formula for Rotation Matrix is X = x cos θ − y sin θ Y = x sin θ + y cos θ. Rotates a point by angle θ around the origin.
Math Formula Quiz Vectors & Matrices
Sources
Checked: 2026-11-29