Rotation Calculator
Rotate a point (x, y) around the origin or any centre (cx, cy) by any angle, clockwise or counterclockwise. The calculator applies the 2D rotation matrix, shows the step-by-step working, gives exact coordinates for special angles (90°, 180°, 270°), and reports the distance and angle from the centre.
What Is a Rotation?
A rotation is a geometric transformation that turns a figure around a fixed point called the centre of rotation by a certain number of degrees. In the coordinate plane, a rotation moves every point along a circular arc centred at the centre of rotation. The shape and size of the figure are unchanged — only its orientation changes.
In standard mathematics, a counterclockwise (CCW) rotation is considered positive, and a clockwise (CW) rotation is negative. A clockwise rotation by angle θ is the same as a counterclockwise rotation by −θ.
The 2D Rotation Matrix
For a counterclockwise rotation by angle θ about the origin, the rotation matrix is:
R(θ) = [ [cos θ, −sin θ], [sin θ, cos θ] ]
Multiplying this matrix by the coordinate vector (x, y) gives the rotated point (x′, y′):
x′ = x cos θ − y sin θ
y′ = x sin θ + y cos θ
For a clockwise rotation, replace θ with −θ. Since cos(−θ) = cos θ and sin(−θ) = −sin θ, the signs of the sine terms flip:
x′ = x cos θ + y sin θ
y′ = −x sin θ + y cos θ
Rotating around a centre other than the origin
If the centre of rotation is (cx, cy) rather than (0, 0), translate the point so the centre becomes the origin, rotate, then translate back:
x′ = cx + (x − cx) cos θ − (y − cy) sin θ
y′ = cy + (x − cx) sin θ + (y − cy) cos θ
The calculator performs these three steps automatically when you enter a custom centre.
Special Rotation Rules (Exact Coordinates)
For the most common angles, the trigonometric functions take exact values, so the coordinates can be written without rounding. The table below shows the rules for a counterclockwise rotation about the origin.
| Angle (CCW) | Rule | Example: (3, 4) |
|---|---|---|
| 90° | (x, y) → (−y, x) | (−4, 3) |
| 180° | (x, y) → (−x, −y) | (−3, −4) |
| 270° | (x, y) → (y, −x) | (4, −3) |
| 360° | (x, y) → (x, y) | (3, 4) |
For a clockwise rotation, swap the rules for 90° and 270°: a 90° CW rotation maps (x, y) to (y, −x), and a 270° CW rotation maps (x, y) to (−y, x). A 180° rotation is the same in both directions.
3D Rotation Matrices
In three dimensions, a rotation is specified by an axis (X, Y or Z) and an angle. The rotation matrices are:
Rotation about the Z-axis
The z-coordinate is unchanged, and (x, y) rotates exactly as in the 2D case:
x′ = x cos θ − y sin θ
y′ = x sin θ + y cos θ
z′ = z
Rotation about the X-axis
x′ = x
y′ = y cos θ − z sin θ
z′ = y sin θ + z cos θ
Rotation about the Y-axis
x′ = x cos θ + z sin θ
y′ = y
z′ = −x sin θ + z cos θ
This calculator focuses on 2D rotation. For 3D rotation, use the dedicated 3D rotation calculator linked in the sidebar.
Rotation in Physics — Angular Velocity and RPM
In physics and engineering, rotation is often described by angular velocity (ω), measured in radians per second (rad/s). The relationship between angular velocity and revolutions per minute (RPM) is:
ω = 2π × RPM / 60 (rad/s)
RPM = ω × 60 / (2π)
For a point at radius r from the axis, the linear speed is v = ωr. These formulas are used in mechanics, robotics, motor sizing and many other fields.
How the Calculator Works
- Parses the x and y coordinates of each point, the centre (cx, cy), the angle θ, and the direction.
- Converts the angle to radians for use with
Math.cosandMath.sin. - Translates each point so the centre becomes the origin: x′ = x − cx, y′ = y − cy.
- Applies the rotation matrix: x″ = x′ cos θ − y′ sin θ, y″ = x′ sin θ + y′ cos θ. For clockwise rotation, the sign of the sine terms is flipped.
- Translates back to the original coordinate system: x_new = x″ + cx, y_new = y″ + cy.
- Rounds the result to the selected precision and also shows exact coordinates for 90°, 180° and 270°.
- Reports the distance from the centre before and after (they are always equal), and the angle of the point from the centre.
Supported Input Format
| Input | Meaning | Result (CCW, origin) |
|---|---|---|
| (3, 4), 90° | Quarter turn | (−4, 3) |
| (3, 4), 180° | Half turn | (−3, −4) |
| (3, 4), 270° | Three-quarter turn | (4, −3) |
| (1, 0), 45° | Eighth turn | (0.7071, 0.7071) |
| (0, 5), 30° | Arbitrary angle | (−2.5, 4.3301) |
| (3, 4), 90° CW | Clockwise | (4, −3) |
| batch of points | Up to 8 points | each rotated |
Assumptions and Limitations
- Coordinates and the centre must be real numbers (decimals are accepted).
- The angle is entered in degrees; radians are not accepted directly.
- Up to 8 points can be rotated in one batch.
- For non-special angles, coordinates are rounded to the selected precision. The exact trigonometric expressions are shown in the step-by-step working.
- If a point coincides with the centre, it does not move, and the angle from the centre is undefined.
- This is a 2D rotation calculator. For 3D rotation, use the dedicated tool.
❓ Rotation FAQ
How do I rotate a point 90 degrees counterclockwise?
For a 90° counterclockwise rotation about the origin, the rule is (x, y) → (−y, x). For example, (3, 4) becomes (−4, 3). The calculator applies the full rotation matrix, so it works for any angle and any centre.
What is the rotation matrix for 2D?
The 2D rotation matrix for a counterclockwise rotation by angle θ is R(θ) = [[cos θ, −sin θ], [sin θ, cos θ]]. Multiplying this matrix by (x, y) gives x′ = x cos θ − y sin θ and y′ = x sin θ + y cos θ.
How do I rotate a point around a centre other than the origin?
Translate the point so the centre becomes the origin, apply the rotation matrix, then translate back. If the centre is (cx, cy), the formulas are: x′ = cx + (x − cx) cos θ − (y − cy) sin θ, y′ = cy + (x − cx) sin θ + (y − cy) cos θ. The calculator handles this automatically when you enter a custom centre.
What is the rule for a 180-degree rotation?
A 180° rotation about the origin maps (x, y) to (−x, −y). This is the same whether you rotate clockwise or counterclockwise, because a half-turn in either direction lands on the same point.
What is the rule for a 270-degree counterclockwise rotation?
A 270° counterclockwise rotation is equivalent to a 90° clockwise rotation, and the rule is (x, y) → (y, −x). For example, (3, 4) becomes (4, −3).
Does rotation preserve distance?
Yes. A rotation is a rigid transformation, so the distance from the centre of rotation to the point is unchanged. The calculator shows the original distance and the rotated distance so you can verify they match.
Can I rotate more than one point at once?
Yes. The calculator supports batch mode: enter up to 8 points, each with its own (x, y) coordinates, and they will all be rotated by the same centre, angle and direction. Results are shown in a summary table.
What is the difference between clockwise and counterclockwise rotation?
In standard mathematics, counterclockwise (CCW) is the positive direction. A clockwise (CW) rotation by angle θ is the same as a counterclockwise rotation by −θ. The calculator lets you choose the direction, and it adjusts the signs of the sine terms accordingly.
How do I rotate a point in 3D?
A 3D rotation is specified by an axis (X, Y or Z) and an angle. For example, a rotation about the Z-axis keeps the z-coordinate fixed and rotates (x, y) using the 2D rotation matrix. Rotations about the X-axis and Y-axis follow similar 3×3 matrices. This calculator focuses on 2D rotation; the explanation section shows the 3D matrices for reference.
Can the angle be negative?
Yes. A negative angle in the counterclockwise convention is equivalent to a clockwise rotation. The calculator accepts both positive and negative angles, and you can also select the direction explicitly. For example, −90° CCW is the same as 90° CW.
What if I enter the same point as the centre?
If the point coincides with the centre of rotation, it does not move: the rotated point is identical to the original point. The distance from the centre is zero, and the angle is undefined.
How precise are the results?
The calculator shows results to the precision you select (up to 10 decimal places). For special angles such as 90°, 180° and 270°, exact coordinates are also displayed. For other angles, the coordinates are rounded to the chosen precision, and the exact trigonometric expressions are shown in the step-by-step working.