本文整理汇总了Python中sympy.core.C.asin方法的典型用法代码示例。如果您正苦于以下问题:Python C.asin方法的具体用法?Python C.asin怎么用?Python C.asin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.core.C
的用法示例。
在下文中一共展示了C.asin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eval
# 需要导入模块: from sympy.core import C [as 别名]
# 或者: from sympy.core.C import asin [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.Infinity
elif arg is S.NegativeInfinity:
return S.NegativeInfinity
elif arg is S.Zero:
return S.Zero
elif arg is S.One:
return C.log(2**S.Half + 1)
elif arg is S.NegativeOne:
return C.log(2**S.Half - 1)
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.asin(i_coeff)
else:
if arg.as_coeff_mul()[0].is_negative:
return -cls(-arg)
示例2: eval
# 需要导入模块: from sympy.core import C [as 别名]
# 或者: from sympy.core.C import asin [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.Infinity
elif arg is S.NegativeInfinity:
return S.NegativeInfinity
elif arg is S.Zero:
return S.Zero
elif arg is S.One:
return C.log(sqrt(2) + 1)
elif arg is S.NegativeOne:
return C.log(sqrt(2) - 1)
elif arg.is_negative:
return -cls(-arg)
else:
if arg is S.ComplexInfinity:
return S.ComplexInfinity
i_coeff = arg.as_coefficient(S.ImaginaryUnit)
if i_coeff is not None:
return S.ImaginaryUnit * C.asin(i_coeff)
else:
if _coeff_isneg(arg):
return -cls(-arg)
示例3: angle_between
# 需要导入模块: from sympy.core import C [as 别名]
# 或者: from sympy.core.C import asin [as 别名]
def angle_between(self, o):
"""Angle between the plane and other geometric entity.
Parameters
==========
LinearEntity3D, Plane.
Returns
=======
angle : angle in radians
Notes
=====
This method accepts only 3D entities as it's parameter, but if you want
to calculate the angle between a 2D entity and a plane you should
first convert to a 3D entity by projecting onto a desired plane and
then proceed to calculate the angle.
Examples
========
>>> from sympy import Point3D, Line3D, Plane
>>> a = Plane(Point3D(1, 2, 2), normal_vector=[1, 2, 3])
>>> b = Line3D(Point3D(1, 3, 4), Point3D(2, 2, 2))
>>> a.angle_between(b)
-asin(sqrt(21)/6)
"""
from sympy.geometry.line3d import LinearEntity3D
if isinstance(o, LinearEntity3D):
a = Matrix(self.normal_vector)
b = Matrix(o.direction_ratio)
c = a.dot(b)
d = sqrt(sum([i**2 for i in self.normal_vector]))
e = sqrt(sum([i**2 for i in o.direction_ratio]))
return C.asin(c/(d*e))
if isinstance(o, Plane):
a = Matrix(self.normal_vector)
b = Matrix(o.normal_vector)
c = a.dot(b)
d = sqrt(sum([i**2 for i in self.normal_vector]))
e = sqrt(sum([i**2 for i in o.normal_vector]))
return C.acos(c/(d*e))