Matrix Z-Axis Rotation 4×4
Calculator for rotating around the Z-axis
Z-Axis Rotation Calculator
Instructions
Enter the rotation angle for rotation around the Z-axis. Choose between active (rotate object) or passive (rotate coordinates) rotation.
Z-Axis Rotation - Overview
What is Z-Axis Rotation?
Z-axis rotation (Yaw/Roll) rotates points around the Z-axis (depth axis). The X and Y coordinates change while Z remains constant.
Active Rotation Formula
Counterclockwise rotation (right-hand rule):
Example: 90° Rotation
Key Properties
- Z-coordinate: Remains unchanged
- X and Y: Rotate in XY-plane
- Active rotation: Counterclockwise (geometric transformation)
- Passive rotation: Clockwise (coordinate system rotation)
- Orthogonal matrix: RT = R-1
|
Description of Z-Axis Rotation
Fundamentals
The matrix rotation distinguishes between active and passive rotation. Both are important in different contexts of 3D graphics and engineering.
Active Rotation
With active rotation, the vector or the object is rotated in the coordinate system. The active rotation is also called a geometric transformation. The rotation is counterclockwise.
Example of a 90° rotation around the Z-axis:
Matrix Structure
The Z-axis rotation matrix has a special structure:
- Third row/column: [0, 0, 1, 0] - Z unchanged
- 2×2 submatrix: Classic 2D rotation in XY-plane
- Last row/column: [0, 0, 0, 1] - Homogeneous coordinate
- Determinant: det(R) = 1 (preserves volume)
- Most intuitive: Like rotating on a turntable
Passive Rotation
With passive rotation, the coordinate system is rotated. The vector remains unchanged. The rotation is clockwise.
Example of a 90° rotation around the Z-axis:
Relationship
Active vs Passive
The passive rotation matrix is the inverse (transpose) of the active rotation matrix:
\(R_z^{passive}(\theta) = R_z^{active}(-\theta) = R_z^{active}(\theta)^T\)
Practical Applications
3D Graphics & Gaming:
- Yaw rotation: Character turning left/right
- Compass heading: Navigation direction
- Top-down view: 2D games, strategy games
- Turntable rotation: Product showcase
Engineering & Robotics:
- Azimuth angle: Horizontal direction
- Turret rotation: Tank or robot base
- GPS bearing: Navigation systems
- Radar sweep: Scanning rotation
Right-Hand Rule for Z-Axis
Active Rotation (Counterclockwise):
- Point your right thumb along the positive Z-axis (toward you)
- Curl your fingers naturally
- Your fingers curl from +X toward +Y
- This is the positive rotation direction
Effect on Coordinates:
- Z-coordinate: Always unchanged
- +X axis (1,0,0): Rotates toward +Y
- +Y axis (0,1,0): Rotates toward -X
- 90° rotation: X→Y, Y→-X
Z-Axis Special Properties
Classic 2D Rotation:
- Upper-left 2×2: Standard 2D rotation matrix
- Most intuitive: Like rotating paper on desk
- XY-plane rotation: Horizontal plane
- Simplest to visualize: Top-down view
Common Usage:
- 2D games: Character facing direction
- Maps: North/heading rotation
- Compass: Direction angle
- Turntables: Spinning platforms
Mathematical Properties
Rotation Matrix Properties:
- Orthogonal: RTR = I
- Inverse: R-1 = RT
- Determinant: det(R) = 1
- Preserves length: ||Rv|| = ||v||
- Preserves angles: (Rv)·(Rw) = v·w
Combination Rules:
- Sequential Z-rotations: Rz(θ₂)Rz(θ₁) = Rz(θ₁+θ₂)
- Commutative (same axis): Rz(θ₁)Rz(θ₂) = Rz(θ₂)Rz(θ₁)
- Identity: Rz(0) = I
- Full rotation: Rz(360°) = I
Important Notes
- Z-axis rotations commute: Multiple Z-axis rotations can be combined by simply adding the angles: Rz(30°)·Rz(45°) = Rz(75°)
- NOT commutative with other axes: Rz·Rx ≠ Rx·Rz. The order of rotations around different axes matters!
- 2D connection: Z-axis rotation in 3D is exactly the same as 2D rotation in the XY-plane. The 4×4 matrix is just the 2×2 rotation embedded with identity elements.
- Screen coordinates: In many graphics systems, Z points out of the screen, making Z-rotation perfect for rotating 2D sprites or UI elements.
Z-Rotation in Euler Angles (Yaw/Roll)
The Z-axis rotation is the Yaw (or Roll) component in Euler angles, depending on convention:
As Yaw (heading):
- Compass direction
- Turn left/right
- Azimuth angle
- 0° to 360°
As Roll (bank):
- Rotation around forward axis
- Tilt in top-down view
- 2D rotation angle
- Range: ±180°
Characteristics:
- Horizontal plane rotation
- Most stable (no gimbal lock)
- Simplest to understand
- Full 360° range usable
Comparison: X, Y, Z Rotations
X-Axis (Roll):
- Rotation in YZ-plane
- Bank angle (tilt left/right)
- X remains constant
- Y and Z change
Y-Axis (Pitch):
- Rotation in XZ-plane
- Elevation angle (nose up/down)
- Y remains constant
- X and Z change
Z-Axis (Yaw):
- Rotation in XY-plane
- Heading angle (turn left/right)
- Z remains constant
- X and Y change
Connection to 2D Rotation
The Z-axis rotation in 3D is a direct extension of 2D rotation. The 4×4 matrix has this structure:
Top-left 2×2 block:
- Standard 2D rotation matrix
- Operates on X and Y coordinates
- Same formula as 2D graphics
- cos θ and -sin θ pattern
Rest of matrix:
- Third row/column: [0, 0, 1, 0]
- Fourth row/column: [0, 0, 0, 1]
- Identity elements for Z
- Homogeneous coordinate preserved