Propagate an orbit about the moon. Show the visibility sun, earth, moon.

------------------------------------------------------------------------
See also Constant, Date2JD, RVOrbGen, Period, MoonV1, SolarVisibility
------------------------------------------------------------------------
%--------------------------------------------------------------------------
%  Copyright 2007 Princeton Satellite Systems, Inc.
%  All rights reserved.
%--------------------------------------------------------------------------

% epoch
jD0 = Date2JD( [2009, 2, 15, 19, 0, 0] );

% orbital elements
sma = 6531.4;
inc = 56.2*pi/180;
ra  = 0;
per = pi/2;
ecc = 0.6;
ma  = 0;

% element vector
el = [sma,inc,ra,per,ecc,ma];

% moon's gravitational constant
muMoon = Constant('mu moon');

% orbit period
T = Period(sma,muMoon);

% time vector
t   = linspace(0,2*86400,2*200);
jD  = jD0 + t/86400;

% radius of sun, moon, earth
radSun   = Constant('sun radius');              % km
radMoon  = Constant('equatorial radius moon');  % km
radEarth = Constant('equatorial radius earth'); % km

% Earth to Moon vector
[unitMoon,distMoon] = MoonV1(jD);
rMEs = [unitMoon(1,:).*distMoon;unitMoon(2,:).*distMoon;unitMoon(3,:).*distMoon;];

% Orbit of ComSat about the moon
rCMs = RVOrbGen( el, t, [], muMoon );

% path of ComSat w.r.t. Earth
rCEs = rCMs + rMEs;

% animate the view of sun, Earth and Moon from the ComSat's perspective
SolarVisibility(rCEs,jD,3,'Moon',360,0);


%--------------------------------------
% PSS internal file version information
%--------------------------------------