當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


Python Sympy Ellipse.director_circle()用法及代碼示例


在Sympy中,該函數director_circle()返回一個圓,該圓包含所有與橢圓垂直的兩條切線彼此交叉的點。
用法: Ellipse.director_circle()

返回: Circle
 A director circle returned as a geometric object.

範例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)

輸出:


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

範例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)

輸出:

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


相關用法


注:本文由純淨天空篩選整理自ravikishor大神的英文原創作品 Python | Sympy Ellipse.director_circle() method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。