Class: Astronoby::MoonOrientationEphemeris
- Inherits:
-
Object
- Object
- Astronoby::MoonOrientationEphemeris
- 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
-
#initialize(moon) ⇒ MoonOrientationEphemeris
constructor
A new instance of MoonOrientationEphemeris.
-
#libration ⇒ Astronoby::Libration
The libration in longitude and latitude.
-
#position_angle_of_axis ⇒ Astronoby::Angle
Position angle of the Moon’s axis of rotation, measured eastward from the north point of the disk.
Constructor Details
#initialize(moon) ⇒ MoonOrientationEphemeris
Returns a new instance of MoonOrientationEphemeris.
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
#libration ⇒ Astronoby::Libration
Returns the libration in longitude and latitude.
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_axis ⇒ Astronoby::Angle
Position angle of the Moon’s axis of rotation, measured eastward from the north point of the disk.
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 |