Class: Astronoby::EarthRotation

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

Overview

Computes Earth rotation matrices using Greenwich Sidereal Time. Provides both apparent (GAST-based) and mean (GMST-based) rotation matrices for transforming between Earth-fixed and celestial frames.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instant:) ⇒ EarthRotation

Returns a new instance of EarthRotation.

Parameters:



27
28
29
# File 'lib/astronoby/earth_rotation.rb', line 27

def initialize(instant:)
  @instant = instant
end

Class Method Details

.matrix_for(instant) ⇒ Matrix

Computes the apparent Earth rotation matrix R₃(GAST) for a given instant.

Parameters:

Returns:

  • (Matrix)

    3x3 Earth rotation matrix



13
14
15
# File 'lib/astronoby/earth_rotation.rb', line 13

def self.matrix_for(instant)
  new(instant: instant).matrix
end

.mean_matrix_for(instant) ⇒ Matrix

Computes the mean Earth rotation matrix R₃(GMST) for a given instant.

Parameters:

Returns:

  • (Matrix)

    3x3 mean Earth rotation matrix



22
23
24
# File 'lib/astronoby/earth_rotation.rb', line 22

def self.mean_matrix_for(instant)
  new(instant: instant).mean_matrix
end

Instance Method Details

#matrixMatrix

Computes R₃(GAST), the apparent Earth rotation matrix. GAST = GMST + equation of the equinoxes (Δψ cos ε₀).

Returns:

  • (Matrix)

    3x3 rotation matrix



35
36
37
# File 'lib/astronoby/earth_rotation.rb', line 35

def matrix
  rotation_matrix_for(gast)
end

#mean_matrixMatrix

Computes R₃(GMST), the mean Earth rotation matrix.

Returns:

  • (Matrix)

    3x3 rotation matrix



42
43
44
# File 'lib/astronoby/earth_rotation.rb', line 42

def mean_matrix
  rotation_matrix_for(gmst)
end