How to plot circles in polar form?
4 次查看(过去 30 天)
显示 更早的评论
I am attempting to plot the orbits of the planets in polar form using matricies holding the relevant values.
When attempting to use the polarplot() function, the resulting graph does not produce any circles/ellipses, only a few connected line segments.

What might I have done incorrectly in attempting to graph these orbits?
Please DO NOT suggest any changes that use a non-vectorized method.
My current code (reduced to only 4 planets for demonstration):
p = [.387 .723 1 1.524];
E = [.2056 .0068 .0167 .0934];
theta = deg2rad([7.005 3.3947 0 1.851]);
radius = p./(1.- (E.*cos(theta)));
polarplot(theta, radius);
2 个评论
Voss
2022-3-25
编辑:Voss
2022-3-25
You've only got four points there, when you need four orbits, right?
I don't know enough about equations for elliptical orbits to know where your theta are supposed to fit in, but I know that you'll have to specify points all the way around the orbit:
p = [.387 .723 1 1.524];
E = [.2056 .0068 .0167 .0934];
% theta = deg2rad([7.005 3.3947 0 1.851]);
theta = linspace(0,2*pi,100).';
radius = p./(1 + (E.*cos(theta)));
polarplot(theta, radius,'LineWidth',2);
That gives you some orbits; maybe you can work with it to get what you're going for.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Earth and Planetary Science 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
