Class: MkSunmoon::Sunmoon
- Inherits:
-
Object
- Object
- MkSunmoon::Sunmoon
- Includes:
- Compute
- Defined in:
- lib/mk_sunmoon/sunmoon.rb
Instance Attribute Summary collapse
-
#alt ⇒ Object
readonly
Returns the value of attribute alt.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#lat ⇒ Object
readonly
Returns the value of attribute lat.
-
#lon ⇒ Object
readonly
Returns the value of attribute lon.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(args) ⇒ Sunmoon
constructor
A new instance of Sunmoon.
-
#moon_mp ⇒ Object
月の南中(MOON MERIDIAN PASSAGE) =========================================================================.
-
#moonrise ⇒ Object
月の出(MOONRISE) =========================================================================.
-
#moonset ⇒ Object
月の入(MOONSET) =========================================================================.
-
#sun_mp ⇒ Object
日の南中(SUN MERIDIAN PASSAGE) =========================================================================.
-
#sunrise ⇒ Object
日の出(SUNRISE) =========================================================================.
-
#sunset ⇒ Object
日の入(SUNSET) =========================================================================.
Methods included from Compute
compute_angle_ecliptic, compute_angle_equator, compute_beta_moon, compute_diff_moon, compute_dist_sun, compute_dt, compute_height_ecliptic, compute_height_equator, compute_hour_angle_diff, compute_lambda_moon, compute_lambda_sun, compute_moon, compute_sidereal_time, compute_sun, compute_time_moon, compute_time_sun, eclip2equat, gc2jd, norm_angle, val2hhmmss
Constructor Details
#initialize(args) ⇒ Sunmoon
Returns a new instance of Sunmoon.
9 10 11 12 13 14 15 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 9 def initialize(args) @year, @month, @day, @lat, @lon, @alt = args @jd = gc2jd(year, month, day) @jd_jst = @jd + Const::OFFSET_JST @dt = compute_dt(year, month, day) @incl = Const::INCLINATION * Math.sqrt(@alt) end |
Instance Attribute Details
#alt ⇒ Object (readonly)
Returns the value of attribute alt.
5 6 7 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 5 def alt @alt end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
5 6 7 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 5 def day @day end |
#lat ⇒ Object (readonly)
Returns the value of attribute lat.
5 6 7 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 5 def lat @lat end |
#lon ⇒ Object (readonly)
Returns the value of attribute lon.
5 6 7 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 5 def lon @lon end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
5 6 7 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 5 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 5 def year @year end |
Instance Method Details
#moon_mp ⇒ Object
月の南中(MOON MERIDIAN PASSAGE)
55 56 57 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 55 def moon_mp return compute_moon(2) end |
#moonrise ⇒ Object
月の出(MOONRISE)
41 42 43 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 41 def moonrise return compute_moon(0) end |
#moonset ⇒ Object
月の入(MOONSET)
48 49 50 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 48 def moonset return compute_moon(1) end |
#sun_mp ⇒ Object
日の南中(SUN MERIDIAN PASSAGE)
34 35 36 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 34 def sun_mp return compute_sun(2) end |
#sunrise ⇒ Object
日の出(SUNRISE)
20 21 22 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 20 def sunrise return compute_sun(0) end |
#sunset ⇒ Object
日の入(SUNSET)
27 28 29 |
# File 'lib/mk_sunmoon/sunmoon.rb', line 27 def sunset return compute_sun(1) end |