Generate an exact and decimal 2×2 matrix, rotate points or vectors around any pivot, and find an angle from a matrix.
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 the angle and direction
Choose degrees or radians, enter a number or pi expression, then choose counter-clockwise, clockwise, or “Use entered sign.” Direction modes use the angle’s magnitude to prevent double negation.
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
For the column vector , an active rotation about the origin is . This page uses column vectors and y-up Cartesian coordinates. For row vectors, use .
Rotation around a center
For pivot , subtract, rotate, and add:
Worked solutions
1. Rotate (3, 1) by 90° counter-clockwise about the origin
Entered values: point (3, 1), pivot (0, 0), angle 90°, direction counter-clockwise.
Radians and trig: θ = 90 × π/180 = π/2 rad, so cos θ = 0 and sin θ = 1.
Matrix multiplication: R = [[0, −1], [1, 0]], so x′ = 0(3) − 1(1) = −1 and y′ = 1(3) + 0(1) = 3.
Answer: exact (−1, 3); decimal (−1.000000, 3.000000).
Geometric check: both points are √10 units from the origin, and the positive x-axis direction has advanced by 90°.
2. Rotate (2, 0) by 45° clockwise
Entered values: point (2, 0), pivot (0, 0), angle 45°, direction clockwise. The effective signed angle is −45°.
Radians and trig: θ = −45 × π/180 = −π/4 rad; cos θ = √2/2 and sin θ = −√2/2.
Matrix multiplication: R = [[√2/2, √2/2], [−√2/2, √2/2]]. Multiplying by [2, 0] gives [√2, −√2].
Answer: exact (√2, −√2); decimal (1.414214, −1.414214).
Geometric check: the radius remains 2 and the point moves from polar angle 0° to −45°, which is clockwise.
3. Rotate (3, 1) by 90° counter-clockwise around pivot (1, 2)
Entered values: point (3, 1), pivot (1, 2), angle 90°, direction counter-clockwise.
Radians and trig: θ = π/2 rad, cos θ = 0, sin θ = 1.
Translate: (3, 1) − (1, 2) = (2, −1). Rotate: (2, −1) becomes (1, 2). Translate back: (1, 2) + (1, 2) = (2, 4).
Answer: exact (2, 4); decimal (2.000000, 4.000000).
Geometric check: the original and final distances from the pivot are both √5, and the pivot itself does not move.
4. Find the angle from [[0, −1], [1, 0]]
The columns have unit length and are perpendicular, so RᵀR = I; det(R) = 0·0 − (−1·1) = 1. Therefore it is a proper rotation. θ = atan2(r21, r11) = atan2(1, 0) = π/2 = 90° counter-clockwise.
How to find an angle from a 2×2 matrix
A proper rotation matrix must satisfy RᵀR = I and det(R) = 1. When both checks pass, the signed angle is θ = atan2(r21, r11), with a principal result from −π to π. An orthogonal matrix with determinant −1 is a reflection, not a proper rotation.
If an entered matrix is not valid, “nearest rotation” means the proper rotation in SO(2) that minimizes the matrix’s Frobenius-distance error. For A = [[a, b], [c, d]], its angle is computed as atan2(c − b, a + d). This is a best-fit orientation; it does not make scaling, shear, reflection, or noisy input into an exact rotation.
Common mistakes
- Mixing degrees with functions that expect radians. Convert with .
- 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.
Methodology and verification
This calculator parses finite numeric expressions made from numbers, π or pi, parentheses, and +, −, ×, ÷ operators, then 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. 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.
Calculation-verification note: the Mathematics Desk checked the formula paths against exact 0°, 30°, 45°, 60°, 90°, 180°, and 270° fixtures; verified translate–rotate–translate pivot examples; and tested the determinant, orthogonality, radius-preservation, reflection, and nearest-rotation checks.
Author and technical reviewer: Starlight Tools Mathematics Desk — applied mathematics and computational verificationLast reviewed: 31 August 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.
How do I find the angle from a 2×2 rotation matrix?
For a valid proper rotation matrix R, use θ = atan2(r21, r11). The result gives the signed angle from −π to π. Check RᵀR = I and det(R) = 1 first; otherwise the calculator reports the nearest proper rotation instead.
How can I tell whether a 2×2 matrix is a proper rotation?
A proper 2D rotation must satisfy RᵀR = I and det(R) = 1 within numerical tolerance. An orthogonal matrix with determinant −1 is a reflection, not a proper rotation. A matrix that fails orthogonality also contains scaling, shear, or numerical noise.