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

11 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 CubeSat and Satellites 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by