當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。