在sympy中,函数
encloses_point()
用于检查给定点是否被给定椭圆所包围。用法: Ellipse.encloses_point(point) 返回: True:if point is enclosed by ellipse, otherwise False.
范例1:
# import sympy and geometry module
from sympy import *
from sympy.geometry import *
x = Point(0, 0)
# making ellipse with given point as center and radii
e1 = Ellipse(x, 3, 2)
# using encloses_point() method
isEnclosed = e1.encloses_point((0, 0))
print(isEnclosed)
输出:
True
范例2:
# import sympy and geometry module
from sympy import *
from sympy.geometry import *
x = Point(3, 1)
# making ellipse with given point as center, hradius and eccentricity
e2 = Ellipse(x, hradius = 3, eccentricity = Rational(4, 5))
# using encloses_point() method
isEnclosed = e2.encloses_point((4, 6))
print(isEnclosed)
输出:
False
相关用法
- Python sympy.csc()用法及代码示例
- Python sympy.cot()用法及代码示例
- Python sympy.nP()用法及代码示例
- Python sympy.crt()用法及代码示例
- Python sympy.det()用法及代码示例
- Python sympy.nC()用法及代码示例
- Python sympy.cos()用法及代码示例
- Python sympy.Pow()用法及代码示例
- Python sympy.eye()用法及代码示例
- Python sympy.tan()用法及代码示例
- Python sympy.ones()用法及代码示例
- Python sympy.sin()用法及代码示例
- Python sympy.Add()用法及代码示例
- Python sympy.S()用法及代码示例
- Python sympy.has()用法及代码示例
注:本文由纯净天空筛选整理自ravikishor大神的英文原创作品 Python | Sympy encloses_point() method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。