Posted by Anonymous on 2021/10/07 under Work

# import the required packages

import numpy as np

import skinematics as skin

# Define a rotation about the x-axis by "alpha" …

Rs_rot = skin.rotmat.R_s('x','alpha')

# … and one about the z-axis by "theta"

Rs_trans = skin.rotmat.R_s('z', 'theta')

# Now "rotate the rotation", find the result

Rs_rot_transformed = ( Rs_trans * Rs_rot* Rs_trans.inv() ).subs('theta', np.pi/2)

Rs_rot_transformed

# Output:

#Matrix(

# [1.0*cos(alpha), -6.1e-17*cos(alpha) + 6.1e-17,1.0*sin(alpha)],

# [-6.1e-17*cos(alpha), 3.7e-33*cos(alpha) + 1.0,-6.1e-17*sin(alpha)],

# [-1.0*sin(alpha), 6.1e-17*sin(alpha),cos(alpha)]] )