udivankin / sunrise-sunset

Sunrise and sunset time calculation for given coordinates. ~1kb minified with zero dependencies.
74 stars 17 forks source link

Innaccuracies at extreme latitudes #17

Open markmcconnell opened 3 years ago

markmcconnell commented 3 years ago

During calculate(), when cosLocalHourAngle > 1 or < -1, then the sun does not actually rise or set at the location on the given day. It would be nice if the library provided some optional way to detect this, perhaps by returning null or throwing an error in these conditions.

Otherwise, this is perfect. Thank you.