Class: MkSunmoon::Sunmoon

Inherits:
Object
  • Object
show all
Includes:
Compute
Defined in:
lib/mk_sunmoon/sunmoon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#altObject (readonly)

Returns the value of attribute alt.



5
6
7
# File 'lib/mk_sunmoon/sunmoon.rb', line 5

def alt
  @alt
end

#dayObject (readonly)

Returns the value of attribute day.



5
6
7
# File 'lib/mk_sunmoon/sunmoon.rb', line 5

def day
  @day
end

#latObject (readonly)

Returns the value of attribute lat.



5
6
7
# File 'lib/mk_sunmoon/sunmoon.rb', line 5

def lat
  @lat
end

#lonObject (readonly)

Returns the value of attribute lon.



5
6
7
# File 'lib/mk_sunmoon/sunmoon.rb', line 5

def lon
  @lon
end

#monthObject (readonly)

Returns the value of attribute month.



5
6
7
# File 'lib/mk_sunmoon/sunmoon.rb', line 5

def month
  @month
end

#yearObject (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_mpObject

月の南中(MOON MERIDIAN PASSAGE)



55
56
57
# File 'lib/mk_sunmoon/sunmoon.rb', line 55

def moon_mp
  return compute_moon(2)
end

#moonriseObject

月の出(MOONRISE)



41
42
43
# File 'lib/mk_sunmoon/sunmoon.rb', line 41

def moonrise
  return compute_moon(0)
end

#moonsetObject

月の入(MOONSET)



48
49
50
# File 'lib/mk_sunmoon/sunmoon.rb', line 48

def moonset
  return compute_moon(1)
end

#sun_mpObject

日の南中(SUN MERIDIAN PASSAGE)



34
35
36
# File 'lib/mk_sunmoon/sunmoon.rb', line 34

def sun_mp
  return compute_sun(2)
end

#sunriseObject

日の出(SUNRISE)



20
21
22
# File 'lib/mk_sunmoon/sunmoon.rb', line 20

def sunrise
  return compute_sun(0)
end

#sunsetObject

日の入(SUNSET)



27
28
29
# File 'lib/mk_sunmoon/sunmoon.rb', line 27

def sunset
  return compute_sun(1)
end