Code covered by the BSD License
-
atan3 (a, b)
four quadrant inverse tangent
-
cae2o(x)
Earth-to-object closest approach objective function
-
cae2oprt(jdate)
print Earth-to-object closest approach conditions
-
caeqm (time, y)
heliocentric equations of motion
-
caevent(objfunc, prtfunc, ti,...
predict close approach events
-
eci2orb1 (mu, r, v)
convert eci state vector to six classical orbital
-
gdate (jdate)
convert Julian date to Gregorian (calendar) date
-
hel_eqm (t, y)
heliocentric equations of motion
-
heqms (t, y)
first order form of the heliocentric equations of motion
-
jd2str(jdate)
convert Julian date to string equivalent
-
jplephem (et, ntarg, ncent)
reads the jpl planetary ephemeris and gives
-
julian (month, day, year)
Julian date
-
kepler1 (manom, ecc)
solve Kepler's equation for circular,
-
keycheck
pause and request user input
-
minima (f, a, b, tolm)
one-dimensional minimization
-
oeprint(mu, oev)
print six classical orbital elements
-
orb2eci(mu, oev)
convert classical orbital elements to eci state vector
-
readoe2(filename)
read orbital elements data file
-
rkf78 (deq, neq, ti, tf, h, t...
solve first order system of differential equations
-
svprint(r, v)
print position and velocity vectors and magnitudes
-
uvector(x)
unit vector
-
cae2ho.m
-
View all files
from
Closest Approach Between the Earth and Heliocentric Objects
by David Eagle
MATLAB script that predicts closest approach between the Earth and heliocentric objects.
|
| julian (month, day, year)
|
function jdate = julian (month, day, year)
% Julian date
% Input
% month = calendar month [1 - 12]
% day = calendar day [1 - 31]
% year = calendar year [yyyy]
% Output
% jdate = Julian date
% special notes
% (1) calendar year must include all digits
% (2) will report October 5, 1582 to October 14, 1582
% as invalid calendar dates and stop
% Celestial Computing with MATLAB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y = year;
m = month;
b = 0;
c = 0;
if (m <= 2)
y = y - 1;
m = m + 12;
end
if (y < 0)
c = -.75;
end
% check for valid calendar date
if (year < 1582)
% null
elseif (year > 1582)
a = fix(y / 100);
b = 2 - a + floor(a / 4);
elseif (month < 10)
% null
elseif (month > 10)
a = fix(y / 100);
b = 2 - a + floor(a / 4);
elseif (day <= 4)
% null
elseif (day > 14)
a = fix(y / 100);
b = 2 - a + floor(a / 4);
else
clc; home;
fprintf('\n\n this is an invalid calendar date!!\n');
keycheck;
return;
end
jd = fix(365.25 * y + c) + fix(30.6001 * (m + 1));
jdate = jd + day + b + 1720994.5;
|
|
Contact us