Friday, October 3, 2025
HomeLanguagesPython | Sympy encloses_point() method

Python | Sympy encloses_point() method

In sympy, the function encloses_point() is used to check whether the given point is encolsed by given ellipse or not.

Syntax: Ellipse.encloses_point(point)

Return: True:if point is enclosed by ellipse, otherwise False.

Example #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)
  


Output:

True

Example #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)
  


Output:

False
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32331 POSTS0 COMMENTS
Milvus
85 POSTS0 COMMENTS
Nango Kala
6703 POSTS0 COMMENTS
Nicole Veronica
11867 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11929 POSTS0 COMMENTS
Shaida Kate Naidoo
6818 POSTS0 COMMENTS
Ted Musemwa
7080 POSTS0 COMMENTS
Thapelo Manthata
6775 POSTS0 COMMENTS
Umr Jansen
6776 POSTS0 COMMENTS