Skip to content

Instantly share code, notes, and snippets.

@DouglasAllen
Last active June 2, 2017 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DouglasAllen/8e3e69641e25fd5ef0f620c7f6f8d6ad to your computer and use it in GitHub Desktop.
Save DouglasAllen/8e3e69641e25fd5ef0f620c7f6f8d6ad to your computer and use it in GitHub Desktop.
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