zakuro 0.1.1 → 0.2.0
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/base/multi_gengou.rb +101 -0
- data/lib/zakuro/calculation/base/multi_gengou_roller.rb +218 -0
- data/lib/zakuro/calculation/base/year.rb +107 -0
- data/lib/zakuro/calculation/cycle/abstract_remainder.rb +471 -0
- data/lib/zakuro/calculation/cycle/abstract_solar_term.rb +173 -0
- data/lib/zakuro/calculation/cycle/zodiac.rb +106 -0
- data/lib/zakuro/calculation/monthly/abstract_lunar_phase.rb +169 -0
- data/lib/zakuro/calculation/monthly/first_day.rb +45 -0
- data/lib/zakuro/calculation/monthly/initialized_month.rb +125 -0
- data/lib/zakuro/calculation/monthly/month.rb +187 -0
- data/lib/zakuro/calculation/monthly/month_label.rb +88 -0
- data/lib/zakuro/calculation/monthly/operated_month.rb +209 -0
- data/lib/zakuro/calculation/range/full_range.rb +210 -0
- data/lib/zakuro/calculation/range/medieval_annual_range.rb +105 -0
- data/lib/zakuro/calculation/range/operated_range.rb +144 -0
- data/lib/zakuro/calculation/range/operated_solar_terms.rb +201 -0
- data/lib/zakuro/calculation/range/transfer/western_date_allocation.rb +82 -0
- data/lib/zakuro/calculation/range/transfer/year_boundary.rb +146 -0
- data/lib/zakuro/calculation/specifier/single_day.rb +109 -0
- data/lib/zakuro/calculation/stella/lunar/abstract_location.rb +76 -0
- data/lib/zakuro/calculation/stella/lunar/choukei_value.rb +52 -0
- data/lib/zakuro/calculation/stella/solar/abstract_average.rb +117 -0
- data/lib/zakuro/calculation/stella/solar/abstract_location.rb +187 -0
- data/lib/zakuro/calculation/stella/solar/choukei_value.rb +136 -0
- data/lib/zakuro/calculation/summary/single.rb +129 -0
- data/lib/zakuro/calculation/type/old_float.rb +69 -0
- data/lib/zakuro/merchant.rb +2 -2
- data/lib/zakuro/operation/month/parser.rb +1 -1
- data/lib/zakuro/operation/month/type.rb +5 -10
- data/lib/zakuro/output/error.rb +7 -6
- data/lib/zakuro/output/logger.rb +50 -49
- data/lib/zakuro/output/response.rb +145 -144
- data/lib/zakuro/tools/typeof.rb +2 -2
- data/lib/zakuro/version.rb +1 -1
- data/lib/zakuro/version/abstract_version.rb +1 -1
- data/lib/zakuro/version/context.rb +23 -0
- data/lib/zakuro/version/gihou/const/number.rb +55 -0
- data/lib/zakuro/version/gihou/const/remainder.rb +56 -0
- data/lib/zakuro/version/gihou/cycle/remainder.rb +61 -0
- data/lib/zakuro/version/gihou/cycle/solar_term.rb +34 -0
- data/lib/zakuro/version/gihou/gihou.rb +23 -2
- data/lib/zakuro/version/gihou/monthly/lunar_phase.rb +106 -0
- data/lib/zakuro/version/gihou/range/annual_range.rb +39 -0
- data/lib/zakuro/version/gihou/stella/lunar/adjustment.rb +250 -0
- data/lib/zakuro/version/gihou/stella/lunar/localization.rb +44 -0
- data/lib/zakuro/version/gihou/stella/lunar/location.rb +86 -0
- data/lib/zakuro/version/gihou/stella/lunar/value.rb +74 -0
- data/lib/zakuro/version/gihou/stella/origin/average_november.rb +34 -0
- data/lib/zakuro/version/gihou/stella/origin/lunar_age.rb +62 -0
- data/lib/zakuro/version/gihou/stella/origin/winter_solstice.rb +55 -0
- data/lib/zakuro/version/gihou/stella/solar/adjustment.rb +93 -0
- data/lib/zakuro/version/gihou/stella/solar/average.rb +97 -0
- data/lib/zakuro/version/gihou/stella/solar/interval.rb +108 -0
- data/lib/zakuro/version/gihou/stella/solar/location.rb +61 -0
- data/lib/zakuro/version/gihou/stella/solar/value.rb +36 -0
- data/lib/zakuro/version/senmyou/const/number.rb +51 -0
- data/lib/zakuro/version/senmyou/const/remainder.rb +49 -0
- data/lib/zakuro/version/senmyou/cycle/remainder.rb +61 -0
- data/lib/zakuro/version/senmyou/cycle/solar_term.rb +34 -0
- data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +80 -195
- data/lib/zakuro/version/senmyou/range/annual_range.rb +25 -170
- data/lib/zakuro/version/senmyou/senmyou.rb +10 -4
- data/lib/zakuro/version/senmyou/stella/lunar/adjustment.rb +237 -0
- data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +44 -0
- data/lib/zakuro/version/senmyou/stella/lunar/location.rb +93 -0
- data/lib/zakuro/version/senmyou/stella/lunar/value.rb +66 -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 +97 -0
- data/lib/zakuro/version/senmyou/stella/solar/interval.rb +103 -0
- data/lib/zakuro/version/senmyou/stella/solar/location.rb +61 -0
- data/lib/zakuro/version/senmyou/stella/solar/value.rb +39 -0
- data/lib/zakuro/version/version_class_resolver.rb +66 -0
- data/lib/zakuro/version_factory.rb +2 -2
- metadata +64 -24
- data/lib/zakuro/cycle/abstract_remainder.rb +0 -456
- data/lib/zakuro/cycle/zodiac.rb +0 -103
- data/lib/zakuro/version/senmyou/base/era.rb +0 -83
- data/lib/zakuro/version/senmyou/base/multi_gengou.rb +0 -98
- data/lib/zakuro/version/senmyou/base/multi_gengou_roller.rb +0 -217
- data/lib/zakuro/version/senmyou/base/remainder.rb +0 -60
- data/lib/zakuro/version/senmyou/base/solar_term.rb +0 -86
- data/lib/zakuro/version/senmyou/base/year.rb +0 -104
- data/lib/zakuro/version/senmyou/monthly/first_day.rb +0 -44
- data/lib/zakuro/version/senmyou/monthly/initialized_month.rb +0 -48
- data/lib/zakuro/version/senmyou/monthly/month.rb +0 -181
- data/lib/zakuro/version/senmyou/monthly/month_label.rb +0 -87
- data/lib/zakuro/version/senmyou/monthly/operated_month.rb +0 -167
- data/lib/zakuro/version/senmyou/range/full_range.rb +0 -324
- data/lib/zakuro/version/senmyou/range/operated_range.rb +0 -126
- data/lib/zakuro/version/senmyou/range/operated_solar_terms.rb +0 -181
- data/lib/zakuro/version/senmyou/specifier/single_day_specifier.rb +0 -102
- data/lib/zakuro/version/senmyou/stella/lunar_orbit.rb +0 -332
- data/lib/zakuro/version/senmyou/stella/solar_average.rb +0 -214
- data/lib/zakuro/version/senmyou/stella/solar_orbit.rb +0 -394
- data/lib/zakuro/version/senmyou/stella/winter_solstice.rb +0 -106
- data/lib/zakuro/version/senmyou/summary/single.rb +0 -125
@@ -2,171 +2,172 @@
|
|
2
2
|
|
3
3
|
require_relative '../result/result'
|
4
4
|
|
5
|
-
# TODO: outputモジュール内にする
|
6
|
-
|
7
5
|
# :nodoc:
|
8
6
|
module Zakuro
|
9
|
-
#
|
10
|
-
|
11
|
-
#
|
12
|
-
module Response
|
7
|
+
# :nodoc:
|
8
|
+
module Output
|
13
9
|
#
|
14
|
-
#
|
10
|
+
# Response 返却値
|
15
11
|
#
|
16
|
-
module
|
12
|
+
module Response
|
17
13
|
#
|
18
|
-
#
|
14
|
+
# SingleDay 1日データ
|
19
15
|
#
|
20
|
-
|
21
|
-
#
|
22
|
-
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
module SingleDay
|
17
|
+
#
|
18
|
+
# Param 引数
|
19
|
+
#
|
20
|
+
class Param
|
21
|
+
# @return [Year] 年情報(各暦のデータ型)
|
22
|
+
attr_reader :year
|
23
|
+
# @return [Month] 月情報(各暦のデータ型)
|
24
|
+
attr_reader :month
|
25
|
+
# @return [Western::Calendar] 年月日情報(西暦)
|
26
|
+
attr_reader :date
|
27
|
+
# @return [Integer] 日数(月初日から指定日までの日数)
|
28
|
+
attr_reader :days
|
29
|
+
|
30
|
+
#
|
31
|
+
# 初期化
|
32
|
+
#
|
33
|
+
# @param [Year] year 年情報(各暦のデータ型)
|
34
|
+
# @param [Month] month 月情報(各暦のデータ型)
|
35
|
+
# @param [Western::Calendar] date 年月日情報(西暦)
|
36
|
+
# @param [Integer] days 日数(月初日から指定日までの日数)
|
37
|
+
#
|
38
|
+
def initialize(year:, month:, date:, days:)
|
39
|
+
@year = year
|
40
|
+
@month = month
|
41
|
+
@date = date
|
42
|
+
@days = days
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# 1日データを生成する
|
48
|
+
#
|
49
|
+
# @param [Parameter] param 引数
|
50
|
+
#
|
51
|
+
# @return [SingleDay] 1日データ
|
52
|
+
#
|
53
|
+
def self.save_single_day(param:)
|
54
|
+
year = param.year
|
55
|
+
month = param.month
|
56
|
+
date = param.date
|
57
|
+
days = param.days
|
58
|
+
Result::Data::SingleDay.new(
|
59
|
+
year: save_year(year: year),
|
60
|
+
month: save_month(month: month, date: date, days: days),
|
61
|
+
day: save_day(month: month, date: date, days: days)
|
62
|
+
)
|
63
|
+
end
|
29
64
|
|
30
65
|
#
|
31
|
-
#
|
66
|
+
# 年データを保存する
|
32
67
|
#
|
33
68
|
# @param [Year] year 年情報(各暦のデータ型)
|
69
|
+
#
|
70
|
+
# @return [Result::Year] 年データ
|
71
|
+
#
|
72
|
+
def self.save_year(year:)
|
73
|
+
multi_gengou = year.multi_gengou
|
74
|
+
first = multi_gengou.first_line
|
75
|
+
second = multi_gengou.second_line
|
76
|
+
Result::Data::Year.new(
|
77
|
+
first_gengou:
|
78
|
+
Result::Data::Gengou.new(name: first.name, number: first.year),
|
79
|
+
second_gengou:
|
80
|
+
Result::Data::Gengou.new(name: second.name, number: second.year),
|
81
|
+
zodiac_name: year.zodiac_name, total_days: year.total_days
|
82
|
+
)
|
83
|
+
end
|
84
|
+
private_class_method :save_year
|
85
|
+
|
86
|
+
#
|
87
|
+
# 月データを保存する
|
88
|
+
#
|
34
89
|
# @param [Month] month 月情報(各暦のデータ型)
|
35
90
|
# @param [Western::Calendar] date 年月日情報(西暦)
|
36
91
|
# @param [Integer] days 日数(月初日から指定日までの日数)
|
37
92
|
#
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
93
|
+
# @return [Result::Month] 月データ
|
94
|
+
#
|
95
|
+
def self.save_month(month:, date:, days:)
|
96
|
+
Result::Data::Month.new(
|
97
|
+
number: month.number, leaped: month.leaped?, days_name: month.days_name,
|
98
|
+
first_day: save_first_day(remainder: month.remainder,
|
99
|
+
date: date, days: days),
|
100
|
+
odd_solar_terms: save_solar_term(term: month.odd_term),
|
101
|
+
even_solar_terms: save_solar_term(term: month.even_term)
|
102
|
+
)
|
43
103
|
end
|
44
|
-
|
45
|
-
|
46
|
-
#
|
47
|
-
# 1日データを生成する
|
48
|
-
#
|
49
|
-
# @param [Parameter] param 引数
|
50
|
-
#
|
51
|
-
# @return [SingleDay] 1日データ
|
52
|
-
#
|
53
|
-
def self.save_single_day(param:)
|
54
|
-
year = param.year
|
55
|
-
month = param.month
|
56
|
-
date = param.date
|
57
|
-
days = param.days
|
58
|
-
Result::Data::SingleDay.new(
|
59
|
-
year: save_year(year: year),
|
60
|
-
month: save_month(month: month, date: date, days: days),
|
61
|
-
day: save_day(month: month, date: date, days: days)
|
62
|
-
)
|
63
|
-
end
|
104
|
+
private_class_method :save_month
|
64
105
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
private_class_method :save_year
|
85
|
-
|
86
|
-
#
|
87
|
-
# 月データを保存する
|
88
|
-
#
|
89
|
-
# @param [Month] month 月情報(各暦のデータ型)
|
90
|
-
# @param [Western::Calendar] date 年月日情報(西暦)
|
91
|
-
# @param [Integer] days 日数(月初日から指定日までの日数)
|
92
|
-
#
|
93
|
-
# @return [Result::Month] 月データ
|
94
|
-
#
|
95
|
-
def self.save_month(month:, date:, days:)
|
96
|
-
Result::Data::Month.new(
|
97
|
-
number: month.number, leaped: month.leaped?, days_name: month.days_name,
|
98
|
-
first_day: save_first_day(remainder: month.remainder,
|
99
|
-
date: date, days: days),
|
100
|
-
odd_solar_terms: save_solar_term(term: month.odd_term),
|
101
|
-
even_solar_terms: save_solar_term(term: month.even_term)
|
102
|
-
)
|
103
|
-
end
|
104
|
-
private_class_method :save_month
|
106
|
+
#
|
107
|
+
# 月初日データを保存する
|
108
|
+
#
|
109
|
+
# @param [Cycle::AbstractRemainder] remainder 大余小余情報
|
110
|
+
# @param [Western::Calendar] date 年月日情報(西暦)
|
111
|
+
# @param [Integer] days 日数(月初日から指定日までの日数)
|
112
|
+
#
|
113
|
+
# @return [Result::Day] 日データ
|
114
|
+
#
|
115
|
+
def self.save_first_day(remainder:, date:, days:)
|
116
|
+
western_date = date.clone - days
|
117
|
+
Result::Data::Day.new(
|
118
|
+
number: 1,
|
119
|
+
zodiac_name: remainder.zodiac_name,
|
120
|
+
remainder: remainder,
|
121
|
+
western_date: western_date
|
122
|
+
)
|
123
|
+
end
|
124
|
+
private_class_method :save_first_day
|
105
125
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
Result::Data::Day.new(
|
118
|
-
number: 1,
|
119
|
-
zodiac_name: remainder.zodiac_name,
|
120
|
-
remainder: remainder,
|
121
|
-
western_date: western_date
|
122
|
-
)
|
123
|
-
end
|
124
|
-
private_class_method :save_first_day
|
126
|
+
#
|
127
|
+
# 二十四節気データを保存する
|
128
|
+
#
|
129
|
+
# @note 今は宣明暦に合わせている。江戸期以降の暦には対応していない(複数の中気節気を指定できない)
|
130
|
+
#
|
131
|
+
# @param [SolarTerm] term 二十四節気情報(各暦のデータ型)
|
132
|
+
#
|
133
|
+
# @return [Array<Result::SolarTerm>] 二十四節気データ
|
134
|
+
#
|
135
|
+
def self.save_solar_term(term:)
|
136
|
+
return [] if term.invalid?
|
125
137
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
#
|
135
|
-
def self.save_solar_term(term:)
|
136
|
-
return [] if term.invalid?
|
138
|
+
[
|
139
|
+
Result::Data::SolarTerm.new(
|
140
|
+
index: term.index,
|
141
|
+
remainder: term.remainder
|
142
|
+
)
|
143
|
+
]
|
144
|
+
end
|
145
|
+
private_class_method :save_solar_term
|
137
146
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
147
|
+
#
|
148
|
+
# 日データを保存する
|
149
|
+
#
|
150
|
+
# @param [Month] month 月情報(各暦のデータ型)
|
151
|
+
# @param [Western::Calendar] date 年月日情報(西暦)
|
152
|
+
# @param [Integer] days 日数(月初日から指定日までの日数)
|
153
|
+
#
|
154
|
+
# @return [Result::Day] 日データ
|
155
|
+
#
|
156
|
+
def self.save_day(month:, date:, days:)
|
157
|
+
remainder = month.remainder
|
158
|
+
remainder = remainder.add(
|
159
|
+
# 常に参照元のRemainderクラスで生成する
|
160
|
+
remainder.class.new(day: days, minute: 0, second: 0)
|
142
161
|
)
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
# @param [Western::Calendar] date 年月日情報(西暦)
|
152
|
-
# @param [Integer] days 日数(月初日から指定日までの日数)
|
153
|
-
#
|
154
|
-
# @return [Result::Day] 日データ
|
155
|
-
#
|
156
|
-
def self.save_day(month:, date:, days:)
|
157
|
-
remainder = month.remainder
|
158
|
-
remainder = remainder.add(
|
159
|
-
# 常に参照元のRemainderクラスで生成する
|
160
|
-
remainder.class.new(day: days, minute: 0, second: 0)
|
161
|
-
)
|
162
|
-
Result::Data::Day.new(
|
163
|
-
number: (days + 1),
|
164
|
-
zodiac_name: remainder.zodiac_name,
|
165
|
-
remainder: remainder,
|
166
|
-
western_date: date
|
167
|
-
)
|
162
|
+
Result::Data::Day.new(
|
163
|
+
number: (days + 1),
|
164
|
+
zodiac_name: remainder.zodiac_name,
|
165
|
+
remainder: remainder,
|
166
|
+
western_date: date
|
167
|
+
)
|
168
|
+
end
|
169
|
+
private_class_method :save_day
|
168
170
|
end
|
169
|
-
private_class_method :save_day
|
170
171
|
end
|
171
172
|
end
|
172
173
|
end
|
data/lib/zakuro/tools/typeof.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '../cycle/abstract_remainder'
|
3
|
+
require_relative '../calculation/cycle/abstract_remainder'
|
4
4
|
require_relative '../era/western'
|
5
5
|
|
6
6
|
# :nodoc:
|
@@ -24,7 +24,7 @@ module Zakuro
|
|
24
24
|
def self.time?(obj:)
|
25
25
|
return true if obj.is_a?(Western::Calendar)
|
26
26
|
|
27
|
-
return true if obj.is_a?(Cycle::AbstractRemainder)
|
27
|
+
return true if obj.is_a?(Calculation::Cycle::AbstractRemainder)
|
28
28
|
|
29
29
|
false
|
30
30
|
end
|
data/lib/zakuro/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative './version_class_resolver'
|
4
|
+
|
5
|
+
# :nodoc:
|
6
|
+
module Zakuro
|
7
|
+
#
|
8
|
+
# Context 暦コンテキスト
|
9
|
+
#
|
10
|
+
class Context
|
11
|
+
attr_reader :version_name
|
12
|
+
attr_reader :resolver
|
13
|
+
|
14
|
+
VERSION_NAMES = %w[Genka Gihou Taien Senmyou Joukyou Kansei Tenpou Gregorio].freeze
|
15
|
+
|
16
|
+
def initialize(version_name:)
|
17
|
+
raise ArgumentError.new, 'invalid version' unless VERSION_NAMES.include?(version_name)
|
18
|
+
|
19
|
+
@version_name = version_name
|
20
|
+
@resolver = VersionClassResolver.new(version_name: version_name)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :nodoc:
|
4
|
+
module Zakuro
|
5
|
+
# :nodoc:
|
6
|
+
module Gihou
|
7
|
+
#
|
8
|
+
# Const 定数
|
9
|
+
#
|
10
|
+
module Const
|
11
|
+
#
|
12
|
+
# Number 数値
|
13
|
+
#
|
14
|
+
module Number
|
15
|
+
#
|
16
|
+
# Cycle 周期
|
17
|
+
#
|
18
|
+
module Cycle
|
19
|
+
# @return [Integer] 総法(1日=1340分)
|
20
|
+
DAY = 1340
|
21
|
+
#
|
22
|
+
# @return [Float] 変日(1近点月 = 27日743分1秒(1分=12秒))
|
23
|
+
# @note 小数点以下の値によって大幅に結果が変わる。除算結果を設定した
|
24
|
+
#
|
25
|
+
# ANOMALISTIC_MONTH = 36_923.083333333333
|
26
|
+
ANOMALISTIC_MONTH = 36_923 + (1.0 / 12)
|
27
|
+
# @return [Integer] 朔望月
|
28
|
+
SYNODIC_MONTH = 39_571
|
29
|
+
# @return [Integer] 一年
|
30
|
+
YEAR = 489_428
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# Derivation 導出
|
35
|
+
#
|
36
|
+
module Derivation
|
37
|
+
# @return [Integer] 通余: (YEAR - DAY * 12 * 30)
|
38
|
+
REMAINDER_ALL_YEAR = 7028
|
39
|
+
# @return [Integer] 旬周(60日) DAY * 60
|
40
|
+
SIXTY_DAYS = 80_400
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# 累積
|
45
|
+
#
|
46
|
+
module Stack
|
47
|
+
# @return [Integer] 積年(甲子夜半朔旦冬至〜暦の開始前)
|
48
|
+
TOTAL_YEAR = 269_880
|
49
|
+
# @return [Integer] 暦の開始年(麟徳元年)
|
50
|
+
BEGIN_YEAR = 664
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../cycle/remainder'
|
4
|
+
|
5
|
+
# :nodoc:
|
6
|
+
module Zakuro
|
7
|
+
# :nodoc:
|
8
|
+
module Gihou
|
9
|
+
#
|
10
|
+
# Const 定数
|
11
|
+
#
|
12
|
+
module Const
|
13
|
+
#
|
14
|
+
# Remainder 大余小余
|
15
|
+
#
|
16
|
+
module Remainder
|
17
|
+
#
|
18
|
+
# Solar 太陽
|
19
|
+
#
|
20
|
+
module Solar
|
21
|
+
# @return [Remainder] 気策(24分の1年)
|
22
|
+
SOLAR_TERM_AVERAGE = Cycle::Remainder.new(day: 15, minute: 292, second: 5)
|
23
|
+
#
|
24
|
+
# @note 常朔実 39571 = 29-711
|
25
|
+
# * 39571 / 4 = 9892.75 / 1340 = 7 余り 512.75
|
26
|
+
# * 0.75 * 6(1分=6秒) = 4.5
|
27
|
+
#
|
28
|
+
# @return [Cycle::Remainder] 弦(1分=6秒)
|
29
|
+
QUARTER = Cycle::Remainder.new(day: 7, minute: 512, second: 4.5)
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Lunar 月
|
34
|
+
#
|
35
|
+
module Lunar
|
36
|
+
# @return [Cycle::LunarRemainder] 変日(1近点月)
|
37
|
+
ANOMALISTIC_MONTH = \
|
38
|
+
Cycle::LunarRemainder.new(day: 27, minute: 743, second: 1)
|
39
|
+
# @return [Cycle::LunarRemainder] 入暦上限
|
40
|
+
LIMIT = Cycle::LunarRemainder.new(day: 28, minute: 743, second: 0)
|
41
|
+
#
|
42
|
+
# @note 常朔実 39571 = 29-711
|
43
|
+
# * 39571 / 4 = 9892.75 / 1340 = 7 余り 512.75
|
44
|
+
# * 0.75 * 12(1分=12秒) = 9
|
45
|
+
#
|
46
|
+
# @return [Cycle::LunarRemainder] 弦(1分=12秒)
|
47
|
+
# TODO: 9秒だと通らない。 0.00378 〜 0.0208 の範囲内で通る
|
48
|
+
# QUARTER = Cycle::LunarRemainder.new(day: 7, minute: 512, second: 9)
|
49
|
+
# QUARTER = Cycle::LunarRemainder.new(day: 7, minute: 512, second: 9.00378)
|
50
|
+
# QUARTER = Cycle::LunarRemainder.new(day: 7, minute: 512, second: 9.0208)
|
51
|
+
QUARTER = Cycle::LunarRemainder.new(day: 7, minute: 512, second: 9.00378)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|