Rz¶
-
sknano.core.math.
Rz
(angle, degrees=False)[source] [edit on github][source]¶ Generate the 3×3 rotation matrix Rz(θ) for a rotation about the z axis by an angle θ.
Rz=(cosθ−sinθ0sinθcosθ0001)Parameters: Returns: 3×3 rotation matrix Rz(θ) for a rotation about the z axis by an angle θ.
Return type: Examples
>>> import numpy as np >>> from sknano.core.math import Rz >>> Rz(np.pi/4) array([[ 0.70710678, -0.70710678, 0. ], [ 0.70710678, 0.70710678, 0. ], [ 0. , 0. , 1. ]]) >>> np.alltrue(Rz(np.pi/4) == Rz(45, degrees=True)) True