lib/kepler/param_helper.rb
# matrix to transform vectors with perifocal basis to vectors with
# geocentric equatorial basis
# all args are scalar
matrix to transform vectors with perifocal basis to vectors with
geocentric equatorial basis
all args are scalar
matrix to transform vectors with perifocal basis to vectors with geocentric equatorial basis all args are scalar
def transform_matrix(argument_of_periapsis, inclination, right_ascension)
      w = argument_of_periapsis.to_rad
      i = inclination.to_rad
      omega = right_ascension.to_rad
      sin_omega = Math.sin(omega)
      cos_omega = Math.cos(omega)
      sin_i = Math.sin(i)
      cos_i = Math.cos(i)
      sin_w = Math.sin(w)
      cos_w = Math.cos(w)
      Matrix[
        [-sin_omega * cos_i * sin_w + (cos_omega * cos_w),
         -sin_omega * cos_i * cos_w - (cos_omega * sin_w),
         sin_omega * sin_i],
        [cos_omega * cos_i * sin_w + (sin_omega * cos_w),
         cos_omega * cos_i * cos_w - (sin_omega * sin_w),
         -cos_omega * sin_i],
        [sin_i * sin_w,
         sin_i * cos_w,
         cos_i]
      ]
    end
def transform_matrix ( argument_of_periapsis , inclination , right_ascension ) w = argument_of_periapsis . to_rad i = inclination . to_rad omega = right_ascension . to_rad sin_omega = Math . sin ( omega ) cos_omega = Math . cos ( omega ) sin_i = Math . sin ( i ) cos_i = Math . cos ( i ) sin_w = Math . sin ( w ) cos_w = Math . cos ( w ) Matrix [ [ - sin_omega * cos_i * sin_w + ( cos_omega * cos_w ) , - sin_omega * cos_i * cos_w - ( cos_omega * sin_w ) , sin_omega * sin_i ] , [ cos_omega * cos_i * sin_w + ( sin_omega * cos_w ) , cos_omega * cos_i * cos_w - ( sin_omega * sin_w ) , - cos_omega * sin_i ] , [ sin_i * sin_w , sin_i * cos_w , cos_i ] ] end
matrix to transform vectors with perifocal basis to vectors with
geocentric equatorial basis
all args are scalar
matrix to transform vectors with perifocal basis to vectors with geocentric equatorial basis all args are scalar
argument_of_periapsis
inclination
right_ascension