c4dynamics.rotmat.rotmat.rotx#
- c4dynamics.rotmat.rotmat.rotx(phi)[source]#
Generate a 3x3 Direction Cosine Matrix for a positive rotation about the x-axis by an angle \(\phi\) in radians.
A right-hand rotation matrix about x is given by:
\[\begin{split}R = \begin{bmatrix} 1 & 0 & 0 \\ 0 & cos(\varphi) & sin(\varphi) \\ 0 & -sin(\varphi) & cos(\varphi) \end{bmatrix}\end{split}\]- Parameters:
phi (float or int) – The angle of rotation in radians.
- Returns:
out (numpy.array) – A 3x3 rotation matrix representing the rotation about the x-axis.
Examples
>>> rotx(0) [[1 0 0] [0 1 0] [0 0 1]]
>>> rotx(c4d.pi / 2) [[1 0 0] [0 0 1] [0 -1 0]]
>>> v1 = [0, 0, 1] >>> phi = 90 * c4d.d2r >>> rotx(phi) @ v1 [0 1 0]
>>> phi = 45 * c4d.d2r >>> rotx(phi) @ v1 [0 0.707 0.707]