In 3D space, rotation matrices are used to rotate points or objects around one of the coordinate axes (x, y, or z). Each of these is a 3×3 orthogonal matrix with determinant = 1. Here are the standard rotation matrices for counterclockwise rotation:
We’ll assume:
α = rotation about the X-axis
β = rotation about the Y-axis
γ = rotation about the Z-axis
1. Rotation about the X-axis (by α):
Rotates around the x-axis, affecting the y and z coordinates:
Rx(α)=1000cosαsinα0−sinαcosα
Rotation about the Y-axis (by β):
Rotates around the y-axis, affecting the x and z coordinates:
Ry(β)=cosβ0−sinβ010sinβ0cosβ
3. Rotation about the Z-axis (by γ):
Rotates around the z-axis, affecting the x and y coordinates:
Rz(γ)=cosγsinγ0−sinγcosγ0001
Combining Rotations
To rotate around multiple axes, you can multiply the corresponding rotation matrices together:
R=Rz(γ)⋅Ry(β)⋅Rx(α)
Where α, β, and γ are the rotation angles about x, y, and z axes, respectively. The order matters — matrix multiplication is not commutative.
Assuming we rotate in the order X → Y → Z (i.e. R = Rz * Ry * Rx), the full rotation matrix is: