Time and data conversions and planetary movement, position, and eclipse computations. More...
Functions | |
double | date_to_jd (const ml_matrix &dateTime) |
Converts date to jd. | |
double | jd_to_utc_secs (double jd) |
Converts Julian date to seconds since 00:00:00 January 1, 1970 (UTC) | |
double | utc_secs_to_jd (double secs) |
Converts seconds since 00:00:00 January 1, 1970 (UTC) to Julian date. | |
double | jd_to_jcent (double jd) |
Convert Julian date to Julian century. | |
double | jcent_to_jd (double jcent) |
Convert Julian century to Julian date. | |
double | jd_to_midnight (double jd) |
Round a Julian date value to the most recent midnight (0 hours) value. | |
double | gms_time (double jd) |
Get Greenwich Mean Sidereal time. | |
double | ms_day (double jd) |
Compute a mean sidereal (solar) day. | |
double | local_sidereal_time (double jd, double lon) |
Compute the local sidereal time for a given Julian date and longitude. | |
double | mean_sidereal_day (double jd) |
Mean sidereal day. | |
ml_matrix | jd_to_date (double jd) |
Convert Julian date to date. | |
double | jd_to_day_number (double jd) |
Convert Julian date to day number. | |
ml_matrix | meci_to_planet (double alpha0, double delta0, double w) |
Generate the ECI to Planet transformation matrix. | |
ml_matrix | sun_vector (double jd, double &r) |
Generate the sun vector in the earth-centered inertial frame. | |
ml_matrix | sun_vector (double jd) |
ml_matrix | moon_vector (double jd, double &r) |
Generate the moon vector in the earth-centered inertial frame. | |
ml_matrix | true_earth (double jcent) |
Computes the matrix from mean of Aries 2000 to earth fixed frame. | |
ml_matrix | earth_pre (double jcent) |
Computes the earth precession matrix. | |
ml_matrix | earth_rot (double jcent) |
Computes the earth Greenwich matrix using GMST, that transforms from ECI to Earth-fixed. | |
ml_matrix | earth_rot_eq (double jcent) |
Computes the earth Greenwich matrix using apparent sidereal time. | |
ml_matrix | earth_nut (double jcent) |
The matrix that rotates from the mean axes to the true axes. | |
double | nut_delta (double j_cent, double &delta_eps) |
The changes in longitude and obliquity due to earth nutation. | |
double | ob_of_ecliptic (double jcent) |
Computes the mean obliquity of the ecliptic of date. | |
ml_matrix | c_ecl_to_eq (double jD) |
Transformation from eclipic to equatorial. | |
double | eq_of_equinoxes (double jcent) |
Computes the equation of the equinoxes. | |
double | eclipse (const ml_matrix &pos, const ml_matrix &l_pos, const ml_matrix &p_pos, double p_radius=RADIUS_EARTH, double l_radius=RADIUS_SUN) |
Compute eclipses. | |
double | earth_rate (double jd) |
Earth rotation rate. | |
ml_matrix | local_star_position (double jd, double lY) |
Local star positions. | |
ml_matrix | planet_ecliptic_to_orbit (int naif_code, double jd=JD_2000) |
Planet orbit rotation frame. | |
ml_matrix | planet_ecliptic_to_orbit (char *planet_name, double jd=JD_2000) |
Generates planet rotation frame. |
double date_to_jd | ( | const ml_matrix & | d ) |
Converts date to jd.
The date vector is in the form [year month day hours minutes seconds] where all values should be integers except seconds which may be a double. If any columns of datetime are omitted they will be set to zero, as appropriate, with a default date of Jan 1, 2000 at 00:00.
Examples: jD = date_to_jd([2009]); // assumes January 1 at 0:00 jD = date_to_jd([2009 4 11]); jD = date_to_jd([2009 4 11 13 45]); jD = date_to_jd([2009 4 11 13 45 15.146]);
datetime | Date vector (1x6) to be converted to Julian date. |
double jd_to_utc_secs | ( | double | jd ) |
Converts Julian date to seconds since 00:00:00 January 1, 1970 (UTC)
jd | Julian date value to be converted to UTC seconds. |
References DAYS_TO_SECS, and JD_EPOCH.
double utc_secs_to_jd | ( | double | secs ) |
secs | UTC seconds value to be converted to Julian date. |
References JD_EPOCH, and SECS_TO_DAYS.
double jd_to_jcent | ( | double | jd ) |
Convert Julian date to Julian century.
jd | Julian date to be converted to Julian centuries. |
References DAYS_TO_CENTURIES, and JD_2000.
double jcent_to_jd | ( | double | jcent ) |
Convert Julian century to Julian date.
jcent | The Julian century value to be converted to Julian date. |
References CENTURIES_TO_DAYS, and JD_2000.
double jd_to_midnight | ( | double | jd ) |
jd | The Julian date value to be rounded. |
double gms_time | ( | double | jd ) |
Get Greenwich Mean Sidereal time.
Gives the angle between the Greenwich Meridian and the Vernal Equinox (the x-axis in the ECI frame). This does not account for Earth nutation. Ref: The 1993 Astronomical Almanac, U.S. Government Printing Office, p. B6.
jd | Julian date at which to calculate the Greenwich Mean Sidereal time. |
References SECS_TO_DAYS.
double ms_day | ( | double | jd ) |
Compute a mean sidereal (solar) day.
Ref: The 1993 Astronomical Almanac, U.S. Government Printing Office, p. B6.
jd | Julian date value for which the mean sidereal day should be computed. |
References DAYS_TO_SECS.
double local_sidereal_time | ( | double | jd, |
double | lon | ||
) |
jd | Julian date |
lon | longitude |
ml_matrix jd_to_date | ( | double | jd ) |
Convert Julian date to date.
jd | The Julian date value to be rounded. |
double jd_to_day_number | ( | double | jd ) |
Convert Julian date to day number.
jd | The Julian date value to be rounded. |
ml_matrix meci_to_planet | ( | double | alpha0, |
double | delta0, | ||
double | w | ||
) |
Ref: Montenbruck, O., Pfleger, T., "Astronomy on the Personal Computer, Second Edition."
alpha0 | The right ascension of the planet's pole, measured in degrees. |
delta0 | The declination of the planet's pole, measured in degrees. |
w | The angle of rotation about the pole, measured in degrees. |
References DEGREES_TO_RADIANS.
ml_matrix sun_vector | ( | double | jd, |
double & | r | ||
) |
Ref: The 1993 Astronomical Almanac, U.S. Government Printing Office, p. C24.
jd | Julian date at which the sun vector is to be generated. |
r | Returns the distance from origin to sun in kms |
References DEGREES_TO_RADIANS, JD_2000, and REVS_TO_DEGREES.
ml_matrix moon_vector | ( | double | jd, |
double & | r | ||
) |
Ref: The 1993 Astronomical Almanac, U.S. Government Printing Office, p. D46.
jd | Julian date at which to compute the moon vector. |
r | Returns the distance from origin to moon in kms |
References DEGREES_TO_RADIANS, RADIUS_EARTH, and REVS_TO_DEGREES.
ml_matrix true_earth | ( | double | jcent ) |
Calls earth_rot, earth_nut, and earth_pre in sequence.
B = B_rot*B_nut*B_pre
Ref: Seidelmann, The Explanatory Supplement to the Astronomical Almanac, p. 20.
jcent | Julian century at which to compute the true earth matrix. |
ml_matrix earth_pre | ( | double | jcent ) |
Ref: Seidelmann, The Explanatory Supplement to the Astronomical Almanac, p. 103.
jcent | The Julian century at which to compute the earth precession matrix. |
References DEGREES_TO_RADIANS.
ml_matrix earth_rot | ( | double | jcent ) |
Computes the earth Greenwich matrix using GMST, that transforms from ECI to Earth-fixed.
Equivalent to a rotation about the Z axis by the Greenwich mean sidereal time (GMST). Ref: Seidelmann, P. K., The Explanatory Supplement to the Astronomical Almanac, p. 20.
jcent | Julian century at which to compute the earth Greenwich matrix. |
References DEGREES_TO_RADIANS.
ml_matrix earth_rot_eq | ( | double | jcent ) |
Computes the earth Greenwich matrix using apparent sidereal time.
Equivalent to a rotation about the Z axis by the Greenwich apparent sidereal time (GAST). Ref: Seidelmann, P. K., The Explanatory Supplement to the Astronomical Almanac, p. 20.
jcent | Julian century at which to compute the earth Greenwich matrix. |
References DEGREES_TO_RADIANS.
ml_matrix earth_nut | ( | double | jcent ) |
Ref: Seidelmann, P. K., The Explanatory Supplement to the Astronomical Almanac, p. 115.
jcent | The Julian century at which to calculate the matrix. |
References DEGREES_TO_RADIANS.
double nut_delta | ( | double | j_cent, |
double & | delta_eps | ||
) |
Ref: Seidelmann, The Explanatory Supplement to the Astronomical Almanac
j_cent | Julian century from JD 2000 for which to compute the changes in longitude and obliquity. |
delta_eps | Returns the change in obliquity. |
References DEGREES_TO_RADIANS, and SECS_TO_HOURS.
double ob_of_ecliptic | ( | double | jcent ) |
Ref: The 1993 Astronomical Almanac, U.S. Government Printing Office, p. B18.
jcent | The Julian century at which to compute the mean obliquity. |
ml_matrix c_ecl_to_eq | ( | double | jD ) |
Transformation from eclipic to equatorial.
If the jd is not input it will use the mean obliquity for J2000.0.
jD | (1,1) Julian date |
References PI.
double eq_of_equinoxes | ( | double | jcent ) |
Ref: The Astronomical Almanac for the Year 1993, U.S. Government Printing Office, 1993, p. B6.
jcent | The Julian century at which to compute the mean obliquity. |
References DEGREES_TO_RADIANS.
double eclipse | ( | const ml_matrix & | pos, |
const ml_matrix & | l_pos, | ||
const ml_matrix & | p_pos, | ||
double | p_radius, | ||
double | l_radius | ||
) |
pos | (3,1) Position vector of the spacecraft |
l_pos | (3,1) Position vector of the light source |
p_pos | (3,1) Position vector of the planet causing the eclipse |
p_radius | Radius of the planet causing the eclipse (default is the earth) |
l_radius | Radius of the light source (default is the sun) |
References PI.
ml_matrix local_star_position | ( | double | jd, |
double | lY | ||
) |
Local star positions.
jd | Julian date |
lY | Light years from the sun |
ml_matrix planet_ecliptic_to_orbit | ( | int | naif_code, |
double | jD | ||
) |
Planet orbit rotation frame.
naif_code | Code for planetary system |
jd | Julian day number |
ml_matrix planet_ecliptic_to_orbit | ( | char * | planet_name, |
double | jD | ||
) |
name | string form name |
jd | Julian day number |