pyCGM_Single.pycgmStatic.rotmat

pyCGM_Single.pycgmStatic.rotmat(x=0, y=0, z=0)

Rotation Matrix function

This function creates and returns a rotation matrix.

Parameters
x,y,zfloat, optional

Angle, which will be converted to radians, in each respective axis to describe the rotations. The default is 0 for each unspecified angle.

Returns
Rxyzarray

The product of the matrix multiplication.

Examples

>>> import numpy as np
>>> from .pycgmStatic import rotmat
>>> rotmat() 
[[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]
>>> x = 0.5
>>> y = 0.3
>>> z = 0.8
>>> np.around(rotmat(x,y,z), 2)
array([[ 1.  , -0.01,  0.01],
       [ 0.01,  1.  , -0.01],
       [-0.01,  0.01,  1.  ]])
>>> x = 0.5
>>> np.around(rotmat(x), 2)
array([[ 1.  ,  0.  ,  0.  ],
       [ 0.  ,  1.  , -0.01],
       [ 0.  ,  0.01,  1.  ]])
>>> x = 1
>>> y = 1
>>> np.around(rotmat(x,y), 2)
array([[ 1.  ,  0.  ,  0.02],
       [ 0.  ,  1.  , -0.02],
       [-0.02,  0.02,  1.  ]])