math_utils.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:amcparser 作者: VanushVaswani 项目源码 文件源码
def rotation_matrix(bone, tx, ty, tz):
    # Construct rotation matrix M
    tx = np.deg2rad(tx)
    ty = np.deg2rad(ty)
    tz = np.deg2rad(tz)

    Mx = np.matrix([[1, 0, 0],
                    [0, np.cos(tx), np.sin(tx)],
                    [0, -np.sin(tx), np.cos(tx)]])

    My = np.matrix([[np.cos(ty), 0, -np.sin(ty)],
                    [0, 1, 0],
                    [np.sin(ty), 0, np.cos(ty)]])

    Mz = np.matrix([[np.cos(tz), np.sin(tz), 0],
                    [-np.sin(tz), np.cos(tz), 0],
                    [0, 0, 1]])
    M = Mx * My * Mz
    L = bone.Cinv * M * bone.C
    return L
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号