quaternion.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def from_angle_axis(cls, theta, axis):
        """ Construct Quaternion from axis-angle representation """
        x, y, z = axis
        norm = math.sqrt(x*x + y*y + z*z)
        if 0 == norm:
            return cls([0, 0, 0, 1])
        t = math.sin(theta/2) / norm;
        return cls([x*t, y*t, z*t, math.cos(theta/2)])

    # Properties
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号