zakuro 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zakuro/calculation/cycle/abstract_remainder.rb +12 -0
- data/lib/zakuro/calculation/range/full_range.rb +1 -1
- data/lib/zakuro/version.rb +1 -1
- data/lib/zakuro/version/senmyou/const/number.rb +51 -0
- data/lib/zakuro/version/senmyou/const/remainder.rb +43 -0
- data/lib/zakuro/version/senmyou/cycle/remainder.rb +4 -6
- data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +35 -54
- data/lib/zakuro/version/senmyou/range/annual_range.rb +9 -65
- data/lib/zakuro/version/senmyou/stella/lunar/adjustment.rb +237 -0
- data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +45 -0
- data/lib/zakuro/version/senmyou/stella/lunar/location.rb +108 -0
- data/lib/zakuro/version/senmyou/stella/lunar/value.rb +89 -0
- data/lib/zakuro/version/senmyou/stella/origin/average_november.rb +34 -0
- data/lib/zakuro/version/senmyou/stella/origin/lunar_age.rb +62 -0
- data/lib/zakuro/version/senmyou/stella/origin/winter_solstice.rb +55 -0
- data/lib/zakuro/version/senmyou/stella/solar/adjustment.rb +93 -0
- data/lib/zakuro/version/senmyou/stella/solar/average.rb +175 -0
- data/lib/zakuro/version/senmyou/stella/solar/interval.rb +103 -0
- data/lib/zakuro/version/senmyou/stella/solar/location.rb +164 -0
- data/lib/zakuro/version/senmyou/stella/solar/value.rb +138 -0
- metadata +20 -11
- data/lib/zakuro/version/senmyou/stella/lunar_orbit.rb +0 -332
- data/lib/zakuro/version/senmyou/stella/solar_average.rb +0 -169
- data/lib/zakuro/version/senmyou/stella/solar_location.rb +0 -213
- data/lib/zakuro/version/senmyou/stella/solar_orbit.rb +0 -213
- data/lib/zakuro/version/senmyou/stella/winter_solstice.rb +0 -106
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative './lunar_age'
|
4
|
+
require_relative './winter_solstice'
|
5
|
+
|
6
|
+
# :nodoc:
|
7
|
+
module Zakuro
|
8
|
+
# :nodoc:
|
9
|
+
module Senmyou
|
10
|
+
# :nodoc:
|
11
|
+
module Origin
|
12
|
+
#
|
13
|
+
# AverageNovember 11月経
|
14
|
+
#
|
15
|
+
module AverageNovember
|
16
|
+
#
|
17
|
+
# 11月経朔(冬至が含まれる月の1日)を求める
|
18
|
+
#
|
19
|
+
# @param [Integer] western_year 西暦年
|
20
|
+
#
|
21
|
+
# @return [Remainder] 11月経朔
|
22
|
+
#
|
23
|
+
def self.get(western_year:)
|
24
|
+
# 冬至
|
25
|
+
winter_solstice = WinterSolstice.get(western_year: western_year)
|
26
|
+
# 天正閏余
|
27
|
+
lunar_age = LunarAge.get(western_year: western_year)
|
28
|
+
|
29
|
+
winter_solstice.sub(lunar_age)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../../../output/logger'
|
4
|
+
|
5
|
+
require_relative '../../const/number'
|
6
|
+
|
7
|
+
# :nodoc:
|
8
|
+
module Zakuro
|
9
|
+
# :nodoc:
|
10
|
+
module Senmyou
|
11
|
+
# :nodoc:
|
12
|
+
module Origin
|
13
|
+
#
|
14
|
+
# LunarAge 天正閏余
|
15
|
+
#
|
16
|
+
module LunarAge
|
17
|
+
# @return [Integer] 朔望月
|
18
|
+
SYNODIC_MONTH = Const::Number::Cycle::SYNODIC_MONTH
|
19
|
+
# @return [Integer] 一年
|
20
|
+
YEAR = Const::Number::Cycle::YEAR
|
21
|
+
# @return [Integer] 積年
|
22
|
+
TOTAL_YEAR = Const::Number::Stack::TOTAL_YEAR
|
23
|
+
# @return [Integer] 暦の開始年
|
24
|
+
BEGIN_YEAR = Const::Number::Stack::BEGIN_YEAR
|
25
|
+
|
26
|
+
# @return [Output::Logger] ロガー
|
27
|
+
LOGGER = Output::Logger.new(location: 'lunar_age')
|
28
|
+
|
29
|
+
# :reek:TooManyStatements { max_statements: 7 }
|
30
|
+
|
31
|
+
#
|
32
|
+
# 対象年の天正閏余(冬至より前にある11月経朔との差 = 月齢)を算出する
|
33
|
+
# 太陽と月の運動による補正値を算出し、その補正結果を返す
|
34
|
+
#
|
35
|
+
# @param [Integer] western_year 西暦年
|
36
|
+
#
|
37
|
+
# @return [Remainder] 天正閏余
|
38
|
+
#
|
39
|
+
def self.get(western_year:)
|
40
|
+
# 積年の開始から対象年までの年数
|
41
|
+
total = TOTAL_YEAR + western_year - BEGIN_YEAR
|
42
|
+
|
43
|
+
# 12朔望月に対する1年の余り(単位:分)
|
44
|
+
remainder_minute = YEAR - (SYNODIC_MONTH * 12)
|
45
|
+
|
46
|
+
# 朔望月に含まれなかった余り(単位:年)
|
47
|
+
remainder_year = total % SYNODIC_MONTH
|
48
|
+
|
49
|
+
LOGGER.debug("[01]: #{remainder_year}")
|
50
|
+
|
51
|
+
# 天正閏余
|
52
|
+
lunar_age = remainder_minute * remainder_year % SYNODIC_MONTH
|
53
|
+
|
54
|
+
LOGGER.debug("[02]: #{lunar_age}")
|
55
|
+
|
56
|
+
# 大余・小余に変換する
|
57
|
+
Cycle::Remainder.new(total: lunar_age)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../../../output/logger'
|
4
|
+
|
5
|
+
require_relative '../../const/number'
|
6
|
+
|
7
|
+
# :nodoc:
|
8
|
+
module Zakuro
|
9
|
+
# :nodoc:
|
10
|
+
module Senmyou
|
11
|
+
# :nodoc:
|
12
|
+
module Origin
|
13
|
+
#
|
14
|
+
# WinterSolstice 冬至
|
15
|
+
#
|
16
|
+
module WinterSolstice
|
17
|
+
# @return [Integer] 通余
|
18
|
+
REMAINDER_ALL_YEAR = Const::Number::Derivation::REMAINDER_ALL_YEAR
|
19
|
+
# @return [Integer] 60日
|
20
|
+
SIXTY_DAYS = Const::Number::Derivation::SIXTY_DAYS
|
21
|
+
# @return [Integer] 積年
|
22
|
+
TOTAL_YEAR = Const::Number::Stack::TOTAL_YEAR
|
23
|
+
# @return [Integer] 暦の開始年
|
24
|
+
BEGIN_YEAR = Const::Number::Stack::BEGIN_YEAR
|
25
|
+
|
26
|
+
# @return [Output::Logger] ロガー
|
27
|
+
LOGGER = Output::Logger.new(location: 'winter_solstice')
|
28
|
+
|
29
|
+
# :reek:TooManyStatements { max_statements: 6 }
|
30
|
+
|
31
|
+
#
|
32
|
+
# 対象年の前年の冬至を求める
|
33
|
+
#
|
34
|
+
# @param [Integer] western_year 西暦年
|
35
|
+
#
|
36
|
+
# @return [Remainder] 前年の冬至
|
37
|
+
#
|
38
|
+
def self.get(western_year:)
|
39
|
+
# 積年の開始から対象年までの年数
|
40
|
+
total = TOTAL_YEAR + western_year - BEGIN_YEAR
|
41
|
+
remainder_year = total % SIXTY_DAYS
|
42
|
+
|
43
|
+
LOGGER.debug("[01]:#{remainder_year}")
|
44
|
+
|
45
|
+
# 通余を使う
|
46
|
+
winter_solstice_minute = (remainder_year * REMAINDER_ALL_YEAR) % SIXTY_DAYS
|
47
|
+
|
48
|
+
LOGGER.debug("[02]:#{winter_solstice_minute}")
|
49
|
+
|
50
|
+
Cycle::Remainder.new(total: winter_solstice_minute)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../cycle/solar_term'
|
4
|
+
|
5
|
+
require_relative '../../const/number'
|
6
|
+
|
7
|
+
# :nodoc:
|
8
|
+
module Zakuro
|
9
|
+
# :nodoc:
|
10
|
+
module Senmyou
|
11
|
+
# :nodoc:
|
12
|
+
module Solar
|
13
|
+
#
|
14
|
+
# Adjustment 24気損益眺朒(ちょうじく)数
|
15
|
+
#
|
16
|
+
module Adjustment
|
17
|
+
#
|
18
|
+
# Item 24気損益眺朒(ちょうじく)数
|
19
|
+
#
|
20
|
+
class Item
|
21
|
+
# @return [Integer] 眺朒(ちょうじく)積
|
22
|
+
attr_reader :stack
|
23
|
+
# @return [Integer] 眺朒(ちょうじく)数
|
24
|
+
attr_reader :per_term
|
25
|
+
# @return [Integer] 毎日差
|
26
|
+
attr_reader :per_day
|
27
|
+
|
28
|
+
#
|
29
|
+
# 初期化
|
30
|
+
#
|
31
|
+
# @param [Integer] stack 眺朒(ちょうじく)積
|
32
|
+
# @param [Integer] per_term 眺朒(ちょうじく)数
|
33
|
+
# @param [Integer] per_day 毎日差
|
34
|
+
#
|
35
|
+
def initialize(stack:, per_term:, per_day:)
|
36
|
+
@stack = stack
|
37
|
+
@per_term = per_term
|
38
|
+
@per_day = per_day
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# 文字化
|
43
|
+
#
|
44
|
+
# @return [String] 文字
|
45
|
+
#
|
46
|
+
def to_s
|
47
|
+
"stack:#{@stack}, per_term:#{@per_term}, per_day:#{@per_day}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# @return [Array<Item>] 24気損益眺朒(ちょうじく)数
|
52
|
+
MAP = {
|
53
|
+
touji: Item.new(stack: 0.0, per_term: +33.4511, per_day: -0.3695), # 冬至(とうじ)
|
54
|
+
shoukan: Item.new(stack: +449.0, per_term: +28.0389, per_day: -0.3606), # 小寒(しょうかん)
|
55
|
+
daikan: Item.new(stack: +823.0, per_term: +22.6998, per_day: -0.3519), # 大寒(だいかん)
|
56
|
+
risshun: Item.new(stack: +1122.0, per_term: +17.8923, per_day: -0.4068), # 立春(りっしゅん)
|
57
|
+
usui: Item.new(stack: +1346.0, per_term: +11.7966, per_day: -0.3998), # 雨水(うすい)
|
58
|
+
keichitsu: Item.new(stack: +1481.0, per_term: +5.7986, per_day: -0.3998), # 啓蟄(けいちつ)
|
59
|
+
shunbun: Item.new(stack: +1526.0, per_term: -0.2433, per_day: -0.3779), # 春分(しゅんぶん)
|
60
|
+
seimei: Item.new(stack: +1481.0, per_term: -6.1254, per_day: -0.3634), # 清明(せいめい)
|
61
|
+
kokuu: Item.new(stack: +1346.0, per_term: -12.2048, per_day: -0.2987), # 穀雨(こくう)
|
62
|
+
rikka: Item.new(stack: +1122.0, per_term: -16.9060, per_day: -0.2919), # 立夏(りっか)
|
63
|
+
shouman: Item.new(stack: +823.0, per_term: -21.5362, per_day: -0.2854), # 小満(しょうまん)
|
64
|
+
boushu: Item.new(stack: +449.0, per_term: -26.0498, per_day: -0.2854), # 芒種(ぼうしゅ)
|
65
|
+
geshi: Item.new(stack: 0.0, per_term: -30.3119, per_day: +0.2854), # 夏至(げし)
|
66
|
+
shousho: Item.new(stack: -449.0, per_term: -25.8126, per_day: +0.2919), # 小暑(しょうしょ)
|
67
|
+
taisho: Item.new(stack: -823.0, per_term: -21.2454, per_day: +0.2987), # 大暑(たいしょ)
|
68
|
+
risshuu: Item.new(stack: -1122.0, per_term: -17.0296, per_day: +0.3634), # 立秋(りっしゅう)
|
69
|
+
shosho: Item.new(stack: -1346.0, per_term: -11.4744, per_day: +0.3779), # 処暑(しょしょ)
|
70
|
+
hakuro: Item.new(stack: -1481.0, per_term: -5.6429, per_day: +0.3779), # 白露(はくろ)
|
71
|
+
shuubun: Item.new(stack: -1526.0, per_term: +0.1432, per_day: +0.3998), # 秋分(しゅうぶん)
|
72
|
+
kanro: Item.new(stack: -1481.0, per_term: +6.1488, per_day: +0.4068), # 寒露(かんろ)
|
73
|
+
soukou: Item.new(stack: -1346.0, per_term: +12.6336, per_day: +0.3519), # 霜降(そうこう)
|
74
|
+
rittou: Item.new(stack: -1122.0, per_term: +17.8043, per_day: +0.3606), # 立冬(りっとう)
|
75
|
+
shousetsu: Item.new(stack: -823.0, per_term: +23.0590, per_day: +0.3695), # 小雪(しょうせつ)
|
76
|
+
taisetsu: Item.new(stack: -449.0, per_term: +28.4618, per_day: +0.3695) # 大雪(たいせつ)
|
77
|
+
}.freeze
|
78
|
+
|
79
|
+
#
|
80
|
+
# 24気損益眺朒(ちょうじく)数を特定する
|
81
|
+
#
|
82
|
+
# @param [Integer] index 連番(二十四節気)
|
83
|
+
#
|
84
|
+
# @return [Adjustment::Item] 24気損益眺朒(ちょうじく)数
|
85
|
+
#
|
86
|
+
def self.specify(index:)
|
87
|
+
key = Cycle::SolarTerm::ORDER[index]
|
88
|
+
Adjustment::MAP[key].clone
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../const/remainder'
|
4
|
+
|
5
|
+
require_relative '../origin/winter_solstice'
|
6
|
+
|
7
|
+
# :nodoc:
|
8
|
+
module Zakuro
|
9
|
+
# :nodoc:
|
10
|
+
module Senmyou
|
11
|
+
# :nodoc:
|
12
|
+
module Solar
|
13
|
+
#
|
14
|
+
# Average 常気(太陽軌道平均)
|
15
|
+
#
|
16
|
+
class Average
|
17
|
+
# @return [Remainder] 気策
|
18
|
+
SOLAR_TERM_AVERAGE = Const::Remainder::Solar::SOLAR_TERM_AVERAGE
|
19
|
+
|
20
|
+
#
|
21
|
+
# 初期化
|
22
|
+
#
|
23
|
+
# @param [Integer] western_year 西暦年
|
24
|
+
#
|
25
|
+
def initialize(western_year:)
|
26
|
+
@solar_term = Average.first_solar_term(western_year: western_year)
|
27
|
+
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# 冬至から数えた1年データの月ごとに二十四節気を割り当てる
|
31
|
+
#
|
32
|
+
# @param [Array<Month>] annual_range 1年データ
|
33
|
+
#
|
34
|
+
# @return [Array<Month>] 1年データ
|
35
|
+
#
|
36
|
+
def set(annual_range:)
|
37
|
+
# 次月と比較しながら当月の二十四節気を決める
|
38
|
+
# NOTE: 最後の月は処理できない(=計算外の余分な月が最後に必要である)
|
39
|
+
annual_range.each_cons(2) do |(current_month, next_month)|
|
40
|
+
set_solar_term(
|
41
|
+
current_month: current_month,
|
42
|
+
next_month: next_month
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
annual_range
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# 計算開始する二十四節気を求める
|
51
|
+
#
|
52
|
+
# @param [Integer] western_year 西暦年
|
53
|
+
#
|
54
|
+
# @return [SolarTerm] 二十四節気
|
55
|
+
#
|
56
|
+
def self.first_solar_term(western_year:)
|
57
|
+
# 天正冬至
|
58
|
+
winter_solstice = Origin::WinterSolstice.get(western_year: western_year)
|
59
|
+
|
60
|
+
# 二十四節気(冬至)
|
61
|
+
solar_term = Cycle::SolarTerm.new(index: 0, remainder: winter_solstice)
|
62
|
+
|
63
|
+
first_solar_term_index = Average.calc_fist_solar_term_index(western_year: western_year)
|
64
|
+
|
65
|
+
# 対象の二十四節気まで戻す
|
66
|
+
solar_term.prev_by_index(first_solar_term_index)
|
67
|
+
|
68
|
+
solar_term
|
69
|
+
end
|
70
|
+
|
71
|
+
# :reek:TooManyStatements { max_statements: 6 }
|
72
|
+
|
73
|
+
#
|
74
|
+
# 計算開始する二十四節気番号を求める
|
75
|
+
#
|
76
|
+
# * 前提として入定気は冬至の手前にある
|
77
|
+
# * 例えば、定気が大雪であれば入定気は大雪の範囲内にある
|
78
|
+
# * 入定気は、定気の開始位置に重複しない限り、常に定気より後にある
|
79
|
+
# * 基本的に定気の一つ前から起算すれば、当時から求めた11月(閏10/閏11月)に二十四節気を割り当てられる
|
80
|
+
#
|
81
|
+
# @param [Integer] western_year 西暦年
|
82
|
+
#
|
83
|
+
# @return [Integer] 二十四節気番号
|
84
|
+
#
|
85
|
+
def self.calc_fist_solar_term_index(western_year:)
|
86
|
+
# 天正閏余
|
87
|
+
lunar_age = Origin::LunarAge.get(western_year: western_year)
|
88
|
+
|
89
|
+
solar_location = Solar::Location.new(lunar_age: lunar_age)
|
90
|
+
solar_location.run
|
91
|
+
|
92
|
+
solar_term_index = solar_location.index
|
93
|
+
|
94
|
+
# 入定気の一つ後の二十四節気まで戻す(ただし11月経朔が二十四節気上にある場合は戻さない)
|
95
|
+
solar_term_index += 1 unless solar_location.remainder == Cycle::Remainder.new(total: 0)
|
96
|
+
|
97
|
+
solar_term_index
|
98
|
+
end
|
99
|
+
|
100
|
+
# :reek:TooManyStatements { max_statements: 7 }
|
101
|
+
|
102
|
+
#
|
103
|
+
# 月内(当月朔日から当月末日(来月朔日の前日)の間)に二十四節気があるか
|
104
|
+
# @note 大余60で一巡するため 以下2パターンがある
|
105
|
+
# * current_month <= next_month : (二十四節気) >= current_month && (二十四節気) < next_month
|
106
|
+
# * current_month > next_month : (二十四節気) >= current_month || (二十四節気) < next_month
|
107
|
+
#
|
108
|
+
# @param [Remainder] solar_term 二十四節気
|
109
|
+
# @param [Remainder] current_month 月初
|
110
|
+
# @param [Remainder] next_month 月末
|
111
|
+
#
|
112
|
+
# @return [True] 対象の二十四節気がある
|
113
|
+
# @return [False] 対象の二十四節気がない
|
114
|
+
#
|
115
|
+
def self.in_solar_term?(solar_term:, current_month:, next_month:)
|
116
|
+
# 大余で比較する
|
117
|
+
target_time = solar_term.day
|
118
|
+
current_month_time = current_month.day
|
119
|
+
next_month_time = next_month.day
|
120
|
+
current_month_over = (target_time >= current_month_time)
|
121
|
+
next_month_under = (target_time < next_month_time)
|
122
|
+
|
123
|
+
return current_month_over && next_month_under if current_month_time <= next_month_time
|
124
|
+
|
125
|
+
current_month_over || next_month_under
|
126
|
+
end
|
127
|
+
|
128
|
+
private
|
129
|
+
|
130
|
+
# :reek:TooManyStatements { max_statements: 8 }
|
131
|
+
|
132
|
+
#
|
133
|
+
# 二十四節気を設定する
|
134
|
+
#
|
135
|
+
# @param [Month] current_month 当月
|
136
|
+
# @param [Month] next_month 次月
|
137
|
+
#
|
138
|
+
def set_solar_term(current_month:, next_month:)
|
139
|
+
# 安全策として無限ループは回避する
|
140
|
+
# * 最大試行回数:4回(設定なし => 設定あり => 設定あり => 設定なし)
|
141
|
+
# * 閏月は1回しか設定しない
|
142
|
+
# * 最大2回設定する(中気・節気)
|
143
|
+
(0..3).each do |_index|
|
144
|
+
in_range = Average.in_solar_term?(
|
145
|
+
solar_term: @solar_term.remainder, current_month: current_month.remainder,
|
146
|
+
next_month: next_month.remainder
|
147
|
+
)
|
148
|
+
|
149
|
+
# 範囲外
|
150
|
+
unless in_range
|
151
|
+
# 1つ以上設定されていれば切り上げる(一つ飛ばしで二十四節気を設定することはない)
|
152
|
+
break unless current_month.empty_solar_term?
|
153
|
+
|
154
|
+
next_solar_term
|
155
|
+
next
|
156
|
+
end
|
157
|
+
|
158
|
+
current_month.add_term(term: @solar_term.clone)
|
159
|
+
next_solar_term
|
160
|
+
|
161
|
+
# 宣明暦は最大2つまで
|
162
|
+
break if current_month.solar_term_size == 2
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# 次の二十四節気に移る
|
168
|
+
#
|
169
|
+
def next_solar_term
|
170
|
+
@solar_term.next_term!
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :nodoc:
|
4
|
+
module Zakuro
|
5
|
+
# :nodoc:
|
6
|
+
module Senmyou
|
7
|
+
# :nodoc:
|
8
|
+
module Solar
|
9
|
+
#
|
10
|
+
# Interval 入気定日加減数(二十四節気の間隔)
|
11
|
+
#
|
12
|
+
module Interval
|
13
|
+
# @return [Hash<Symbol, Cycle::Remainder>] 一覧
|
14
|
+
MAP = {
|
15
|
+
# 冬至(とうじ)・大雪(たいせつ)
|
16
|
+
touji: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
|
17
|
+
taisetsu: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
|
18
|
+
# 小寒(しょうかん)・小雪(しょうせつ)
|
19
|
+
shoukan: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
|
20
|
+
shousetsu: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
|
21
|
+
# 大寒(だいかん)・立冬(りっとう)
|
22
|
+
daikan: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
|
23
|
+
rittou: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
|
24
|
+
# 立春(りっしゅん)・霜降(そうこう)
|
25
|
+
risshun: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
|
26
|
+
soukou: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
|
27
|
+
# 雨水(うすい)・寒露(かんろ)
|
28
|
+
usui: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
|
29
|
+
kanro: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
|
30
|
+
# 啓蟄(けいちつ)・秋分(しゅうぶん)
|
31
|
+
keichitsu: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
|
32
|
+
shuubun: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
|
33
|
+
# 春分(しゅんぶん)・白露(はくろ)
|
34
|
+
shunbun: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
|
35
|
+
hakuro: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
|
36
|
+
# 清明(せいめい)・処暑(しょしょ)
|
37
|
+
seimei: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
|
38
|
+
shosho: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
|
39
|
+
# 穀雨(こくう)・立秋(りっしゅう)
|
40
|
+
kokuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
|
41
|
+
risshuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
|
42
|
+
# 立夏(りっか)・大暑(たいしょ)
|
43
|
+
rikka: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
|
44
|
+
taisho: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
|
45
|
+
# 小満(しょうまん)・小暑(しょうしょ)
|
46
|
+
shouman: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
|
47
|
+
shousho: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
|
48
|
+
# 芒種(ぼうしゅ)・夏至(げし)
|
49
|
+
boushu: Cycle::Remainder.new(day: 15, minute: 7835, second: 5),
|
50
|
+
geshi: Cycle::Remainder.new(day: 15, minute: 7835, second: 5)
|
51
|
+
}.freeze
|
52
|
+
|
53
|
+
# @return [Array<Remainder>] 索引
|
54
|
+
LIST = [
|
55
|
+
MAP[:touji], # 0
|
56
|
+
MAP[:shoukan], # 1
|
57
|
+
MAP[:daikan], # 2
|
58
|
+
MAP[:risshun], # 3
|
59
|
+
MAP[:usui], # 4
|
60
|
+
MAP[:keichitsu], # 5
|
61
|
+
MAP[:shunbun], # 6
|
62
|
+
MAP[:seimei], # 7
|
63
|
+
MAP[:kokuu], # 8
|
64
|
+
MAP[:rikka], # 9
|
65
|
+
MAP[:shouman], # 10
|
66
|
+
MAP[:boushu], # 11
|
67
|
+
MAP[:geshi], # 12
|
68
|
+
MAP[:shousho], # 13
|
69
|
+
MAP[:taisho], # 14
|
70
|
+
MAP[:risshuu], # 15
|
71
|
+
MAP[:shosho], # 16
|
72
|
+
MAP[:hakuro], # 17
|
73
|
+
MAP[:shuubun], # 18
|
74
|
+
MAP[:kanro], # 19
|
75
|
+
MAP[:soukou], # 20
|
76
|
+
MAP[:rittou], # 21
|
77
|
+
MAP[:shousetsu], # 22
|
78
|
+
MAP[:taisetsu] # 23
|
79
|
+
].freeze
|
80
|
+
|
81
|
+
#
|
82
|
+
# 入気定日加減数を引き当てる
|
83
|
+
#
|
84
|
+
# @param [Integer] index 二十四節気番号
|
85
|
+
#
|
86
|
+
# @return [Cycle::Remainder] 入気定日加減数
|
87
|
+
#
|
88
|
+
def self.index_of(index)
|
89
|
+
LIST[index]
|
90
|
+
end
|
91
|
+
|
92
|
+
#
|
93
|
+
# 入気定日加減数の総数を返す
|
94
|
+
#
|
95
|
+
# @return [Integer] 入気定日加減数の総数
|
96
|
+
#
|
97
|
+
def self.size
|
98
|
+
LIST.size
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|