本文整理匯總了Python中numpy.core.umath.arctan2方法的典型用法代碼示例。如果您正苦於以下問題:Python umath.arctan2方法的具體用法?Python umath.arctan2怎麽用?Python umath.arctan2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類numpy.core.umath
的用法示例。
在下文中一共展示了umath.arctan2方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: assert_arctan2_isnan
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def assert_arctan2_isnan(x, y):
assert_(np.isnan(ncu.arctan2(x, y)), "arctan(%s, %s) is %s, not nan" % (x, y, ncu.arctan2(x, y)))
示例2: assert_arctan2_ispinf
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def assert_arctan2_ispinf(x, y):
assert_((np.isinf(ncu.arctan2(x, y)) and ncu.arctan2(x, y) > 0), "arctan(%s, %s) is %s, not +inf" % (x, y, ncu.arctan2(x, y)))
示例3: assert_arctan2_isninf
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def assert_arctan2_isninf(x, y):
assert_((np.isinf(ncu.arctan2(x, y)) and ncu.arctan2(x, y) < 0), "arctan(%s, %s) is %s, not -inf" % (x, y, ncu.arctan2(x, y)))
示例4: assert_arctan2_ispzero
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def assert_arctan2_ispzero(x, y):
assert_((ncu.arctan2(x, y) == 0 and not np.signbit(ncu.arctan2(x, y))), "arctan(%s, %s) is %s, not +0" % (x, y, ncu.arctan2(x, y)))
示例5: assert_arctan2_isnzero
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def assert_arctan2_isnzero(x, y):
assert_((ncu.arctan2(x, y) == 0 and np.signbit(ncu.arctan2(x, y))), "arctan(%s, %s) is %s, not -0" % (x, y, ncu.arctan2(x, y)))
示例6: test_zero_nzero
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_zero_nzero(self):
# atan2(+-0, -0) returns +-pi.
assert_almost_equal(ncu.arctan2(np.PZERO, np.NZERO), np.pi)
assert_almost_equal(ncu.arctan2(np.NZERO, np.NZERO), -np.pi)
示例7: test_zero_negative
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_zero_negative(self):
# atan2(+-0, x) returns +-pi for x < 0.
assert_almost_equal(ncu.arctan2(np.PZERO, -1), np.pi)
assert_almost_equal(ncu.arctan2(np.NZERO, -1), -np.pi)
示例8: test_positive_zero
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_positive_zero(self):
# atan2(y, +-0) returns +pi/2 for y > 0.
assert_almost_equal(ncu.arctan2(1, np.PZERO), 0.5 * np.pi)
assert_almost_equal(ncu.arctan2(1, np.NZERO), 0.5 * np.pi)
示例9: test_negative_zero
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_negative_zero(self):
# atan2(y, +-0) returns -pi/2 for y < 0.
assert_almost_equal(ncu.arctan2(-1, np.PZERO), -0.5 * np.pi)
assert_almost_equal(ncu.arctan2(-1, np.NZERO), -0.5 * np.pi)
示例10: test_any_ninf
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_any_ninf(self):
# atan2(+-y, -infinity) returns +-pi for finite y > 0.
assert_almost_equal(ncu.arctan2(1, np.NINF), np.pi)
assert_almost_equal(ncu.arctan2(-1, np.NINF), -np.pi)
示例11: test_inf_ninf
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_inf_ninf(self):
# atan2(+-infinity, -infinity) returns +-3*pi/4.
assert_almost_equal(ncu.arctan2( np.inf, -np.inf), 0.75 * np.pi)
assert_almost_equal(ncu.arctan2(-np.inf, -np.inf), -0.75 * np.pi)
示例12: test_inf_pinf
# 需要導入模塊: from numpy.core import umath [as 別名]
# 或者: from numpy.core.umath import arctan2 [as 別名]
def test_inf_pinf(self):
# atan2(+-infinity, +infinity) returns +-pi/4.
assert_almost_equal(ncu.arctan2( np.inf, np.inf), 0.25 * np.pi)
assert_almost_equal(ncu.arctan2(-np.inf, np.inf), -0.25 * np.pi)