Class: Astronoby::Nutation

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(epoch) ⇒ Nutation

Source:

Title: Practical Astronomy with your Calculator or Spreadsheet
Authors: Peter Duffett-Smith and Jonathan Zwart
Edition: Cambridge University Press
Chapter: 35 - Nutation


11
12
13
# File 'lib/astronoby/nutation.rb', line 11

def initialize(epoch)
  @epoch = epoch
end

Class Method Details

.for_ecliptic_longitude(epoch:) ⇒ Object



15
16
17
# File 'lib/astronoby/nutation.rb', line 15

def self.for_ecliptic_longitude(epoch:)
  new(epoch).for_ecliptic_longitude
end

.for_obliquity_of_the_ecliptic(epoch:) ⇒ Object



19
20
21
# File 'lib/astronoby/nutation.rb', line 19

def self.for_obliquity_of_the_ecliptic(epoch:)
  new(epoch).for_obliquity_of_the_ecliptic
end

Instance Method Details

#for_ecliptic_longitudeObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/astronoby/nutation.rb', line 23

def for_ecliptic_longitude
  Angle.from_dms(
    0,
    0,
    (
      -17.2 * moon_ascending_node_longitude.sin -
      1.3 * Math.sin(2 * sun_mean_longitude.radians)
    )
  )
end

#for_obliquity_of_the_eclipticObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/astronoby/nutation.rb', line 34

def for_obliquity_of_the_ecliptic
  Angle.from_dms(
    0,
    0,
    (
      9.2 * moon_ascending_node_longitude.cos +
      0.5 * Math.cos(2 * sun_mean_longitude.radians)
    )
  )
end