How to plot satellite orbits around the Earth? (combining plots)

9 ビュー (過去 30 日間)
Christopher Maraj
Christopher Maraj 2018 年 3 月 16 日
コメント済み: Christopher Maraj 2018 年 3 月 16 日
I have a script that produces the earth on a 3D set of axis and another that produces the orbit of a satellite in the form of a ring. (plot3 was used to model the satellite's trajectory). Does anyone know how I can combine the plot of the earth and that of the orbit trajectory?

回答 (1 件)

KSSV
KSSV 2018 年 3 月 16 日
Use hold on and then plot both on the same figure. Simple... :)
  4 件のコメント
Christopher Maraj
Christopher Maraj 2018 年 3 月 16 日
This is the m file for the earth plot
Re = 6.37e6;
load('earth_topo.mat');
figure(1);
[x,y,z] = sphere(50);
s = surf(Re*x/1e6,Re*y/1e6,Re*z/1e6); % create a sphere
s.CData = topo; % set color data to topographic data
s.FaceColor = 'texturemap'; % use texture mapping
s.EdgeColor = 'none'; % remove edges
s.FaceLighting = 'gouraud'; % preferred lighting for curved surfaces
s.SpecularStrength = 0.4; % change the strength of the reflected light
grid on; box on; axis equal;
axis(8*[-1 1 -1 1 -1 1]);
xlabel('x (10^6 m)'); ylabel('y (10^6 m)'); zlabel('z (10^6 m)'); title('Earth');
set(gca,'LineWidth',1,'FontSize',14, ...
'Xtick',[-8:4:10],'Ytick',[-8:4:10],'Ztick',[-8:4:8]);
end
Christopher Maraj
Christopher Maraj 2018 年 3 月 16 日
This is the code for the plot, which at the moment only has the orbit rings on a 3d axis and no earth.
[Xo,Yo,Zo,Uo,Vo,Wo,tstart,tend,maxthrust] = read_input('satellite_data.txt',1);
[T,X,Y,Z,U,V,W] = satellite(Xo,Yo,Zo,Uo,Vo,Wo,tstart,tend,maxthrust);
plot3(X,Y,Z,'b')
hold on;
scatter3(X(tend),Y(tend),Z(tend),'filled')
end

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

カテゴリ

Help Center および File ExchangeCubeSat and Satellites についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by