How to plot this ellipse

I tried this; but did not get answer like in textbook. Please see my code and image.Kindly help
[x,y] = meshgrid(-300000:10000:600000);
z=(x.^2-15.156*x*y+229.7*y.^2+488.8*1000.0*1000.0+6844000*y-4.752*10.^10);
surf(x,y,z)
,y,z)

2 件のコメント

Walter Roberson
Walter Roberson 2022 年 8 月 11 日
if you have the symbolic toolbox you can fimplicit()
Keshav
Keshav 2022 年 8 月 11 日
thanks a lot.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2022 年 8 月 11 日

1 投票

syms s1 s2
t = 0 ;
eqn = s1^2-15.156*s1*s2+229.7*s2^2+488.8*t^2+6844000*s2==4.752*10^10 ;
fimplicit(eqn,[-600000 200000 -100000 20000])

3 件のコメント

Keshav
Keshav 2022 年 8 月 11 日
編集済み: Keshav 2022 年 8 月 11 日
Thanks a lot. How can I run T=1000 and plot both ellipses in the same plot?
KSSV
KSSV 2022 年 8 月 12 日
syms s1 s2
t = 0 ;
eqn = s1^2-15.156*s1*s2+229.7*s2^2+488.8*t^2+6844000*s2==4.752*10^10 ;
h = fimplicit(eqn,[-600000 300000 -100000 20000]) ;
x1 = h.XData ; y1 = h.YData ;
t = 10000 ;
eqn = s1^2-15.156*s1*s2+229.7*s2^2+488.8*t^2+6844000*s2==4.752*10^10 ;
h = fimplicit(eqn,[-600000 300000 -100000 20000]) ;
x2 = h.XData ; y2 = h.YData ;
close all
figure
hold on
plot(x1,y1,'.r') ;
plot(x2,y2,'.b')
Keshav
Keshav 2022 年 8 月 14 日
Thanks!!

サインインしてコメントする。

質問済み:

2022 年 8 月 11 日

コメント済み:

2022 年 8 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by