Rotation Calculator - Rotate Points in 2D
Enter a point, choose a rotation angle, and pick a center of rotation. The calculator applies the 2D rotation formula instantly and shows the new coordinates, the rotation matrix, and a full step-by-step working. Supports degrees and radians, clockwise or counterclockwise rotation, and any center point.
Formula
Worked example
Rotate (3, 4) by 90 degrees counterclockwise around the origin: cos(90) = 0, sin(90) = 1. New x = 3 * 0 - 4 * 1 = -4. New y = 3 * 1 + 4 * 0 = 3. Result: (-4, 3). Distance from origin = sqrt(3^2 + 4^2) = sqrt(9 + 16) = 5, preserved after rotation.
What is a 2D rotation?
A 2D rotation moves every point in the plane around a fixed center by the same angle, without changing any distances or angles between points. It belongs to the family of isometric transformations (along with translations and reflections) because it preserves the shape and size of every figure it is applied to. The result is a congruent image of the original, just in a different orientation. The center of rotation is the only point that does not move.
The rotation formula and rotation matrix
To rotate a point (x, y) by angle theta around the origin, apply: x' = x * cos(theta) - y * sin(theta) and y' = x * sin(theta) + y * cos(theta). When the center is an arbitrary point (cx, cy) instead, first translate so the center lands at the origin, rotate, then translate back: x' = cx + (x - cx) * cos(theta) - (y - cy) * sin(theta) and y' = cy + (x - cx) * sin(theta) + (y - cy) * cos(theta). In matrix notation the same operation is written as [x', y']^T = R * [x, y]^T where R = [[cos t, -sin t], [sin t, cos t]]. The matrix R is orthogonal: its inverse equals its transpose, and its determinant is 1, confirming that distances are preserved.
Degrees vs radians and sign conventions
Angles can be expressed in degrees (a full circle is 360 deg) or radians (a full circle is 2 * pi, about 6.283). To convert: radians = degrees * pi / 180. The standard math convention defines counterclockwise as positive and clockwise as negative. This calculator lets you choose the direction explicitly so you never have to remember the sign: simply pick Counterclockwise or Clockwise and enter a positive number. Common presets (30, 45, 60, 90, 180, 270 deg) are available as shortcuts.
Rotation in geometry, physics, and computer graphics
Rotation is one of the core operations in coordinate geometry at the school level (rotating figures on the coordinate plane) and at the university level (linear algebra, complex numbers, Fourier analysis). In physics it describes the motion of rigid bodies and the transformation between reference frames. In computer graphics and game development, 2D rotation is applied to every sprite, shape, and UI element that spins or turns. In robotics and navigation, sequences of rotations describe how joints and sensors are oriented relative to each other. The rotation matrix extends naturally to 3D, where three separate rotation matrices (Rx, Ry, Rz) handle pitch, yaw, and roll.
Standard rotation rules around the origin
| Rotation | New X | New Y | Notes |
|---|---|---|---|
| 90 deg CCW | -y | x | Quarter turn left |
| 180 deg | -x | -y | Half turn (same CW and CCW) |
| 270 deg CCW | y | -x | Quarter turn right (= 90 deg CW) |
| 360 deg | x | y | Full turn, identity |
| 45 deg CCW | (x-y)/sqrt(2) | (x+y)/sqrt(2) | Eighth turn |
| 30 deg CCW | x*cos30 - y*sin30 | x*sin30 + y*cos30 | sin30=0.5, cos30~0.866 |
| 60 deg CCW | x*cos60 - y*sin60 | x*sin60 + y*cos60 | sin60~0.866, cos60=0.5 |
For counterclockwise rotations around (0, 0), these exact-value shortcut rules apply to any point (x, y). Clockwise rotations negate the angle.
Frequently asked questions
How do I rotate a point 90 degrees counterclockwise around the origin?
For a 90-degree counterclockwise rotation around the origin, the shortcut is: new point = (-y, x). So the point (3, 4) becomes (-4, 3), and (5, 0) becomes (0, 5). This comes directly from the rotation formula with cos(90) = 0 and sin(90) = 1.
What is the difference between clockwise and counterclockwise rotation?
Counterclockwise (CCW) is the positive direction in the standard mathematical coordinate system (where the y-axis points up). Clockwise (CW) is the negative direction. A 90-degree CCW rotation gives (-y, x); a 90-degree CW rotation gives (y, -x). This calculator lets you pick the direction explicitly and always enter a positive angle, so you avoid sign confusion.
Does rotation change the length of a vector or the distance between two points?
No. Rotation is an isometric transformation, meaning it preserves all distances. A point that is 5 units from the center before rotation is still exactly 5 units from the center after rotation. Similarly, if two points are 7 units apart before rotation, they are still 7 units apart after. This is confirmed by the determinant of the rotation matrix being 1.
How do I rotate around a point other than the origin?
Translate the entire picture so that your chosen center lands at the origin, apply the standard rotation formula, then translate back. In practice: subtract the center coordinates from the point, rotate as usual, then add the center back. For example, to rotate (5, 6) by 90 degrees CCW around (2, 3): translate to (5-2, 6-3) = (3, 3); rotate 90 CCW to (-3, 3); translate back to (-3+2, 3+3) = (-1, 6). This calculator does all three steps automatically when you select Custom center.
How do I convert between degrees and radians?
Multiply degrees by pi / 180 to get radians. Multiply radians by 180 / pi to get degrees. Common conversions: 30 deg = pi/6 rad, 45 deg = pi/4 rad, 60 deg = pi/3 rad, 90 deg = pi/2 rad, 180 deg = pi rad, 360 deg = 2*pi rad. This calculator accepts either unit - select the one you are working with and enter the number directly.
Can I use this for rotating a whole shape?
Yes. A rotation is applied to individual points, so to rotate a shape (triangle, rectangle, polygon) rotate each vertex separately using the same angle and center, then connect the new vertices. The resulting shape is congruent to the original - same side lengths and angles, just in a new orientation.