Example #1
0
        /// <summary>
        /// Calculate prayer time for isha.
        /// </summary>
        private static double ComputeIshaTime(double jd, double ishaParameterValue, double latitude)
        {
            var dayFraction = AstronomyMath.GetDayFraction(IshaDefaultTime);
            var ishaTime    = AstronomyMath.ComputeSolarTime(jd, dayFraction, ishaParameterValue, latitude, Direction.Clockwise);

            return(ishaTime);
        }
Example #2
0
        /// <summary>
        /// Calculate prayer time for maghrib.
        /// </summary>
        private static double ComputeMaghribTime(double jd, double maghribParameterValue, double latitude)
        {
            var dayFraction = AstronomyMath.GetDayFraction(MaghribDefaultTime);
            var maghribTime = AstronomyMath.ComputeSolarTime(jd, dayFraction, maghribParameterValue, latitude, Direction.Clockwise);

            return(maghribTime);
        }
Example #3
0
        // /// <summary>
        // /// Calculate prayer time for imsak.
        // /// </summary>
        // // NOTE: Do imsak time can be calculated using angle parameter?
        // private static double ComputeImsakTime(double jd, double imsakParameterValue, double latitude)
        // {
        //     var dayFraction = AstronomyMath.GetDayFraction(ImsakDefaultTime);
        //     var imsakTime = AstronomyMath.ComputeSolarTime(jd, dayFraction, imsakParameterValue, latitude, Direction.CounterClockwise);
        //
        //     return imsakTime;
        // }

        /// <summary>
        /// Calculate prayer time for fajr.
        /// </summary>
        private static double ComputeFajrTime(double jd, double fajrParameterValue, double latitude)
        {
            var dayFraction = AstronomyMath.GetDayFraction(FajrDefaultTime);
            var fajrTime    = AstronomyMath.ComputeSolarTime(jd, dayFraction, fajrParameterValue, latitude, Direction.CounterClockwise);

            return(fajrTime);
        }
Example #4
0
        /// <summary>
        /// Calculate prayer time for sunset.
        /// </summary>
        private static double ComputeSunsetTime(double jd, double latitude, double altitude)
        {
            var dayFraction  = AstronomyMath.GetDayFraction(SunsetDefaultTime);
            var sunriseAngle = AstronomyMath.ComputeSunriseAngle(altitude);
            var sunsetTime   = AstronomyMath.ComputeSolarTime(jd, dayFraction, sunriseAngle, latitude, Direction.Clockwise);

            return(sunsetTime);
        }
Example #5
0
        /// <summary>
        /// Calculate prayer time for asr.
        /// </summary>
        private static double ComputeAsrTime(double jd, int juristicTimeOfShadow, double latitude)
        {
            var dayFraction    = AstronomyMath.GetDayFraction(AsrDefaultTime);
            var sunDeclination = AstronomyMath.ComputeSunDeclination(jd + dayFraction);
            var angle          = -AngleMath.InverseCotangentInDegree(juristicTimeOfShadow + AngleMath.TangentOfDegree(Math.Abs(latitude - sunDeclination)));
            var asrTime        = AstronomyMath.ComputeSolarTime(jd, dayFraction, angle, latitude, Direction.Clockwise);

            return(asrTime);
        }
Example #6
0
        // ReSharper disable once InconsistentNaming
        public void TestComputeSolarTimeForFajrPrayerOnApril12th2018()
        {
            var st = AstronomyMath.ComputeSolarTime(Jd, 0.20833333333333334, FajrAngle, Latitude, Direction.CounterClockwise);

            Assert.Equal(4.644572520441736, st);
        }
Example #7
0
        // ReSharper disable once InconsistentNaming
        public void TestComputeSolarTimeForIshaPrayerOnApril12th2018()
        {
            var st = AstronomyMath.ComputeSolarTime(Jd, 0.75, IshaAngle, Latitude, Direction.Clockwise);

            Assert.Equal(19.250576300230424, st);
        }