Skip to content

Instantly share code, notes, and snippets.

@suchowan
Created January 5, 2024 06:30
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 suchowan/804aa9c6dfec58a7990bd8850921f0ce to your computer and use it in GitHub Desktop.
Save suchowan/804aa9c6dfec58a7990bd8850921f0ce to your computer and use it in GitHub Desktop.
require 'pp'
require 'when_exe'
include When
=begin
check script for https://suchowan.seesaa.net/article/201208article_19.html
=end
t1 = [1, 2].map {|n|
Ephemeris.root(23*n, 0) {|t|
129602768.13*t + 1.089*t*t - 1296000*(36525*t+n)/365.2425
}
}
pp [t1, t1.map {|t| t * 36525 / 365.2425}] # =>
#[[26.202582016460838, 45.39757221863828],
# [2620.312006820762, 4539.850442612136]]
t2 = [1, 2].map {|n|
Ephemeris.root(23*n, n) {|t|
36524.25*t - 100*t*(365.24219879 - 0.00000614*t / 2)
}
}
pp [t2, t2.map {|t| t * 36525 / 365.2425}] # =>
# [[26.202006554792032, 45.39535270102943],
# [2620.254459472211, 4539.628486293626]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment