pyCGM_Single.pyCGM.rotmat¶
-
pyCGM_Single.pyCGM.
rotmat
(x=0, y=0, z=0)¶ Rotation Matrix.
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
- Rxyzlist
The product of the matrix multiplication.
Examples
>>> import numpy as np >>> from .pyCGM import rotmat >>> 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. ]])