Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-penn authored Nov 14, 2017
1 parent 67ed474 commit f0b90d9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions interplanetary_trajectory.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ function interplanetary_trajectory()

UT1 = hr1 + min1/60 + sec1/3600;

r_d = input('Input the perigee radius of the parking orbit:\n ');
r_d = input('Input the perigee radius of the parking orbit (km):\n ');
e_d = input('Input the eccentricity of the parking orbit:\n ');

r_a = input('Input the perigee radius of the capture orbit:\n ');
r_a = input('Input the perigee radius of the capture orbit (km):\n ');
e_a = input('Input the eccentricity of the capture orbit:\n ');

date2 = input('Input the arrival date (dd/mm/yyyy):\n','s');
Expand Down Expand Up @@ -127,6 +127,15 @@ function interplanetary_trajectory()

delta_va = v_a_p - v_a_c;

%% plot the transfer orbit
theta_plot = linspace(0,2*pi);
r = h^2/mu .* (1 ./ (1 + e* cos(theta_plot)));

polarplot(theta_plot,r);
title('Interplanetary Orbital Trajectory')
text(theta_plot(1), r(1), 'o departure','color','black','FontWeight','bold');
text(theta_plot(end/2), r(end/2), 'o arrival','color','black','FontWeight','bold');

%% print the results
%{
dd = num2str(d1);
Expand Down

0 comments on commit f0b90d9

Please sign in to comment.