Z-axis rotation calculator

Rotated point

Rotation matrix

Positive angles rotate counter-clockwise when the Z axis points toward the viewer (the standard right-hand-rule convention). x and y rotate; z is unchanged, which is why the same matrix serves both a 2D rotation and a 3D yaw.


What it computes

Given a point (x, y) or (x, y, z) and an angle, this applies the standard rotation-around-the-Z-axis matrix and returns the new coordinates. In 2D this is simply "rotate this point"; in 3D, rotation around Z is also called yaw, and x and y are rotated exactly as in the 2D case while z is left unchanged - which is why the same matrix does both jobs.

The matrix itself

x' = x·cos(θ) - y·sin(θ)
y' = x·sin(θ) + y·cos(θ)
z' = z

The full 3x3 matrix is shown alongside the result, not just the answer, so it can be checked by hand or dropped straight into code.

Direction of rotation and units

Positive angles rotate counter-clockwise when the Z axis points toward the viewer, following the standard right-hand-rule convention used in mathematics and most graphics libraries - some game engines and CAD tools use the opposite convention, which is worth checking against if a result comes out mirrored from what a specific tool expects. Degrees and radians are both accepted.

Related tools

See the quaternion calculator for rotations that need to be composed or interpolated rather than applied once.