parametrization of an ellipse

2 次查看(过去 30 天)
I wrote this code to get elliptical eqn in the form of (x^2)/(a^2)+(y^2)/(b^2) = 1 from user and i want find a and b . exp:((x^2)/16+(y^2)/25=1)
ellipse_eqn = input('Enter for elliptical path: ','s') ;
ellipse = str2sym(ellipse_eqn)

采纳的回答

Matt J
Matt J 2022-12-6
syms x y real
ellipse=(x^2)/16+(y^2)/25==1;
a=abs(solve([ellipse,y==0]).x(1))
a = 
4
b=abs(solve([ellipse,x==0]).y(1))
b = 
5

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by