class MkSunmoon::Sunmoon

Attributes

alt[R]
day[R]
lat[R]
lon[R]
month[R]
year[R]

Public Class Methods

new(args) click to toggle source
# 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

Public Instance Methods

moon_mp() click to toggle source
月の南中(MOON MERIDIAN PASSAGE)
# File lib/mk_sunmoon/sunmoon.rb, line 55
def moon_mp
  return compute_moon(2)
end
moonrise() click to toggle source
月の出(MOONRISE)
# File lib/mk_sunmoon/sunmoon.rb, line 41
def moonrise
  return compute_moon(0)
end
moonset() click to toggle source
月の入(MOONSET)
# File lib/mk_sunmoon/sunmoon.rb, line 48
def moonset
  return compute_moon(1)
end
sun_mp() click to toggle source
日の南中(SUN MERIDIAN PASSAGE)
# File lib/mk_sunmoon/sunmoon.rb, line 34
def sun_mp
  return compute_sun(2)
end
sunrise() click to toggle source
日の出(SUNRISE)
# File lib/mk_sunmoon/sunmoon.rb, line 20
def sunrise
  return compute_sun(0)
end
sunset() click to toggle source
日の入(SUNSET)
# File lib/mk_sunmoon/sunmoon.rb, line 27
def sunset
  return compute_sun(1)
end