Class: Astronoby::Deflection

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

Constant Summary collapse

SOLAR_GRAVITATION_CONSTANT =

Solar gravitational constant (m^3/s^2)

1.32712440017987e+20

Instance Method Summary collapse

Constructor Details

#initialize(instant:, target_astrometric_position:, ephem:) ⇒ Deflection

Returns a new instance of Deflection.

Parameters:

  • instant (Astronoby::Instant)

    the instant of the observation

  • target_astrometric_position (Astronoby::Vector<Distance>)

    the astrometric position of the target

  • ephem (Astronoby::Ephemeris)

    the ephemeris to use for the computation



13
14
15
16
17
# File 'lib/astronoby/deflection.rb', line 13

def initialize(instant:, target_astrometric_position:, ephem:)
  @instant = instant
  @target_astrometric_position = target_astrometric_position
  @ephem = ephem
end

Instance Method Details

#corrected_positionAstronoby::Vector<Distance>

Returns corrected position of the target.

Returns:



20
21
22
23
24
25
# File 'lib/astronoby/deflection.rb', line 20

def corrected_position
  Astronoby::Vector[
    *(target_position + deflection_vector)
      .map { |au| Astronoby::Distance.from_au(au) }
  ]
end