How to plot circles in polar form?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Voss
am 25 Mär. 2022
Bearbeitet: Voss
am 25 Mär. 2022
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.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Earth and Planetary Science finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
