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 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