class Zakuro::Senmyou::Monthly::LunarPhase
LunarPhase
月の位相
Constants
- QUARTER
@return [Cycle::Remainder] 弦
Public Class Methods
new(western_year:)
click to toggle source
初期化
@param [Integer] western_year 西暦年
Calls superclass method
Zakuro::Calculation::Monthly::AbstractLunarPhase::new
# File lib/zakuro/version/senmyou/monthly/lunar_phase.rb, line 33 def initialize(western_year:) # 天正閏余 lunar_age = Origin::LunarAge.get(western_year: western_year) super( quater: QUARTER, average_remainder: Origin::AverageNovember.get(western_year: western_year), solar_location: Solar::Location.new(lunar_age: lunar_age), lunar_location: Lunar::Location.new( western_year: western_year, lunar_age: Cycle::LunarRemainder.new(total: 0).add!(lunar_age) ) ) end
Private Instance Methods
correction_moon_value()
click to toggle source
月運動の補正値を得る
@return [Integer] 月運動の補正値
# File lib/zakuro/version/senmyou/monthly/lunar_phase.rb, line 91 def correction_moon_value @lunar_location.run remainder = @lunar_location.adjusted_remainder forward = @lunar_location.forward debug("[lunar]remainder.format: #{remainder.format}") debug("[lunar]forward: #{forward}") Lunar::Value.get(remainder: remainder, forward: forward) end
correction_solar_value()
click to toggle source
太陽運動の補正値を得る
@return [Integer] 太陽運動の補正値
# File lib/zakuro/version/senmyou/monthly/lunar_phase.rb, line 76 def correction_solar_value @solar_location.run debug("@solar_term.remainder: #{@solar_location.remainder.format(form: '%d-%d.%d')}") debug("@solar_term.index: #{@solar_location.index}") Solar::Value.get(solar_location: @solar_location) end
current_remainder()
click to toggle source
現在の定朔を取得する
@return [Remainder] 定朔
# File lib/zakuro/version/senmyou/monthly/lunar_phase.rb, line 57 def current_remainder debug("@average_remainder.format: #{@average_remainder.format}") sum = correction_value adjusted = @average_remainder.add( Cycle::Remainder.new(day: 0, minute: sum, second: 0) ) adjusted.up_on_new_moon! debug("result: #{adjusted.format}") adjusted end