// maths › Graphics & Technology

2D Rotation (Graphics)

Rotate a point (x, y) about the origin by an angle using x′ = x·cosθ − y·sinθ, y′ = x·sinθ + y·cosθ, with the angle in degrees or radians.

x′ = x·cosθ − y·sinθ; y′ = x·sinθ + y·cosθ

Angle unit

Frequently asked questions

How do you rotate a point?

About the origin by angle θ: x′ = x·cosθ − y·sinθ and y′ = x·sinθ + y·cosθ. These are the rows of the 2-D rotation matrix.

Where is this used?

Whenever a screen reorients, a game sprite spins, or a graphic turns — the device computes new coordinates with exactly these formulas.

Can you show a worked example?

Rotating (3, 0) by 90°: x′ = 3·cos90° − 0 = 0, y′ = 3·sin90° + 0 = 3, giving (0, 3) — a quarter turn anticlockwise.

Which way is positive?

Positive angles rotate anticlockwise (the maths convention); negative angles rotate clockwise.

Degrees or radians?

Either — the toggle converts the angle; 90° is π/2 ≈ 1.5708 rad, and the result is the same.