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