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 X1.225×10^-16
Rotated Y2

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

SymbolMeaning
xPoint x
yPoint y
degAngle θ (°)
XRotated X
YRotated Y

More formulas in this category

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