Report

Help us improve this tool

Rotation Calculator

Calculate 2D point rotation around origin or custom center point online with rotation matrix and interactive coordinate plot.

O M T

What Is 2D Geometric Rotation?

In Euclidean geometry, a rotation is an isometric transformation that turns a plane around a fixed center point (the pivot or center of rotation) by a specified angle $\theta$. Because rotation is a rigid transformation (an isometry), it preserves lengths between points, relative distances, interior angles, and geometric shapes, altering only the orientation and coordinates of the rotated object.

By convention in mathematics, physics, and computer graphics:

  • A positive angle ($\theta > 0$) rotates points counterclockwise (CCW).
  • A negative angle ($\theta < 0$) rotates points clockwise (CW).

The 2D Rotation Formula Around the Origin $(0, 0)$

When rotating an initial point $P(x, y)$ around the Cartesian origin by an angle $\theta$, the new rotated coordinates $P'(x', y')$ are computed using standard trigonometric formulas:

$$x' = x \cos\theta - y \sin\theta$$

$$y' = x \sin\theta + y \cos\theta$$

In matrix notation, this linear transformation is represented via the $2 \times 2$ standard rotation matrix $R(\theta)$:

$$\begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}$$

Rotation Around an Arbitrary Center Point $(x_0, y_0)$

To rotate a point around an arbitrary pivot $C(x_0, y_0)$ other than the origin, the transformation consists of three sequential steps:

  1. Translate to the Origin: Subtract the pivot coordinates to make $C$ the temporary origin: $$\Delta x = x - x_0, \quad \Delta y = y - y_0$$
  2. Apply the Standard Rotation Matrix: $$\Delta x' = \Delta x \cos\theta - \Delta y \sin\theta$$ $$\Delta y' = \Delta x \sin\theta + \Delta y \cos\theta$$
  3. Translate Back: Add the pivot coordinates back: $$x' = x_0 + \Delta x'$$ $$y' = y_0 + \Delta y'$$

Combining these into single coordinate expressions gives:

$$x' = x_0 + (x - x_0) \cos\theta - (y - y_0) \sin\theta$$

$$y' = y_0 + (x - x_0) \sin\theta + (y - y_0) \cos\theta$$

Common Special Angles in 2D Rotation

For standard counterclockwise rotations around $(0, 0)$, the rotation formulas simplify directly into integer or sign-swapped components:

  • $90^\circ$ Rotation ($\pi/2\text{ rad}$): $\cos(90^\circ) = 0, \sin(90^\circ) = 1 \implies (x', y') = (-y, x)$
  • $180^\circ$ Rotation ($\pi\text{ rad}$): $\cos(180^\circ) = -1, \sin(180^\circ) = 0 \implies (x', y') = (-x, -y)$ (point reflection)
  • $270^\circ$ Rotation ($3\pi/2\text{ rad}$ or $-90^\circ$ CW): $\cos(270^\circ) = 0, \sin(270^\circ) = -1 \implies (x', y') = (y, -x)$
  • $360^\circ$ Rotation ($2\pi\text{ rad}$): $\cos(360^\circ) = 1, \sin(360^\circ) = 0 \implies (x', y') = (x, y)$ (identity)

Step-by-Step Example Calculation

Rotate the point $P(3, 4)$ by $\theta = 60^\circ$ counterclockwise around the origin $(0, 0)$:

  1. Evaluate trigonometric functions: $$\cos(60^\circ) = 0.5, \quad \sin(60^\circ) = \frac{\sqrt{3}}{2} \approx 0.8660$$
  2. Calculate the new x-coordinate: $$x' = 3(0.5) - 4(0.8660) = 1.5 - 3.4641 = -1.9641$$
  3. Calculate the new y-coordinate: $$y' = 3(0.8660) + 4(0.5) = 2.5981 + 2.0 = 4.5981$$
  4. Result: The rotated coordinates are approximately $(-1.9641, 4.5981)$. The distance from the origin remains unchanged: $\sqrt{(-1.9641)^2 + 4.5981^2} = \sqrt{25} = 5$.

Related Coordinate Geometry Tools

Explore other mathematical vector and geometry tools on OnlineMiniTools:

Frequently Asked Questions

Why is counterclockwise rotation considered positive?

In standard Cartesian coordinates, angles are measured counterclockwise from the positive x-axis toward the positive y-axis according to the right-hand rule. This convention aligns with trigonometric definitions on the unit circle.

Does 2D rotation alter the distance between points?

No. Rotation is an orthogonal isometry. The distance of any point to the pivot center ($r = \sqrt{\Delta x^2 + \Delta y^2}$) and the Euclidean distance between any pair of points remain exactly invariant after rotation.

How do I perform a clockwise rotation using the formula?

A clockwise rotation by angle $\theta$ is equivalent to a counterclockwise rotation by $-\theta$. Using the identities $\cos(-\theta) = \cos(\theta)$ and $\sin(-\theta) = -\sin(\theta)$, the clockwise rotation formula becomes $x' = x \cos\theta + y \sin\theta$ and $y' = -x \sin\theta + y \cos\theta$.

What is the determinant of a 2D rotation matrix?

The determinant is $\det(R) = \cos^2\theta - (-\sin\theta)(\sin\theta) = \cos^2\theta + \sin^2\theta = 1$. A determinant of $+1$ indicates that the transformation preserves orientation (no reflection) and area.