Love Work Family Friends Games Kids Life

Posted by 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)]] )

Leave a Reply

Name and Mail are optional. Your email address is however required if you want to subscribe to the comments (see below)

This site uses User Verification plugin to reduce spam. See how your comment data is processed.

This site uses Akismet to reduce spam. Learn how your comment data is processed.