public VAISNAVADAY() { nFastID = FastType.FAST_NULL; nMahadvadasiID = MahadvadasiType.EV_NULL; ekadasi_parana = false; ekadasi_vrata_name = ""; eparana_time1 = eparana_time2 = null; sankranti_zodiac = -1; BiasMinutes = 0; moonrise.SetValue(0); moonset.SetValue(0); UtcDayStart = -1; dayEvents = new List <VAISNAVAEVENT>(); coreEvents = new TCoreEventCollection(); }
//================================================================================== // //================================================================================== public static void CalcMoonTimes(GCEarthData e, GregorianDateTime vc, double biasHours, out GCHourTime rise, out GCHourTime set) { double UT; int i; double prev_elev; int nType, nFound = 0; double a, ae, b, be, c = 0, ce = 0, elev; rise = new GCHourTime(); set = new GCHourTime(); rise.SetValue(-1); set.SetValue(-1); // inicializacia prvej hodnoty ELEVATION vc.shour = (-biasHours - 1.0) / 24.0; prev_elev = GCCoreAstronomy.GetMoonElevation(e, vc); // prechod cez vsetky hodiny for (UT = (-0.1 - biasHours); UT <= (24.1 - biasHours); UT += 1.0) { vc.shour = UT / 24.0; elev = GCCoreAstronomy.GetMoonElevation(e, vc); if (prev_elev * elev <= 0.0) { if (prev_elev <= 0.0) { nType = 0x1; } else { nType = 0x2; } a = UT - 1.0; ae = prev_elev; b = UT; be = elev; for (i = 0; i < 20; i++) { c = (a + b) / 2.0; vc.shour = c / 24.0; ce = GCCoreAstronomy.GetMoonElevation(e, vc); if (ae * ce <= 0.0) { be = ce; b = c; } else { ae = ce; a = c; } } if (nType == 1) { rise.SetDayTime((c + biasHours) / 24.0); } else { set.SetDayTime((c + biasHours) / 24.0); } nFound |= nType; if (nFound == 0x3) { break; } } prev_elev = elev; } }