api.py 文件源码

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

项目:pyculib 作者: numba 项目源码 文件源码
def rotg(self, a, b):
        '''Compute the given rotation matrix given a column vector (a, b).
        Returns r, z, c, s.

        r: r = a ** 2 + b ** 2.

        z: Use to recover c and s.

        if abs(z) < 1:
            c, s = 1 - z ** 2, z
        elif abs(z) == 1:
            c, s = 0, 1
        else:
            c, s = 1 / z, 1 - z ** 2

        c: Cosine element of the rotation matrix.

        s: Sine element of the rotation matrix.
        '''
        a, b = np.asarray(a), np.asarray(b)
        _sentry_same_dtype(a, b)
        fn = self._dispatch(self.rotg.vtable, a.dtype)
        return fn(np.asscalar(a), np.asscalar(b))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号