Last active
June 2, 2017 17:00
-
-
Save DouglasAllen/8e3e69641e25fd5ef0f620c7f6f8d6ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
date = DateTime.now | |
jd = date.jd | |
t = (jd - 2_451_545.0) / 36_525.0 | |
ma = [1287104.793048, 129596581.0481, - 0.5532, 0.000136, - 0.00001149] | |
@horner = lambda { |t, abc| | |
abc.each_with_index.reduce(0){|a, (e, i)| a + e * t**i} | |
} | |
@horner.call(t, ma) / 3600 % 360 | |
# http://www.iausofa.org/2017_0420_C/sofa/falp03.c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment