Class: When::Ephemeris::Moon

Inherits:
Datum show all
Extended by:
When::Ephemeris
Defined in:
lib/when_exe/ephemeris/moon.rb

Overview

The Moon

Constant Summary

Constants included from When::Ephemeris

AU, AcS, BCENT, C0, CIRCLE, COS, COSL, COSLT, COST, DAY, DEG, EPOCH1800, EPOCH1900, EPOCH1975, EPOCH2000, FARAWAY, JCENT, JYEAR, Jupiter, LIN, Mars, Mercury, Neptune, PSEC, Pluto, SIN, SINL, SINLT, SINT, Saturn, Uranus, Venus

Constants included from Namespace

Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD

Instance Attribute Summary

Attributes inherited from Datum

#air, #axis, #dl, #first_day, #jsl, #jsn, #jsr, #jst, #last_day, #nn, #phi, #radius, #shape, #sid, #surface_radius, #theta, #zeros

Attributes inherited from CelestialObject

#aberration, #luminosity

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#child, #keys, #locale, #namespace

Class Method Summary collapse

Instance Method Summary collapse

Methods included from When::Ephemeris

_adjust, _rot, _to_p2, _to_p3, _to_r3, acos, asin, cosc, cosd, delta_e, delta_p, julian_century_from_2000, julian_year_from_1975, obl, polynomial, root, sinc, sind, tanc, tand, trigonometric

Methods inherited from Datum

#apparent_luminosity, #apparent_radius, #axis_of_rotation, #elongation, #equation_of_time, #phase_of_eclipse

Methods inherited from CelestialObject

#coords

Methods included from Parts::Resource

#[], #^, _instance, _setup_, _setup_info, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_setup_

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Parts::Resource

Class Method Details

.latitude(t) ⇒ Numeric

月の真黄緯/ CIRCLE

Parameters:

Returns:



208
209
210
211
# File 'lib/when_exe/ephemeris/moon.rb', line 208

def latitude(t)
  y = julian_year_from_1975(+t)
  return trigonometric(y, P0B, trigonometric(y, P0dB)) / 360.0
end

.mean_longitude(t) ⇒ Numeric

月の平均黄経 / CIRCLE

Parameters:

Returns:



231
232
233
# File 'lib/when_exe/ephemeris/moon.rb', line 231

def mean_longitude(t)
  return trigonometric(julian_year_from_1975(+t), P0L, 0.0, 1) / 360.0 + 38770.0
end

.pi(t) ⇒ Numeric

月の距離 / km

Parameters:

Returns:



220
221
222
# File 'lib/when_exe/ephemeris/moon.rb', line 220

def pi(t)
  return 6378.14 / ((trigonometric(julian_year_from_1975(+t), P0P) + 0.9507)*DEG)
end

.true_longitude(t) ⇒ Numeric

月の真黄経 / CIRCLE

Parameters:

Returns:



196
197
198
199
# File 'lib/when_exe/ephemeris/moon.rb', line 196

def true_longitude(t)
  y = julian_year_from_1975(+t)
  return trigonometric(y, P0L, sind(trigonometric(y, P0dL))) / 360.0 + 38770.0
end

Instance Method Details

#_coords(t) ⇒ When::Ephemeris::Coords

月の位置 (黄道座標)

Parameters:

Returns:



243
244
245
246
247
248
249
250
# File 'lib/when_exe/ephemeris/moon.rb', line 243

def _coords(t)
  t  = +t
  Coords.polar(Moon.true_longitude(t),
               Moon.latitude(t),
               Moon.pi(t)/AU,
               Moon.mean_longitude(t)) +
  When.Resource('_ep:Earth')._coords(t)
end

#mean_longitude(t) ⇒ Numeric

平均黄経 / CIRCLE

Parameters:

Returns:



270
271
272
# File 'lib/when_exe/ephemeris/moon.rb', line 270

def mean_longitude(t)
  Moon.mean_longitude(t)
end

#mean_motionNumeric

平均運動 / (DEG/YEAR)

Returns:



278
279
280
# File 'lib/when_exe/ephemeris/moon.rb', line 278

def mean_motion
  P0L[0][2]
end

#true_longitude(t) ⇒ Numeric

真黄経 / CIRCLE

Parameters:

Returns:



259
260
261
# File 'lib/when_exe/ephemeris/moon.rb', line 259

def true_longitude(t)
  Moon.true_longitude(t)
end