Closed rhannequin closed 8 months ago
This implements #rising_time and #setting_time on Astronoby::Sun. As they are named, they return times (Time) of sunrise and sunset in UTC.
#rising_time
#setting_time
Astronoby::Sun
Time
From my tests, the closest I can get from times computes by the IMCCE are within 30 seconds to 2 minutes of precision.
date = Date.new(1991, 3, 14) epoch = Astronoby::Epoch.from_time(date) observer = Astronoby::Observer.new( latitude: Astronoby::Angle.as_degrees(48.8566), longitude: Astronoby::Angle.as_degrees(2.3522) ) sun = Astronoby::Sun.new(epoch: epoch) sun.rising_time(observer: observer) # => 1991-03-14 06:08:16 UTC sun.setting_time(observer: observer) # => 1991-03-14 17:50:37 UTC
This implements
#rising_time
and#setting_time
onAstronoby::Sun
. As they are named, they return times (Time
) of sunrise and sunset in UTC.From my tests, the closest I can get from times computes by the IMCCE are within 30 seconds to 2 minutes of precision.