Learn
Apply a geometric rotation around the origin to a point (x, y) using the 2D rotation matrix.
A 2D rotation around the origin by angle θ is a linear transformation given by the rotation matrix R_θ = [[cos θ, −sin θ], [sin θ, cos θ]]. Applying R_θ to a column vector (x, y) produces (x cos θ − y sin θ, x sin θ + y cos θ). The transformation preserves distances from the origin and the angle between any two vectors. For multiples of 90°, the formulas simplify drastically: 90° sends (x, y) → (−y, x), 180° sends (x, y) → (−x, −y), 270° sends (x, y) → (y, −x).
R_θ · (x, y) = (x cos θ − y sin θ, x sin θ + y cos θ)
- Rotate (3, 0) by 90° → (0, 3)
- Rotate (1, 2) by 180° → (−1, −2)
- Rotate (4, 0) by 270° → (0, −4)
How to recognize it
- The task asks for a new point after rotating around the origin by a given angle
- The rotation angle is usually a multiple of 90°, making the arithmetic exact
- Distance from the origin is unchanged — check √(x² + y²)
Common mistakes
- Applying the formulas for clockwise rotation when the task asks counterclockwise (or vice versa)
- Swapping x and y without the sign change
- Forgetting that the rotation is around the origin — translating first can change the answer