@verb #1000:"sunset_sunrise" this none this rxdo #1177 @program #1000:"sunset_sunrise" this none this "Inputs the number of days since the winter Solstice, and returns the Sunset and Sunrise times for that evening (and the next morning) in seconds since 12:00AM, the length of the night time, and the offset of midnight from 12:00AM. All times are in seconds, and all data is exclusively calculated for Ottawa." alpha = args[1] * 360 / 365 nitetime = ($trig_utils:cos(alpha) * 405 / 2 + 7063000 + $trig_utils:cos(alpha * 3) * 15 / 2) * 60 / 20000 offset = ($trig_utils:sin(alpha) * 33 / 5 + $trig_utils:sin(alpha * 2) * 47 / 5 + 22000) * 60 / 10000 sunset = offset - nitetime sunrise = offset + nitetime return {sunset, sunrise, nitetime * 2, offset} .