Module: Sekki24::Lunar::Moon

Defined in:
lib/sekki24/lunar/moon.rb

Constant Summary collapse

J2000 =
2_451_545.0
JULIAN_CENTURY =
36_525.0
DEGREES_TO_RADIANS =
Math::PI / 180.0

Class Method Summary collapse

Class Method Details

.longitude(jde) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/sekki24/lunar/moon.rb', line 15

def longitude(jde)
  centuries = (Float(jde) - J2000) / JULIAN_CENTURY
  arguments = fundamental_arguments(centuries)
  correction = periodic_correction(arguments, centuries) + additive_correction(arguments, centuries)

  (arguments.fetch(:moon_longitude) + correction + Nutation.longitude(jde)) % 360.0
end