sideral_time.c   sidereal_time.c
skipping to change at line 331 skipping to change at line 331
nutation->longitude = c_longitude; nutation->longitude = c_longitude;
nutation->obliquity = c_obliquity; nutation->obliquity = c_obliquity;
nutation->ecliptic = c_ecliptic; nutation->ecliptic = c_ecliptic;
} }
/* Calculate the mean sidereal time at the meridian of Greenwich of a given date. /* Calculate the mean sidereal time at the meridian of Greenwich of a given date.
* returns apparent sidereal time (degree). * returns apparent sidereal time (degree).
* Formula 11.1, 11.4 pg 83 */ * Formula 11.1, 11.4 pg 83 */
double get_mean_sidereal_time (double JD) double get_mean_sidereal_time (double JD)
{ {
double sidereal; double sidereal;
double T; double T;
T = (JD - 2451545.0) / 36525.0; T = (JD - 2451545.0) / 36525.0;
/* calc mean angle */ /* calc mean angle */
sidereal = 280.46061837 + (360.98564736629 * (JD - 2451545.0)) + sidereal = 280.46061837 + (360.98564736629 * (JD - 2451545.0)) + (0.
* T * T) - (T * T * T / 38710000.0); 000387933 * T * T) - (T * T * T / 38710000.0);
/* add a convenient multiple of 360 degrees */ /* add a convenient multiple of 360 degrees */
sidereal = range_degrees (sidereal); sidereal = range_degrees (sidereal);
return sidereal; return sidereal;
} }
/* Calculate the apparent sidereal time at the meridian of Greenwich of a g iven date. /* Calculate the apparent sidereal time at the meridian of Greenwich of a g iven date.
* returns apparent sidereal time (degree). * returns apparent sidereal time (degree).
* Formula 11.1, 11.4 pg 83 */ * Formula 11.1, 11.4 pg 83 */
double get_apparent_sidereal_time (double JD) double get_apparent_sidereal_time (double JD)
{ {
double correction, sidereal; double correction, sidereal;
struct ln_nutation nutation; struct ln_nutation nutation;
/* get the mean sidereal time */ /* get the mean sidereal time */
sidereal = get_mean_sidereal_time (JD); sidereal = get_mean_sidereal_time (JD);
/* add corrections for nutation in longitude and for the true /* add corrections for nutation in longitude and for the true obliqu
of ity of
the ecliptic */ the ecliptic */
get_nutation (JD, &nutation); get_nutation (JD, &nutation);
/* GZ: This was the only place where this was used. I added the /* GZ: This was the only place where this was used. I added the summ
here. */ ation here. */
correction = (nutation.longitude * cos correction = (nutation.longitude * cos ((nutation.ecliptic+nutation.
obliquity)*M_PI/180.));
sidereal += correction; sidereal += correction;
return (sidereal); return (sidereal);
} }
double get_mean_ecliptical_obliquity(double JDE) double get_mean_ecliptical_obliquity(double JDE)
{ {
struct ln_nutation nutation; struct ln_nutation nutation;
get_nutation(JDE, &nutation); get_nutation(JDE, &nutation);
return nutation.ecliptic; return nutation.ecliptic;
}
double get_nutation_longitude(double JDE)
{
struct ln_nutation nutation;
get_nutation(JDE, &nutation);
return nutation.longitude;
} }
End of changes. 12 change blocks.
26 lines changed or deleted 33 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/