Open In App

Python | Sympy Ellipse.director_circle() method

In Sympy, the function director_circle() returns a Circle consisting of all points where two perpendicular tangent lines to the ellipse cross each other.
Syntax: Ellipse.director_circle()

Returns: Circle
 A director circle returned as a geometric object.

Example #1:




# import sympy and Circle, Ellipse, Point
from sympy import Circle, Ellipse, Point
  
p = Point(3, 8)
  
# using director_circle() method
directorCircle = Ellipse(p, 7, 9).director_circle()
  
print(directorCircle)

Output:

Circle(Point2D(3, 8), sqrt(130))

Example 2:




# import sympy and Circle, Ellipse, Point, symbols
from sympy import Circle, Ellipse, Point, symbols
  
p = Point(3, 8)
a, b = symbols('a b')
  
# using director_circle() method
directorCircle = Ellipse(p, a, b).director_circle()
  
print(directorCircle)

Output:

Circle(Point2D(3, 8), sqrt(a**2 + b**2))
Article Tags :