Rotations are used in geometry transformations, computer graphics, robotics and surveying. A positive angle turns counter-clockwise; a negative angle turns clockwise.
How to use the Rotation Calculator
- Angle of rotation θ (counter-clockwise)
- Pivot – x₀
- Pivot – y₀
- Number of points
- Point 1 – x
- Point 1 – y
- Point 2 – x
- Point 2 – y
- Point 3 – x
- Point 3 – y
- Point 4 – x
- Point 4 – y
Results update as you type, and everything is calculated in your browser.
How it works
Each point is moved so the pivot is at the origin, rotated with the rotation matrix and moved back.
Inputs explained
| Field | What to enter |
|---|---|
| Angle of rotation θ (counter-clockwise) | Units: °, rad, π rad, grad, turn |
| Pivot – x₀ | A number |
| Pivot – y₀ | A number |
| Number of points | Choose one: 1, 2, 3, 4 |
| Point 1 – x | A number |
| Point 1 – y | A number |
| Point 2 – x | A number |
| Point 2 – y | A number |
| Point 3 – x | A number |
| Point 3 – y | A number |
| Point 4 – x | A number |
| Point 4 – y | A number |
What each result means
- Point 1 – x’ = [Pivot – x₀] + ([Point 1 – x] – [Pivot – x₀])×cos(rad([Angle of rotation θ (counter-clockwise)])) – ([Point 1 – y] – [Pivot – y₀])×sin(rad([Angle of rotation θ (counter-clockwise)]))
- Point 1 – y’ = [Pivot – y₀] + ([Point 1 – x] – [Pivot – x₀])×sin(rad([Angle of rotation θ (counter-clockwise)])) + ([Point 1 – y] – [Pivot – y₀])×cos(rad([Angle of rotation θ (counter-clockwise)]))
- Point 2 – x’ = [Pivot – x₀] + ([Point 2 – x] – [Pivot – x₀])×cos(rad([Angle of rotation θ (counter-clockwise)])) – ([Point 2 – y] – [Pivot – y₀])×sin(rad([Angle of rotation θ (counter-clockwise)]))
- Point 2 – y’ = [Pivot – y₀] + ([Point 2 – x] – [Pivot – x₀])×sin(rad([Angle of rotation θ (counter-clockwise)])) + ([Point 2 – y] – [Pivot – y₀])×cos(rad([Angle of rotation θ (counter-clockwise)]))
- Point 3 – x’ = [Pivot – x₀] + ([Point 3 – x] – [Pivot – x₀])×cos(rad([Angle of rotation θ (counter-clockwise)])) – ([Point 3 – y] – [Pivot – y₀])×sin(rad([Angle of rotation θ (counter-clockwise)]))
- Point 3 – y’ = [Pivot – y₀] + ([Point 3 – x] – [Pivot – x₀])×sin(rad([Angle of rotation θ (counter-clockwise)])) + ([Point 3 – y] – [Pivot – y₀])×cos(rad([Angle of rotation θ (counter-clockwise)]))
- Point 4 – x’ = [Pivot – x₀] + ([Point 4 – x] – [Pivot – x₀])×cos(rad([Angle of rotation θ (counter-clockwise)])) – ([Point 4 – y] – [Pivot – y₀])×sin(rad([Angle of rotation θ (counter-clockwise)]))
- Point 4 – y’ = [Pivot – y₀] + ([Point 4 – x] – [Pivot – x₀])×sin(rad([Angle of rotation θ (counter-clockwise)])) + ([Point 4 – y] – [Pivot – y₀])×cos(rad([Angle of rotation θ (counter-clockwise)]))
Example values
How the main result changes when Angle of rotation θ changes and everything else stays at the example values above:
| Angle of rotation θ (counter-clockwise) (°) | Point 1 – x’ |
|---|---|
| 45 | 1.4142 |
| 67.5 | 0.2242 |
| 90 | -1 |
| 112.5 | -2.0719 |
| 135 | -2.8284 |
| 180 | -3 |
Formula
x′ = x₀ + (x − x₀)cos θ − (y − y₀)sin θ
y′ = y₀ + (x − x₀)sin θ + (y − y₀)cos θ
Worked example
Inputs — Angle of rotation θ (counter-clockwise): 90 °; Pivot – x₀: 0; Pivot – y₀: 0; Number of points: 2; Point 1 – x: 3; Point 1 – y: 1; Point 2 – x: 5; Point 2 – y: 4.
Results — Point 1 – x' = -1; Point 1 – y' = 3; Point 2 – x' = -4; Point 2 – y' = 5.
Key terms
- Rotation matrix
- [[cos θ, −sin θ], [sin θ, cos θ]].
Frequently asked questions
Which way is a positive rotation?
Counter-clockwise.
What does a 90° rotation do to (x, y)?
It maps it to (−y, x) about the origin.
What about 180°?
(x, y) → (−x, −y).
Does rotation change distances?
No – rotations preserve lengths and angles.