zulfahmi93 / prayer-times

Library for calculating Muslim's prayer times for .NET.
MIT License
16 stars 5 forks source link

Moscow Prayers Times #1

Open yangar opened 6 years ago

yangar commented 6 years ago

Some couples of locations return an ArgumentOutOfRangeException.

Exemple for Moscow:

var when = Instant.FromUtc(2018, 7, 2, 0, 0);
// Init settings.
var settings = new PrayerCalculationSettings();
// Set calculation method to JAKIM (Fajr: 18.0 and Isha: 20.0).
settings.CalculationMethod.SetCalculationMethodPreset(when, CalculationMethodPreset.DepartmentOfIslamicAdvancementOfMalaysia);
// Init location info.
var geo = new Geocoordinate(55.75, 37.61, 0);
ArgumentOutOfRangeException: Value should be in range [-402653184-402653183]
Parameter name: hours
Actual value was NaN.
zulfahmi93 commented 6 years ago

Thanks for the report. I have investigated the problem and working on the solution. This may take some time as the problem only occur at location with a higher latitude.

yangar commented 6 years ago

Yes look like the problem occur in the ComputeSolarTime calculaton on AstronomyMath.cs. I ve tried to fix it using an other library : https://github.com/porrey/Solar-Calculator Without success, my knowledge on this topic is quiet limited.

An other interesting libraiy: https://github.com/xeqlol/SolarPositionAlgorithm Thank you for your work!

highwingers commented 4 years ago

Any work around this? its also throwing same error for Manchester UK as well. Thank you

highwingers commented 4 years ago

Thanks for the report. I have investigated the problem and working on the solution. This may take some time as the problem only occur at location with a higher latitude.

Any Update?

highwingers commented 4 years ago

Yes look like the problem occur in the ComputeSolarTime calculaton on AstronomyMath.cs. I ve tried to fix it using an other library : https://github.com/porrey/Solar-Calculator Without success, my knowledge on this topic is quiet limited.

An other interesting libraiy: https://github.com/xeqlol/SolarPositionAlgorithm Thank you for your work!

did you find any work around?