当前位置: 首页>>代码示例>>Python>>正文


Python ma.arctan2方法代码示例

本文整理汇总了Python中numpy.ma.arctan2方法的典型用法代码示例。如果您正苦于以下问题:Python ma.arctan2方法的具体用法?Python ma.arctan2怎么用?Python ma.arctan2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在numpy.ma的用法示例。


在下文中一共展示了ma.arctan2方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _angles_lengths

# 需要导入模块: from numpy import ma [as 别名]
# 或者: from numpy.ma import arctan2 [as 别名]
def _angles_lengths(self, U, V, eps=1):
        xy = self.ax.transData.transform(self.XY)
        uv = np.hstack((U[:, np.newaxis], V[:, np.newaxis]))
        xyp = self.ax.transData.transform(self.XY + eps * uv)
        dxy = xyp - xy
        angles = np.arctan2(dxy[:, 1], dxy[:, 0])
        lengths = np.absolute(dxy[:, 0] + dxy[:, 1] * 1j) / eps
        return angles, lengths 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:10,代码来源:quiver.py

示例2: _angles_lengths

# 需要导入模块: from numpy import ma [as 别名]
# 或者: from numpy.ma import arctan2 [as 别名]
def _angles_lengths(self, U, V, eps=1):
        xy = self.ax.transData.transform(self.XY)
        uv = np.column_stack((U, V))
        xyp = self.ax.transData.transform(self.XY + eps * uv)
        dxy = xyp - xy
        angles = np.arctan2(dxy[:, 1], dxy[:, 0])
        lengths = np.hypot(*dxy.T) / eps
        return angles, lengths 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:10,代码来源:quiver.py

示例3: cart2polar

# 需要导入模块: from numpy import ma [as 别名]
# 或者: from numpy.ma import arctan2 [as 别名]
def cart2polar(x, y, degrees=True):
    """
    Convert cartesian X and Y to polar RHO and THETA.
    :param x: x cartesian coordinate
    :param y: y cartesian coordinate
    :param degrees: True = return theta in degrees, False = return theta in
        radians. [default: True]
    :return: r, theta
    """
    rho = ma.sqrt(x ** 2 + y ** 2)
    theta = ma.arctan2(y, x)
    if degrees:
        theta *= (180 / math.pi)

    return rho, theta 
开发者ID:aws-samples,项目名称:aws-greengrass-mini-fulfillment,代码行数:17,代码来源:stages.py

示例4: _compare

# 需要导入模块: from numpy import ma [as 别名]
# 或者: from numpy.ma import arctan2 [as 别名]
def _compare(self):
            dy, dx = compare_slices(self._i, self._rng, operator=angle_diff)

            self._derts[1:][central_slice(self._rng)] += np.concatenate((dy, dx))
            self._derts[0] = ma.hypot(
                ma.arctan2(*self.dy),
                ma.arctan2(*self.dx),
            )

            self._derts[rim_mask(self._i.shape, rng)] = ma.masked
            return self


    # -----------------------------------------------------------------------------
    # Functions 
开发者ID:boris-kz,项目名称:CogAlg,代码行数:17,代码来源:testing.py

示例5: _angles_lengths

# 需要导入模块: from numpy import ma [as 别名]
# 或者: from numpy.ma import arctan2 [as 别名]
def _angles_lengths(self, U, V, eps=1):
        xy = self.ax.transData.transform(self.XY)
        uv = np.hstack((U[:, np.newaxis], V[:, np.newaxis]))
        xyp = self.ax.transData.transform(self.XY + eps * uv)
        dxy = xyp - xy
        angles = np.arctan2(dxy[:, 1], dxy[:, 0])
        lengths = np.hypot(*dxy.T) / eps
        return angles, lengths 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:10,代码来源:quiver.py


注:本文中的numpy.ma.arctan2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。