batoulapps / adhan-js

High precision Islamic prayer time library for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Altitude Support

Zalanshah64 opened this issue · comments

Some scholars (one of whom specifically told me this) are very strict and explicitly want to see the sun go down. When on a plane or at very high altitudes, this would result in the sun setting later.

Does this library feature support for altitudes in its calculations? If so, how? If not, are there any plans to add support for this?

Most phones have altimeters today, which would directly aid in this calculation.

Altitude is tricky as it only has an effect when the altitude of the observer differs from the altitude of the horizon, for example being on mountain peak. But if the city you live in has a high altitude in all locations it has no effect.

Here is a good explanation of the apparent effects of altitude on sunrise https://astronomy.stackexchange.com/questions/24632/how-do-i-adjust-the-sunrise-equation-to-account-for-elevation

So in addition to knowing the user's altitude, we would need to know the altitude of the horizon which is much harder to know. For this reason altitude is not something that has been added to this library.