Spin with cos & sin
The whole rotation lives in two friends: cos θ and sin θ. Swap signs and you flip between clockwise and counter-clockwise.
CCW rotation by θ uses
R(θ) = [[cos θ, −sin θ],[sin θ, cos θ]].
Rotating about a center c: p' = R(θ)(p − c) + c. Clockwise uses −θ.
The canvas shows original point(s) (gray), rotation center c (crosshair), and rotated point(s) (blue). If you enter a single point, the red arrow shows the displacement from original to rotated.
A counter-clockwise rotation by angle θ uses the matrix
R(θ) = \[\[ \cos θ,\; -\sin θ\],\; [\sin θ,\; \cos θ]\].
To rotate a point p = ⟨x,y⟩ about the origin, compute p' = R(θ)\,p.
To rotate about a center c = ⟨cₓ,cᵧ⟩, translate to the origin, rotate, then translate back:
p' = R(θ)(p − c) + c.
Clockwise rotation is the same as using −θ. In degrees, convert to radians with
θᵣ = θ·π/180. This tool accepts degrees or radians, handles clockwise/CCW, and lets you paste
a list of points for batch rotation—handy for geometry, robotics, or simple SVG/prototyping workflows.
The whole rotation lives in two friends: cos θ and sin θ. Swap signs and you flip between clockwise and counter-clockwise.
Rotation matrices never squish or stretch. They keep lengths and angles exactly the same—just spun around.
Undo a rotation by using the transpose (or the negative angle). R(θ)ᵀ = R(−θ) is the instant rewind button.
The columns of R(θ) literally show where the x-axis and y-axis arrows moved. They’re just the spun axes.
Rotate by 20°, then 30°? The matrices multiply, but the angles just add to 50°. Rotations stack like simple sums.
A 2D rotation is a linear transformation that turns every point in the plane by an angle
θ about a chosen center. In standard counter-clockwise (CCW) orientation, the
rotation matrix is
R(θ) = [[cos θ, −sin θ],[sin θ, cos θ]]. If you supply a point
p = ⟨x, y⟩ as a column vector and rotate about the origin, the rotated point is
p' = R(θ) p. Rotating about an arbitrary center
c = ⟨cₓ, cᵧ⟩ uses a translate-rotate-translate sequence:
p' = R(θ)(p − c) + c.
Most formulas are defined in radians. Convert degrees with
θᵣ = θ·π/180. Our calculator accepts both units and handles clockwise (CW)
by simply negating the angle: CW(θ) ≡ CCW(−θ). This is equivalent to
R(−θ) = R(θ)ᵀ, which is also the inverse of R(θ).
The first column of R(θ) is where the unit vector along +x (⟨1,0⟩) ends up after
rotation: ⟨cos θ, sin θ⟩. The second column is where +y (⟨0,1⟩) ends up:
⟨−sin θ, cos θ⟩. Because the columns are orthonormal, R(θ) is
orthogonal: R(θ)ᵀ R(θ) = I, det R(θ) = 1, and
R(θ)^{-1} = R(θ)ᵀ = R(−θ).
A key property is angle additivity:
R(α) R(β) = R(α + β). That means you can chain multiple rotations in any order and
replace them with a single rotation whose angle is the sum of the angles. Numerically, if you
apply many tiny rotations, floating-point rounding can drift the matrix away from being perfectly
orthogonal. A quick fix is to recompute cos/sin from an accumulated
angle rather than repeatedly multiplying matrices, or to re-orthogonalize using the transpose.
If you have a list of points, stack them as columns in a 2×n matrix P and compute
P' = R(θ) P. Rotating about a center c becomes
P' = R(θ)(P − c·1ᵀ) + c·1ᵀ, where 1 is a vector of ones. In graphics
and robotics, a homogeneous 3×3 matrix is often used to bundle translation and rotation:
T = [[cos θ, −sin θ, tₓ],[sin θ, cos θ, tᵧ],[0,0,1]] with
[tₓ, tᵧ]ᵀ = c − R(θ)c. Then apply [x',y',1]ᵀ = T [x,y,1]ᵀ.
sin/cos that expect radians.c.
Rotate p = ⟨3, 1⟩ by θ = 30° CCW about the origin.
cos 30° = √3/2 ≈ 0.8660, sin 30° = 0.5.
Then p' = ⟨3·0.8660 − 1·0.5, 3·0.5 + 1·0.8660⟩ ≈ ⟨2.098, 2.366⟩.
About a center c = ⟨1,−2⟩, compute p − c = ⟨2, 3⟩,
rotate to ⟨2·0.8660 − 3·0.5, 2·0.5 + 3·0.8660⟩ ≈ ⟨0.232, 3.098⟩, then add back
c to get p' ≈ ⟨1.232, 1.098⟩.
Summary: use R(θ) for CCW, −θ for CW, and wrap any non-origin center
with translate-rotate-translate. Our calculator handles all of this for single points or batches,
entirely in your browser.