Ejemplo n.º 1
0
        public int GetShaaZmanit(CalendarTime sunrise, CalendarTime sunset)
        {
            double sr = sunrise.getHour() * 60 + sunrise.getMin();
            double ss = sunset.getHour() * 60 + sunrise.getMin();

            return((int)(Math.Floor((ss - sr) / 12)));
        }
Ejemplo n.º 2
0
        public CalendarTime GetProportionalHours(double value, CalendarTime sunrise, CalendarTime sunset)
        {
            if (sunrise == null || sunset == null)
            {
                return(null);
            }
            double sr     = sunrise.getHour() * 60 + sunrise.getMin();
            double ss     = sunset.getHour() * 60 + sunset.getMin();
            double retval = sr + Math.Floor(((ss - sr) * value) / 12);

            int[] propResult = { (int)(Math.Floor(retval / 60)), (int)(retval % 60) };
            return(new CalendarTime(propResult[0], propResult[1]));
        }
Ejemplo n.º 3
0
        public CalendarTime GetSunsetDegreesBelowHorizon(int uMonth, int uDay, int uYear,
                                                         double fDegreesBelowHorizon,
                                                         Location location)
        {
            CalendarTime t = GetSunset(uMonth, uDay, uYear, location);

            if (t != null)
            {
                int adding = GetDegreesBelowHorizonAdd(uMonth, uDay, uYear, fDegreesBelowHorizon, location);
                if (adding != -1)
                {
                    t.addMinutes(adding);
                    return(t);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }