本文整理汇总了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)