在sympy中,函數
Ellipse.equation()
用於生成給定橢圓的方程。用法: Ellipse.equation(x='x', y='y', _slope=None) 參數: x: Label for the x-axis. Default value is ‘x’. y:Label for the y-axis. Default value is ‘y’. _slope: The slope of the major axis. Ignored when ‘None’. 返回: equation:sympy expression
範例1:
# import sympy, Point and Ellipse
from sympy import Point, Ellipse
from sympy.abc import x, y
# using Ellipse()
e1 = Ellipse(Point(1, 0), 3, 2)
# using equation()
eq1 = e1.equation(x, y);
print(eq1)
輸出:
y**2/4 + (x/3 - 1/3)**2 - 1
範例2:
# import sympy, Point and Ellipse
from sympy import Point, Ellipse
from sympy.abc import x, y
# using Ellipse()
e2 = Ellipse(Point(0, 0), 3, 2)
# using equation()
eq2 = e2.equation(x, y);
print(eq2)
輸出:
x**2/9 + y**2/4 - 1
相關用法
- 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 Ellipse.equation() method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。