transforms.py 文件源码

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

项目:robopy 作者: adityadua24 项目源码 文件源码
def roty(theta, unit="rad"):
    """
    ROTY Rotation about Y axis

    :param theta: angle for rotation matrix
    :param unit: unit of input passed. 'rad' or 'deg'
    :return: rotation matrix

    roty(THETA) is an SO(3) rotation matrix (3x3) representing a rotation
    of THETA radians about the y-axis
    roty(THETA, "deg") as above but THETA is in degrees
    """
    check_args.unit_check(unit)
    if unit == "deg":
        theta = theta * math.pi / 180
    ct = math.cos(theta)
    st = math.sin(theta)
    mat = np.matrix([[ct, 0, st], [0, 1, 0], [-st, 0, ct]])
    mat = np.asmatrix(mat.round(15))
    return mat


# ---------------------------------------------------------------------------------------#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号