Comments (4)
The error happens, because on the calculation of Astronomical.correctedHourAngle for sunrise with the coordinates given, the value passed to calculate degree is -1.0000000008014773. This is impossible to achieve hence error occurs.
from adhan-dart.
The error happens, because on the calculation of Astronomical.correctedHourAngle for sunrise with the coordinates given, the value passed to calculate degree is -1.0000000008014773. This is impossible to achieve hence error occurs.
yes the bug is there. I tried to solve it in the plugin by checking the value passed to acos function:
if it is less than -1, assign -1 to the value
if it is greater than 1, assign 1 to the value.
snippet code (before changing):
final term1 = sin(radians(h0)) -
(sin(radians(coordinates.latitude)) * sin(radians(delta2)));
final term2 = cos(radians(coordinates.latitude)) * cos(radians(delta2));
final H0 = degrees(acos(term1 / term2));
final m = afterTransit ? m0 + (H0 / 360) : m0 - (H0 / 360);
snippet code (after changing):
final term1 = sin(radians(h0)) -
(sin(radians(coordinates.latitude)) * sin(radians(delta2)));
final term2 = cos(radians(coordinates.latitude)) * cos(radians(delta2));
var y = term1 / term2;
if(y < -1.0) y = -1.0;
if(y > 1.0) y = 1.0;
final H0 = degrees(acos(y));
final m = afterTransit ? m0 + (H0 / 360) : m0 - (H0 / 360);
the exception is gone and it worked as expected, but i am not sure if the time given is correct or not?
from adhan-dart.
Have you found a solution? At the moment, the library throws an exception if the latitude is greater than 73 degrees
from adhan-dart.
final term1 = sin(radians(h0)) -
(sin(radians(coordinates.latitude)) * sin(radians(delta2)));
final term2 = cos(radians(coordinates.latitude)) * cos(radians(delta2));
var y = term1 / term2;
if(y < -1.0) y = -1.0;
if(y > 1.0) y = 1.0;
final H0 = degrees(acos(y));
final m = afterTransit ? m0 + (H0 / 360) : m0 - (H0 / 360);
Changes are causing tests to fail!
from adhan-dart.
Related Issues (20)
- Prayer timing is not correct for palestine[Bug]
- [Question]
- IQAMAH Time? HOT 1
- FormatException ishaAngle's value isn't define[Bug]
- LateInitializationError: Field 'prayerTimes' has not been initialized. HOT 9
- Exception with prayer times [Bug] HOT 7
- Issue in the asr at Calculation Method.turkey HOT 2
- [Bug] Update the package to support Dart 3 HOT 3
- Midnight calculation HOT 1
- Please add for the country of Iraq
- Adhan package Return wrong time on different timezone HOT 2
- Can we automize the calculation parameters? HOT 4
- [Feature] Add Ishraq, Chast Prayer Time
- [Bug] Wrong Next and Current Prayer Times HOT 2
- Wrong Fajar & Isha Time HOT 1
- [Bug] 🐞 Incorrect Dhuhr Prayer Time in Egypt
- [Feature] 🛠️ Testing Declaration in Main Readme
- Latitute bigger than 75 throws an exception HOT 6
- Wrong prayer time
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adhan-dart.