Class: Astronoby::MoonOrientationEphemeris

Inherits:
Object
  • Object
show all
Defined in:
lib/astronoby/moon_orientation_ephemeris.rb

Overview

Computes the Moon’s libration and the position angle of its axis from a binary PCK lunar orientation kernel, as the arcsecond-accurate counterpart to the analytic Meeus series in MoonPhysicalEphemeris.

The libration is the selenographic longitude and latitude of the sub-Earth point, expressed in the Moon’s mean-Earth body-fixed frame.

Instance Method Summary collapse

Constructor Details

#initialize(moon) ⇒ MoonOrientationEphemeris

Returns a new instance of MoonOrientationEphemeris.

Parameters:



12
13
14
15
16
# File 'lib/astronoby/moon_orientation_ephemeris.rb', line 12

def initialize(moon)
  @moon = moon
  @instant = moon.instant
  @orientation = moon.orientation
end

Instance Method Details

#librationAstronoby::Libration

Returns the libration in longitude and latitude.

Returns:



19
20
21
22
23
24
25
26
27
# File 'lib/astronoby/moon_orientation_ephemeris.rb', line 19

def libration
  sub_earth = rotation * moon_to_earth
  Libration.new(
    longitude: Angle.from_radians(Math.atan2(sub_earth[1], sub_earth[0])),
    latitude: Angle.from_radians(
      Math.asin(sub_earth[2] / sub_earth.magnitude)
    )
  )
end

#position_angle_of_axisAstronoby::Angle

Position angle of the Moon’s axis of rotation, measured eastward from the north point of the disk.

Returns:



32
33
34
# File 'lib/astronoby/moon_orientation_ephemeris.rb', line 32

def position_angle_of_axis
  @moon.apparent.equatorial.position_angle_to(north_pole)
end