Starlight Tools

2D Rotation Matrix Calculator

Generate a 2×2 rotation matrix from an angle. Optionally apply it to one or many points around the origin or a custom center.

Calculator

Choose a task
Angle unit
Positive = counter-clockwise; negative = clockwise.
Display rounding only, from 0 to 10.

Convention: active rotations, column vectors, and a standard y-up Cartesian plane. Positive signed angles are counter-clockwise. On y-down screen coordinates, the same numbers can look reversed.

Result and detailed working

Plain-text result

          

Copy or export

Rotation plot

Your browser does not support canvas. The coordinate table below gives the same original, rotated, and pivot values.
Original point (circle) Rotated point (diamond) Pivot (ring and cross)

The numbered grid uses mathematical y-up coordinates. In “Rotate one point” mode, drag the original point or pivot to explore.

Text equivalent of plotted coordinates
ItemOriginal (x, y)Rotated (x′, y′)

Advertisement

How to use the calculator

1. Choose the task

Generate a matrix, rotate one point, rotate pasted points, or analyze a matrix. Point and center fields appear only when the selected task needs them.

2. Enter a signed angle

Choose degrees or radians. Enter a positive value for counter-clockwise or a negative value for clockwise. Results update as inputs change.

3. Check the working

Review the conversion, sine and cosine, matrix multiplication, coordinate substitution, final coordinates, determinant, and orthogonality check.

4. Copy the format you need

Export numeric or symbolic matrices, coordinates, CSV, JSON, JavaScript, Python, or LaTeX. Calculations stay in your browser.

Formula and conventions

R(θ)=[cosθsinθsinθcosθ]

For the column vector p=[xy], an active rotation about the origin is p=Rp. This page uses column vectors and y-up Cartesian coordinates. For row vectors, use p=pRT.

Rotation around a center

For pivot c=(cx,cy), subtract, rotate, and add:

p=R(θ)(pc)+c

Worked examples

90° CCW: (3,1)(1,3) because the rule is (x,y)(y,x).

45° clockwise: enter −45°. The matrix is 12[1111].

Common mistakes

  • Mixing degrees with functions that expect radians. Convert with θrad=θdeg×π180.
  • Using a positive angle for clockwise motion. Under this calculator’s convention, clockwise angles are negative.
  • Rotating around the origin when the problem gives another pivot. Use subtract–rotate–add.
  • Using the column-vector matrix unchanged with row vectors. Row vectors multiply by the transpose on the right.
  • Judging direction from a y-down screen without converting the coordinate convention.

Applications

Rotation matrices are used in analytic geometry, robotics, CAD, games, image transforms, navigation, computer graphics, and any workflow that must rotate coordinates without changing lengths or angles.

Common-angle rotation cheat sheet

All rules below are active, counter-clockwise rotations using column vectors.

Anglecos θsin θExact matrix R(θ)Coordinate rule
10[[1, 0], [0, 1]](x, y) → (x, y)
30°√3/21/2[[√3/2, −1/2], [1/2, √3/2]](x√3/2 − y/2, x/2 + y√3/2)
45°√2/2√2/2[[√2/2, −√2/2], [√2/2, √2/2]]((x−y)/√2, (x+y)/√2)
60°1/2√3/2[[1/2, −√3/2], [√3/2, 1/2]](x/2 − y√3/2, x√3/2 + y/2)
90°01[[0, −1], [1, 0]](x, y) → (−y, x)
180°−10[[−1, 0], [0, −1]](x, y) → (−x, −y)
270°0−1[[0, 1], [−1, 0]](x, y) → (y, −x)
360°10[[1, 0], [0, 1]](x, y) → (x, y)

Methodology and verification

This calculator evaluates JavaScript’s IEEE 754 double-precision Math.sin, Math.cos, and Math.atan2 functions. It keeps full floating-point precision during calculation and rounds only displayed/exported values to the chosen 0–10 decimal places. Angles must be finite numbers; batch rotation accepts at most 500 nonblank rows.

Generated matrices are checked with det(R) and the maximum entry error in RᵀR − I. Matrix analysis accepts a proper rotation when both determinant and orthogonality are within 10−6. The formulas follow the standard trigonometric definitions summarized by the NIST Digital Library of Mathematical Functions and standard rotation-matrix conventions documented by Wolfram MathWorld.

Author and technical review: Starlight Robotics engineering teamLast reviewed: 16 July 2026

Frequently asked questions

What is the difference between clockwise and counter-clockwise rotation matrices?

With active rotations and column vectors on a standard y-up plane, positive angles rotate counter-clockwise. A clockwise rotation uses the negative angle, so R(−θ) is the transpose and inverse of R(θ).

Should I use degrees or radians?

Use whichever unit your problem gives. The calculator converts degrees to radians with θ radians = θ degrees × π/180 before evaluating sine and cosine.

How do I rotate around a pivot instead of the origin?

For pivot c, subtract the pivot, rotate, and add it back: p′ = R(θ)(p − c) + c. The calculator also shows the equivalent 3×3 homogeneous matrix.

Why is the inverse of a rotation matrix its transpose?

A proper rotation matrix is orthogonal, so RᵀR = I. Therefore R⁻¹ = Rᵀ = R(−θ).

What is an active rotation versus a passive rotation?

An active rotation turns the point while keeping the coordinate axes fixed. A passive rotation changes the coordinate axes instead and uses the inverse matrix for the same stated angle. This calculator uses active rotations.

Does the formula change for row vectors?

Yes. This calculator uses column vectors with p′ = Rp. If points are row vectors, multiply on the right by Rᵀ: p′ = pRᵀ.

Why can rotation look reversed on a computer screen?

Many screen coordinate systems increase y downward. The calculator uses the mathematical y-up Cartesian plane, so a positive angle is counter-clockwise; mapping it directly to y-down screen coordinates can reverse the apparent direction.

What batch point format is accepted?

Enter one point per line as x,y or x y. Blank lines are ignored. Invalid lines are identified by line number, while valid rows remain available after the warning.

How is a 2D rotation matrix different from a 3D rotation matrix?

A 2D rotation uses one angle and a 2×2 matrix. A general 3D rotation uses a 3×3 matrix and needs an axis plus an angle, Euler angles, or another representation such as a quaternion.

Explore more tools