rot_z

giant.rotations:

giant.rotations.rot_z(theta)[source]

This function performs a right handed rotation about the z axis by angle theta.

This rotation is defined as:

\[\begin{split}\mathbf{R}_z(\theta)=\left[\begin{array}{ccc} \text{cos}(\theta) & -\text{sin}(\theta) & 0 \\ \text{sin}(\theta) & \text{cos}(\theta) & 0 \\ 0 & 0 & 1 \end{array}\right]\end{split}\]

Theta should be in units of radians and can be a scalar or a vector. If theta is a vector then each theta value will have a corresponding rotation vector down the first axis of the output. For example:

>>> from giant.rotations import rot_z
>>> rot_z([2, 0.5])
array([[[-0.41614684, -0.90929743,  0.        ],
        [ 0.90929743, -0.41614684,  0.        ],
        [ 0.        ,  0.        ,  1.        ]],
       [[ 0.87758256, -0.47942554,  0.        ],
        [ 0.47942554,  0.87758256,  0.        ],
        [ 0.        ,  0.        ,  1.        ]]])
Parameters:

theta (Sequence | ndarray | Real) – The angles to form the rotation matrix(ces) for

Returns:

The rotation matrix(ces) corresponding to the rotation angle(s)

Return type:

ndarray