示例#1
0
        public static int getLunarMonth11(int yy, double timeZone)
        {
            double off     = (VietCalendar.jdFromDate(31, 12, yy) - 2415021.0769986948);
            int    k       = VietCalendar.INT((off / 29.530588853));
            int    nm      = VietCalendar.getNewMoonDay(k, timeZone);
            int    sunLong = VietCalendar.INT((VietCalendar.getSunLongitude(nm, timeZone) / 30));

            if ((sunLong >= 9))
            {
                nm = VietCalendar.getNewMoonDay((k - 1), timeZone);
            }

            return(nm);
        }
示例#2
0
        public static int getLeapMonthOffset(int a11, double timeZone)
        {
            int k = VietCalendar.INT((0.5
                                      + ((a11 - 2415021.0769986948)
                                         / 29.530588853)));
            int last;
            //  Month 11 contains point of sun longutide 3*PI/2 (December solstice)
            int i = 1;
            //  We start with the month following lunar month 11
            int arc = VietCalendar.INT((VietCalendar.getSunLongitude(VietCalendar.getNewMoonDay((k + i), timeZone), timeZone) / 30));

            do
            {
                last = arc;
                i++;
                arc = VietCalendar.INT((VietCalendar.getSunLongitude(VietCalendar.getNewMoonDay((k + i), timeZone), timeZone) / 30));
            } while (((arc != last) &&
                      (i < 14)));

            return(i - 1);
        }