vectors.py 文件源码

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

项目:wafer 作者: hariedo 项目源码 文件源码
def rotation(self):
        '''Extracts Euler angles of rotation from this matrix.
        This attempts to find alternate rotations in case of gimbal lock,
        but all of the usual problems with Euler angles apply here.
        All Euler angles are in radians.
        '''
        (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) = self._v
        rotY = D = math.asin(c)
        C = math.cos(rotY)
        if (abs(C) > 0.005):
            trX = k/C ; trY = -g/C ; rotX = math.atan2(trY, trX)
            trX = a/C ; trY = -b/C ; rotZ = math.atan2(trY, trX)
        else:
            rotX = 0
            trX = f ; trY = e ; rotZ = math.atan2(trY, trX)
        return V(rotX,rotY,rotZ)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号