rot_y

giant.rotations:

giant.rotations.rot_y(theta)[source]

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

This rotation is defined as:

\[\begin{split}\mathbf{R}_y(\theta)=\left[\begin{array}{ccc} \text{cos}(\theta) & 0 & \text{sin}(\theta) \\ 0 & 1 & 0 \\ -\text{sin}(\theta) & 0 & \text{cos}(\theta) \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_y
>>> rot_y([2, 0.5])
array([[[-0.41614684,  0.        ,  0.90929743],
        [ 0.        ,  1.        ,  0.        ],
        [-0.90929743,  0.        , -0.41614684]],
       [[ 0.87758256,  0.        ,  0.47942554],
        [ 0.        ,  1.        ,  0.        ],
        [-0.47942554,  0.        ,  0.87758256]]])
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