本文整理汇总了Python中sympy.core.C.arg方法的典型用法代码示例。如果您正苦于以下问题:Python C.arg方法的具体用法?Python C.arg怎么用?Python C.arg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.core.C
的用法示例。
在下文中一共展示了C.arg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: as_real_imag
# 需要导入模块: from sympy.core import C [as 别名]
# 或者: from sympy.core.C import arg [as 别名]
def as_real_imag(self, deep=True, **hints):
"""
Returns this function as a complex coordinate.
Examples
========
>>> from sympy import I
>>> from sympy.abc import x
>>> from sympy.functions import log
>>> log(x).as_real_imag()
(log(Abs(x)), arg(x))
>>> log(I).as_real_imag()
(0, pi/2)
>>> log(1+I).as_real_imag()
(log(sqrt(2)), pi/4)
>>> log(I*x).as_real_imag()
(log(Abs(x)), arg(I*x))
"""
if deep:
abs = C.Abs(self.args[0].expand(deep, **hints))
arg = C.arg(self.args[0].expand(deep, **hints))
else:
abs = C.Abs(self.args[0])
arg = C.arg(self.args[0])
if hints.get('log', False): # Expand the log
hints['complex'] = False
return (log(abs).expand(deep, **hints), arg)
else:
return (log(abs), arg)
示例2: as_real_imag
# 需要导入模块: from sympy.core import C [as 别名]
# 或者: from sympy.core.C import arg [as 别名]
def as_real_imag(self, deep=True, **hints):
if deep:
abs = C.Abs(self.args[0].expand(deep, **hints))
arg = C.arg(self.args[0].expand(deep, **hints))
else:
abs = C.Abs(self.args[0])
arg = C.arg(self.args[0])
if hints.get("log", False): # Expand the log
hints["complex"] = False
return (log(abs).expand(deep, **hints), arg)
else:
return (log(abs), arg)
示例3: _eval_expand_complex
# 需要导入模块: from sympy.core import C [as 别名]
# 或者: from sympy.core.C import arg [as 别名]
def _eval_expand_complex(self, deep=True, **hints):
if deep:
abs = C.abs(self.args[0].expand(deep, **hints))
arg = C.arg(self.args[0].expand(deep, **hints))
else:
abs = C.abs(self.args[0])
arg = C.arg(self.args[0])
if hints['log']: # Expand the log
hints['complex'] = False
return log(abs).expand(deep, **hints) + S.ImaginaryUnit * arg
else:
return log(abs) + S.ImaginaryUnit * arg