本文整理汇总了Python中sympy.core.basic.Basic.acoth方法的典型用法代码示例。如果您正苦于以下问题:Python Basic.acoth方法的具体用法?Python Basic.acoth怎么用?Python Basic.acoth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.core.basic.Basic
的用法示例。
在下文中一共展示了Basic.acoth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _eval_apply
# 需要导入模块: from sympy.core.basic import Basic [as 别名]
# 或者: from sympy.core.basic.Basic import acoth [as 别名]
def _eval_apply(cls, arg):
arg = Basic.sympify(arg)
if isinstance(arg, Basic.Number):
if isinstance(arg, Basic.NaN):
return S.NaN
elif isinstance(arg, Basic.Infinity):
return S.Zero
elif isinstance(arg, Basic.NegativeInfinity):
return S.Zero
elif isinstance(arg, Basic.Zero):
return S.Pi/ 2
elif isinstance(arg, Basic.One):
return S.Pi / 4
elif isinstance(arg, Basic.NegativeOne):
return -S.Pi / 4
else:
cst_table = {
Basic.sqrt(3)/3 : 3,
-Basic.sqrt(3)/3 : -3,
1/Basic.sqrt(3) : 3,
-1/Basic.sqrt(3) : -3,
Basic.sqrt(3) : 6,
-Basic.sqrt(3) : -6,
}
if arg in cst_table:
return S.Pi / cst_table[arg]
elif arg.is_negative:
return -cls(-arg)
else:
i_coeff = arg.as_coefficient(S.ImaginaryUnit)
if i_coeff is not None:
return -S.ImaginaryUnit * Basic.acoth(i_coeff)
else:
coeff, terms = arg.as_coeff_terms()
if coeff.is_negative:
return -cls(-arg)