//Static methods /////////////////////////////// Implementation //////////////////////////////// public static double MeanGreenwichSiderealTime(double JD) { //Get the Julian day for the same day at midnight int Year = 0; int Month = 0; int Day = 0; int Hour = 0; int Minute = 0; double Second = 0; CAADate date = new CAADate(); date.Set(JD, CAADate.AfterPapalReform(JD)); date.Get(ref Year, ref Month, ref Day, ref Hour, ref Minute, ref Second); date.Set(Year, Month, Day, 0, 0, 0, date.InGregorianCalendar()); double JDMidnight = date.Julian(); //Calculate the sidereal time at midnight double T = (JDMidnight - 2451545) / 36525; double TSquared = T * T; double TCubed = TSquared * T; double Value = 100.46061837 + (36000.770053608 * T) + (0.000387933 * TSquared) - (TCubed / 38710000); //Adjust by the time of day Value += (((Hour * 15) + (Minute * 0.25) + (Second * 0.0041666666666666666666666666666667)) * 1.00273790935); Value = CAACoordinateTransformation.DegreesToHours(Value); return(CAACoordinateTransformation.MapTo0To24Range(Value)); }
//Static methods /////////////////////////////// Implementation //////////////////////////////// public static double MeanGreenwichSiderealTime(double JD) { //Get the Julian day for the same day at midnight int Year = 0; int Month = 0; int Day = 0; int Hour = 0; int Minute = 0; double Second = 0; CAADate date = new CAADate(); date.Set(JD, CAADate.AfterPapalReform(JD)); date.Get(ref Year, ref Month, ref Day, ref Hour, ref Minute, ref Second); date.Set(Year, Month, Day, 0, 0, 0, date.InGregorianCalendar()); double JDMidnight = date.Julian(); //Calculate the sidereal time at midnight double T = (JDMidnight - 2451545) / 36525; double TSquared = T *T; double TCubed = TSquared *T; double Value = 100.46061837 + (36000.770053608 *T) + (0.000387933 *TSquared) - (TCubed/38710000); //Adjust by the time of day Value += (((Hour * 15) + (Minute * 0.25) + (Second * 0.0041666666666666666666666666666667)) * 1.00273790935); Value = CAACoordinateTransformation.DegreesToHours(Value); return CAACoordinateTransformation.MapTo0To24Range(Value); }