class MkGreenwich::EraEors

Class for
  ERA(Earth rotation angle (IAU 2000 model), 地球回転角),
  EORS(Equation of the origins, 原点差)
  GMST(Greenwich mean sidereal time, グリニッジ平均恒星時)
  GAST(Greenwich apparent sidereal time, グリニッジ視恒星時)
  EE(Equation of Equinoxes, 分点均差)

Public Class Methods

new(jd) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 16
def initialize(jd)
  @jd, @t = jd, jd - Const::J2000  # JD, JD2000.0
end

Public Instance Methods

calc_ee(gast, gmst) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 95
def calc_ee(gast, gmst)
  return gast - gmst
rescue => e
  raise
end
calc_eo(r_mtx, s) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 43
def calc_eo(r_mtx, s)
  x = r_mtx[2][0]
  ax = x / (1.0 + r_mtx[2][2])
  xs = 1.0 - ax * x
  ys = -ax * r_mtx[2][1]
  zs = -x
  p = r_mtx[0][0] * xs + r_mtx[0][1] * ys + r_mtx[0][2] * zs
  q = r_mtx[1][0] * xs + r_mtx[1][1] * ys + r_mtx[1][2] * zs
  return (p != 0 || q != 0) ? s - Math.atan2(q, p) : s
rescue => e
  raise
end
calc_era(jd, t) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 26
def calc_era(jd, t)
  # Fractional part of T (days).
  f = jd % 1.0
  # Earth rotation angle at this UT1.
  return norm_angle((f + 0.7790572732640 + 0.00273781191135448 * t) * Const::PI2)
rescue => e
  raise
end
calc_gast(era, eo) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 63
def calc_gast(era, eo)
  return norm_angle(era - eo)
rescue => e
  raise
end
calc_gmst(gast, t) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 76
def calc_gmst(gast, t)
  return norm_angle(gast +
    (   0.014506    + \
    (4612.156534    + \
    (   1.3915817   + \
    (  -0.00000044  + \
    (  -0.000029956 + \
    (  -0.0000000368) \
    * t) * t) * t) * t) * t) * Const::AS2R)
rescue => e
  raise
end
norm_angle(angle) click to toggle source
# File lib/mk_greenwich/era_eors.rb, line 107
def norm_angle(angle)
  while angle < 0;          angle += Const::PI2; end
  while angle > Const::PI2; angle -= Const::PI2; end
  return angle
rescue => e
  raise
end