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