zakuro 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/README.md +41 -8
- data/VERSION +1 -1
- data/doc/gengou.md +1 -1
- data/doc/operation/csv/month.csv +8 -9
- data/doc/operation/operation.xlsx +0 -0
- data/images/logo-text.png +0 -0
- data/lib/zakuro/calculation/base/gengou.rb +2 -4
- data/lib/zakuro/calculation/base/year.rb +1 -1
- data/lib/zakuro/calculation/cycle/abstract_solar_term.rb +6 -0
- data/lib/zakuro/calculation/era/gengou/abstract_scroll.rb +2 -2
- data/lib/zakuro/calculation/era/gengou/dated_scroll.rb +4 -2
- data/lib/zakuro/calculation/era/gengou/internal/publisher.rb +1 -1
- data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_list.rb +13 -7
- data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_range.rb +18 -9
- data/lib/zakuro/calculation/era/gengou/internal/reserve/dated_list.rb +6 -2
- data/lib/zakuro/calculation/era/gengou/internal/reserve/dated_range.rb +5 -2
- data/lib/zakuro/calculation/era/gengou/internal/reserve/empty_link.rb +3 -3
- data/lib/zakuro/calculation/era/gengou/internal/reserve/named_list.rb +12 -4
- data/lib/zakuro/calculation/era/gengou/internal/reserve/named_range.rb +10 -4
- data/lib/zakuro/calculation/era/gengou/named_scroll.rb +5 -2
- data/lib/zakuro/calculation/era/version/internal/crawler.rb +3 -3
- data/lib/zakuro/calculation/monthly/abstract_lunar_phase.rb +1 -1
- data/lib/zakuro/calculation/monthly/internal/date_comparer.rb +78 -0
- data/lib/zakuro/calculation/monthly/{meta → internal/meta}/all_solar_term.rb +1 -1
- data/lib/zakuro/calculation/monthly/{meta → internal/meta}/meta_collector.rb +2 -2
- data/lib/zakuro/calculation/monthly/{first_day.rb → internal/part/first_day.rb} +2 -2
- data/lib/zakuro/calculation/monthly/{meta.rb → internal/part/meta.rb} +1 -1
- data/lib/zakuro/calculation/monthly/internal/solar_term_selector.rb +203 -0
- data/lib/zakuro/calculation/monthly/month.rb +38 -74
- data/lib/zakuro/calculation/monthly/operated_month.rb +7 -2
- data/lib/zakuro/calculation/option/dropped_date/location.rb +8 -1
- data/lib/zakuro/calculation/range/dated_full_range.rb +6 -3
- data/lib/zakuro/calculation/range/dated_operation_range.rb +2 -1
- data/lib/zakuro/calculation/range/medieval_annual_range.rb +0 -2
- data/lib/zakuro/calculation/range/named_full_range.rb +1 -1
- data/lib/zakuro/calculation/range/transfer/gengou_scroller.rb +24 -10
- data/lib/zakuro/calculation/stella/solar/abstract_average.rb +3 -3
- data/lib/zakuro/calculation/summary/internal/option/dropped_date.rb +102 -0
- data/lib/zakuro/calculation/summary/internal/option/vanished_date.rb +111 -0
- data/lib/zakuro/calculation/summary/internal/option.rb +4 -137
- data/lib/zakuro/calculation/summary/japan/range.rb +4 -5
- data/lib/zakuro/calculation/summary/western/range.rb +8 -1
- data/lib/zakuro/calculation/summary/western/single.rb +10 -5
- data/lib/zakuro/context/version_class_resolver.rb +5 -5
- data/lib/zakuro/era/japan/calendar.rb +4 -4
- data/lib/zakuro/era/japan/gengou/alignment/division.rb +2 -2
- data/lib/zakuro/era/japan/gengou/alignment/linear_gengou.rb +2 -2
- data/lib/zakuro/era/japan/gengou/alignment.rb +35 -6
- data/lib/zakuro/era/japan/gengou/resource/parser.rb +17 -16
- data/lib/zakuro/era/japan/gengou/resource/validator.rb +3 -394
- data/lib/zakuro/era/japan/gengou/resource/yaml/set-001-until-south.yaml +2 -2
- data/lib/zakuro/era/japan/gengou.rb +8 -6
- data/lib/zakuro/era/japan/type/base/both/date.rb +51 -0
- data/lib/zakuro/era/japan/type/base/both/year.rb +53 -0
- data/lib/zakuro/era/japan/type/base/gengou.rb +177 -0
- data/lib/zakuro/era/japan/type/base/gengou_set.rb +78 -0
- data/lib/zakuro/era/japan/type/base/switch_date.rb +74 -0
- data/lib/zakuro/era/japan/type/base/version_range.rb +189 -0
- data/lib/zakuro/era/japan/type/validation/both/date.rb +99 -0
- data/lib/zakuro/era/japan/type/validation/both/year.rb +75 -0
- data/lib/zakuro/era/japan/type/validation/gengou.rb +93 -0
- data/lib/zakuro/era/japan/type/validation/gengou_set.rb +133 -0
- data/lib/zakuro/era/japan/type/validation/switch_date.rb +73 -0
- data/lib/zakuro/era/japan/type/validation/version_range.rb +109 -0
- data/lib/zakuro/era/japan/type/validation/version_root.rb +102 -0
- data/lib/zakuro/era/japan/version/resource/parser.rb +266 -0
- data/lib/zakuro/era/japan/version/resource/validator.rb +37 -0
- data/lib/zakuro/era/japan/version/resource/yaml/version.yaml +80 -0
- data/lib/zakuro/era/japan/version/resource.rb +22 -0
- data/lib/zakuro/era/japan/version.rb +4 -115
- data/lib/zakuro/era/western/calendar.rb +2 -2
- data/lib/zakuro/exception/zakuro_error.rb +1 -1
- data/lib/zakuro/merchant.rb +5 -5
- data/lib/zakuro/operation/month/parser.rb +2 -2
- data/lib/zakuro/operation/yaml/month.yaml +8 -40
- data/lib/zakuro/output/logger.rb +4 -4
- data/lib/zakuro/parameter/catalog/basis_date.rb +55 -0
- data/lib/zakuro/parameter/catalog/column.rb +57 -0
- data/lib/zakuro/parameter/catalog/option.rb +60 -0
- data/lib/zakuro/parameter/catalog/range.rb +81 -0
- data/lib/zakuro/parameter/condition.rb +108 -0
- data/lib/zakuro/result/core.rb +2 -2
- data/lib/zakuro/{tools → tool}/remainder_comparer.rb +3 -2
- data/lib/zakuro/{tools → tool}/stringifier.rb +3 -3
- data/lib/zakuro/{tools → tool}/typeconv.rb +2 -2
- data/lib/zakuro/{tools → tool}/typeof.rb +2 -2
- data/lib/zakuro/version/daien/const/number.rb +42 -39
- data/lib/zakuro/version/daien/const/remainder.rb +38 -35
- data/lib/zakuro/version/daien/cycle/remainder.rb +77 -74
- data/lib/zakuro/version/daien/cycle/solar_term.rb +18 -15
- data/lib/zakuro/version/daien/daien.rb +8 -5
- data/lib/zakuro/version/daien/monthly/lunar_phase.rb +67 -64
- data/lib/zakuro/version/daien/option/dropped_date/parameter.rb +15 -12
- data/lib/zakuro/version/daien/option/vanished_date/parameter.rb +15 -12
- data/lib/zakuro/version/daien/range/annual_range.rb +27 -24
- data/lib/zakuro/version/daien/stella/lunar/adjustment.rb +209 -206
- data/lib/zakuro/version/daien/stella/lunar/localization.rb +32 -29
- data/lib/zakuro/version/daien/stella/lunar/location.rb +53 -50
- data/lib/zakuro/version/daien/stella/lunar/value.rb +65 -62
- data/lib/zakuro/version/daien/stella/origin/average_november.rb +23 -20
- data/lib/zakuro/version/daien/stella/origin/lunar_age.rb +42 -39
- data/lib/zakuro/version/daien/stella/origin/winter_solstice.rb +44 -41
- data/lib/zakuro/version/daien/stella/solar/adjustment.rb +74 -71
- data/lib/zakuro/version/daien/stella/solar/average.rb +68 -65
- data/lib/zakuro/version/daien/stella/solar/interval.rb +95 -92
- data/lib/zakuro/version/daien/stella/solar/location.rb +41 -38
- data/lib/zakuro/version/daien/stella/solar/value.rb +21 -18
- data/lib/zakuro/version/genka/const/number.rb +31 -28
- data/lib/zakuro/version/genka/const/remainder.rb +20 -17
- data/lib/zakuro/version/genka/cycle/remainder.rb +72 -69
- data/lib/zakuro/version/genka/cycle/solar_term.rb +18 -15
- data/lib/zakuro/version/genka/genka.rb +8 -5
- data/lib/zakuro/version/genka/monthly/lunar_phase.rb +82 -79
- data/lib/zakuro/version/genka/option/dropped_date/parameter.rb +13 -10
- data/lib/zakuro/version/genka/option/vanished_date/parameter.rb +13 -10
- data/lib/zakuro/version/genka/range/annual_range.rb +57 -54
- data/lib/zakuro/version/genka/stella/origin/first_term.rb +44 -41
- data/lib/zakuro/version/genka/stella/origin/january.rb +38 -35
- data/lib/zakuro/version/genka/stella/solar/average.rb +24 -21
- data/lib/zakuro/version/gihou/const/number.rb +40 -37
- data/lib/zakuro/version/gihou/const/remainder.rb +32 -29
- data/lib/zakuro/version/gihou/cycle/remainder.rb +38 -35
- data/lib/zakuro/version/gihou/cycle/solar_term.rb +18 -15
- data/lib/zakuro/version/gihou/gihou.rb +8 -5
- data/lib/zakuro/version/gihou/monthly/lunar_phase.rb +68 -65
- data/lib/zakuro/version/gihou/option/dropped_date/parameter.rb +13 -10
- data/lib/zakuro/version/gihou/option/vanished_date/parameter.rb +13 -10
- data/lib/zakuro/version/gihou/range/annual_range.rb +27 -24
- data/lib/zakuro/version/gihou/stella/lunar/adjustment.rb +212 -209
- data/lib/zakuro/version/gihou/stella/lunar/localization.rb +32 -29
- data/lib/zakuro/version/gihou/stella/lunar/location.rb +53 -50
- data/lib/zakuro/version/gihou/stella/lunar/value.rb +65 -62
- data/lib/zakuro/version/gihou/stella/origin/average_november.rb +23 -20
- data/lib/zakuro/version/gihou/stella/origin/lunar_age.rb +42 -39
- data/lib/zakuro/version/gihou/stella/origin/winter_solstice.rb +44 -41
- data/lib/zakuro/version/gihou/stella/solar/adjustment.rb +74 -71
- data/lib/zakuro/version/gihou/stella/solar/average.rb +67 -64
- data/lib/zakuro/version/gihou/stella/solar/interval.rb +95 -92
- data/lib/zakuro/version/gihou/stella/solar/location.rb +41 -38
- data/lib/zakuro/version/gihou/stella/solar/value.rb +21 -18
- data/lib/zakuro/version/gregorio/gregorio.rb +8 -5
- data/lib/zakuro/version/houryaku/houryaku.rb +8 -5
- data/lib/zakuro/version/joukyou/joukyou.rb +8 -5
- data/lib/zakuro/version/kansei/kansei.rb +8 -5
- data/lib/zakuro/version/senmyou/const/number.rb +40 -37
- data/lib/zakuro/version/senmyou/const/remainder.rb +35 -32
- data/lib/zakuro/version/senmyou/cycle/remainder.rb +74 -71
- data/lib/zakuro/version/senmyou/cycle/solar_term.rb +18 -15
- data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +69 -66
- data/lib/zakuro/version/senmyou/option/dropped_date/parameter.rb +15 -12
- data/lib/zakuro/version/senmyou/option/vanished_date/parameter.rb +15 -12
- data/lib/zakuro/version/senmyou/range/annual_range.rb +27 -24
- data/lib/zakuro/version/senmyou/senmyou.rb +8 -5
- data/lib/zakuro/version/senmyou/stella/lunar/adjustment.rb +206 -203
- data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +32 -29
- data/lib/zakuro/version/senmyou/stella/lunar/location.rb +60 -57
- data/lib/zakuro/version/senmyou/stella/lunar/value.rb +66 -63
- data/lib/zakuro/version/senmyou/stella/origin/average_november.rb +23 -20
- data/lib/zakuro/version/senmyou/stella/origin/lunar_age.rb +42 -39
- data/lib/zakuro/version/senmyou/stella/origin/winter_solstice.rb +44 -41
- data/lib/zakuro/version/senmyou/stella/solar/adjustment.rb +74 -71
- data/lib/zakuro/version/senmyou/stella/solar/average.rb +67 -64
- data/lib/zakuro/version/senmyou/stella/solar/interval.rb +93 -90
- data/lib/zakuro/version/senmyou/stella/solar/location.rb +41 -38
- data/lib/zakuro/version/senmyou/stella/solar/value.rb +23 -20
- data/lib/zakuro/version/tenpou/tenpou.rb +8 -5
- metadata +40 -15
- data/lib/zakuro/condition.rb +0 -306
- data/lib/zakuro/era/japan/gengou/resource/type.rb +0 -356
- /data/lib/zakuro/calculation/monthly/{operated_solar_term.rb → internal/operated_solar_term.rb} +0 -0
- /data/lib/zakuro/calculation/monthly/{const.rb → internal/part/const.rb} +0 -0
- /data/lib/zakuro/calculation/monthly/{month_label.rb → internal/part/month_label.rb} +0 -0
@@ -6,49 +6,52 @@ require_relative '../../cycle/remainder'
|
|
6
6
|
# :nodoc:
|
7
7
|
module Zakuro
|
8
8
|
# :nodoc:
|
9
|
-
module
|
9
|
+
module Version
|
10
10
|
# :nodoc:
|
11
|
-
module
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
module Genka
|
12
|
+
# :nodoc:
|
13
|
+
module Origin
|
14
|
+
#
|
15
|
+
# FirstTerm 年初の中気(正月中雨水)
|
16
|
+
#
|
17
|
+
module FirstTerm
|
18
|
+
# @return [Integer] 二十四節気の1日
|
19
|
+
TERM_DAY = Const::Number::Cycle::TERM_DAY
|
20
|
+
# @return [Float] 余数
|
21
|
+
YEAR_REMAINDER = Const::Number::Stack::YEAR_REMAINDER.to_f
|
22
|
+
# @return [Integer] 西暦0年の積年
|
23
|
+
WESTERN_YEAR = Const::Number::Stack::WESTERN_YEAR
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
25
|
+
class << self
|
26
|
+
#
|
27
|
+
# 年初の中気(正月中雨水)を求める
|
28
|
+
#
|
29
|
+
# @note 計算は宋書(1)に従う。念のため『日本暦日原典』(2)と比較する
|
30
|
+
# 1. (1612 + 西暦年) * 餘数(1595) / 度法(304) = A' ...余りが中気の小余
|
31
|
+
# A' / 60 = B' ...余りが朔の大余
|
32
|
+
# 『歴代天文律暦等志彙編 六』中華書房 p.1728
|
33
|
+
#
|
34
|
+
# 2. (1612 + x) * 222070 / 608 = A' ...余りが中気の小余
|
35
|
+
# A' / 60 = B' ...余りが朔の大余
|
36
|
+
#
|
37
|
+
# 小余上限(度法)の違いで、宋書に従ったほうが良いと判断した。分母が変わるだけで結果に相違はない
|
38
|
+
#
|
39
|
+
# @param [Integer] western_year 西暦年
|
40
|
+
#
|
41
|
+
# @return [Remainder] 年初の中気(正月中雨水)
|
42
|
+
#
|
43
|
+
def get(western_year:)
|
44
|
+
total_western_year = WESTERN_YEAR + western_year
|
45
|
+
# (1612 + x) * 222070 / 608 = A' ...余りが中気の小余
|
46
|
+
stack = (total_western_year * YEAR_REMAINDER / TERM_DAY).to_i
|
47
|
+
minute = (total_western_year * YEAR_REMAINDER % TERM_DAY).to_i
|
48
|
+
# A' / 60 = B' ...余りが朔の大余
|
49
|
+
day = stack % Cycle::TermRemainder::LIMIT
|
50
|
+
# p stack
|
51
|
+
# p minute
|
52
|
+
# p day
|
53
|
+
Cycle::TermRemainder.new(day: day, minute: minute, second: 0)
|
54
|
+
end
|
52
55
|
end
|
53
56
|
end
|
54
57
|
end
|
@@ -6,43 +6,46 @@ require_relative '../../cycle/remainder'
|
|
6
6
|
# :nodoc:
|
7
7
|
module Zakuro
|
8
8
|
# :nodoc:
|
9
|
-
module
|
9
|
+
module Version
|
10
10
|
# :nodoc:
|
11
|
-
module
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
module Genka
|
12
|
+
# :nodoc:
|
13
|
+
module Origin
|
14
|
+
#
|
15
|
+
# January 1月
|
16
|
+
#
|
17
|
+
module January
|
18
|
+
# @return [Integer] 日法
|
19
|
+
DAY = Const::Number::Cycle::DAY
|
20
|
+
# @return [Float] 朔望月
|
21
|
+
SYNODIC_MONTH = Const::Number::Cycle::SYNODIC_MONTH.to_f
|
22
|
+
# @return [Integer] 西暦0年の積年
|
23
|
+
WESTERN_YEAR = Const::Number::Stack::WESTERN_YEAR
|
24
|
+
# @return [Float] 19年=235朔望月
|
25
|
+
METONIC_CYCLE = 235 / 19.to_f
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
27
|
+
class << self
|
28
|
+
#
|
29
|
+
# 1月経朔を求める
|
30
|
+
#
|
31
|
+
# @param [Integer] western_year 西暦年
|
32
|
+
#
|
33
|
+
# @return [Remainder] 11月経朔
|
34
|
+
#
|
35
|
+
def get(western_year:)
|
36
|
+
# (1612 + x) * 235 / 19 = A ...余り
|
37
|
+
stack = ((WESTERN_YEAR + western_year) * METONIC_CYCLE).to_i
|
38
|
+
# A * 22207 / 752 = B ...余りが朔の小余
|
39
|
+
minute_total = (stack * SYNODIC_MONTH / DAY).to_i
|
40
|
+
minute = (stack * SYNODIC_MONTH % DAY).to_i
|
41
|
+
# B / 60 = C ...余りが朔の大余
|
42
|
+
day = minute_total % Cycle::Remainder::LIMIT
|
43
|
+
# p stack
|
44
|
+
# p minute_total
|
45
|
+
# p minute
|
46
|
+
# p day
|
47
|
+
Cycle::Remainder.new(day: day, minute: minute, second: 0)
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
@@ -9,31 +9,34 @@ require_relative '../../cycle/solar_term'
|
|
9
9
|
# :nodoc:
|
10
10
|
module Zakuro
|
11
11
|
# :nodoc:
|
12
|
-
module
|
12
|
+
module Version
|
13
13
|
# :nodoc:
|
14
|
-
module
|
15
|
-
#
|
16
|
-
|
17
|
-
#
|
18
|
-
class Average < Calculation::Solar::AbstractAverage
|
14
|
+
module Genka
|
15
|
+
# :nodoc:
|
16
|
+
module Solar
|
19
17
|
#
|
20
|
-
#
|
18
|
+
# Average 平気(太陽軌道平均)
|
21
19
|
#
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
class Average < Calculation::Solar::AbstractAverage
|
21
|
+
#
|
22
|
+
# 初期化
|
23
|
+
#
|
24
|
+
# @param [Integer] western_year 西暦年
|
25
|
+
#
|
26
|
+
def initialize(solar_term:)
|
27
|
+
super(solar_term: solar_term)
|
28
|
+
end
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
#
|
31
|
+
# 冬至から数えた1年データの月ごとに二十四節気を割り当てる
|
32
|
+
#
|
33
|
+
# @param [Array<Month>] annual_range 1年データ
|
34
|
+
#
|
35
|
+
# @return [Array<Month>] 1年データ
|
36
|
+
#
|
37
|
+
def set(annual_range:)
|
38
|
+
super(annual_range: annual_range)
|
39
|
+
end
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
@@ -3,51 +3,54 @@
|
|
3
3
|
# :nodoc:
|
4
4
|
module Zakuro
|
5
5
|
# :nodoc:
|
6
|
-
module
|
7
|
-
#
|
8
|
-
|
9
|
-
#
|
10
|
-
module Const
|
6
|
+
module Version
|
7
|
+
# :nodoc:
|
8
|
+
module Gihou
|
11
9
|
#
|
12
|
-
#
|
10
|
+
# Const 定数
|
13
11
|
#
|
14
|
-
module
|
12
|
+
module Const
|
15
13
|
#
|
16
|
-
#
|
14
|
+
# Number 数値
|
17
15
|
#
|
18
|
-
module
|
19
|
-
# @return [Integer] 総法(1日=1340分)
|
20
|
-
DAY = 1340
|
16
|
+
module Number
|
21
17
|
#
|
22
|
-
#
|
23
|
-
# @note 小数点以下の値によって大幅に結果が変わる。除算結果を設定した
|
18
|
+
# Cycle 周期
|
24
19
|
#
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
20
|
+
module Cycle
|
21
|
+
# @return [Integer] 総法(1日=1340分)
|
22
|
+
DAY = 1340
|
23
|
+
#
|
24
|
+
# @return [Float] 変日(1近点月 = 27日743分1秒(1分=12秒))
|
25
|
+
# @note 小数点以下の値によって大幅に結果が変わる。除算結果を設定した
|
26
|
+
#
|
27
|
+
# ANOMALISTIC_MONTH = 36_923.083333333333
|
28
|
+
ANOMALISTIC_MONTH = 36_923 + (1.0 / 12)
|
29
|
+
# @return [Integer] 朔望月
|
30
|
+
SYNODIC_MONTH = 39_571
|
31
|
+
# @return [Integer] 一年
|
32
|
+
YEAR = 489_428
|
33
|
+
end
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
#
|
36
|
+
# Derivation 導出
|
37
|
+
#
|
38
|
+
module Derivation
|
39
|
+
# @return [Integer] 通余: (YEAR - DAY * 12 * 30)
|
40
|
+
REMAINDER_ALL_YEAR = 7028
|
41
|
+
# @return [Integer] 旬周(60日) DAY * 60
|
42
|
+
SIXTY_DAYS = 80_400
|
43
|
+
end
|
42
44
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
#
|
46
|
+
# 累積
|
47
|
+
#
|
48
|
+
module Stack
|
49
|
+
# @return [Integer] 積年(甲子夜半朔旦冬至〜暦の開始前)
|
50
|
+
TOTAL_YEAR = 269_880
|
51
|
+
# @return [Integer] 暦の開始年(麟徳元年)
|
52
|
+
BEGIN_YEAR = 664
|
53
|
+
end
|
51
54
|
end
|
52
55
|
end
|
53
56
|
end
|
@@ -5,44 +5,47 @@ require_relative '../cycle/remainder'
|
|
5
5
|
# :nodoc:
|
6
6
|
module Zakuro
|
7
7
|
# :nodoc:
|
8
|
-
module
|
9
|
-
#
|
10
|
-
|
11
|
-
#
|
12
|
-
module Const
|
8
|
+
module Version
|
9
|
+
# :nodoc:
|
10
|
+
module Gihou
|
13
11
|
#
|
14
|
-
#
|
12
|
+
# Const 定数
|
15
13
|
#
|
16
|
-
module
|
14
|
+
module Const
|
17
15
|
#
|
18
|
-
#
|
16
|
+
# Remainder 大余小余
|
19
17
|
#
|
20
|
-
module
|
21
|
-
# @return [Remainder] 気策(24分の1年)
|
22
|
-
SOLAR_TERM_AVERAGE = Cycle::Remainder.new(day: 15, minute: 292, second: 5)
|
18
|
+
module Remainder
|
23
19
|
#
|
24
|
-
#
|
25
|
-
# * 39571 / 4 = 9892.75 / 1340 = 7 余り 512.75
|
26
|
-
# * 0.75 * 6(1分=6秒) = 4.5
|
20
|
+
# Solar 太陽
|
27
21
|
#
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
module Solar
|
23
|
+
# @return [Remainder] 気策(24分の1年)
|
24
|
+
SOLAR_TERM_AVERAGE = Cycle::Remainder.new(day: 15, minute: 292, second: 5)
|
25
|
+
#
|
26
|
+
# @note 常朔実 39571 = 29-711
|
27
|
+
# * 39571 / 4 = 9892.75 / 1340 = 7 余り 512.75
|
28
|
+
# * 0.75 * 6(1分=6秒) = 4.5
|
29
|
+
#
|
30
|
+
# @return [Cycle::Remainder] 弦(1分=6秒)
|
31
|
+
QUARTER = Cycle::Remainder.new(day: 7, minute: 512, second: 4.5)
|
32
|
+
end
|
31
33
|
|
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
34
|
#
|
40
|
-
#
|
41
|
-
# * 39571 / 4 = 9892.75 / 1340 = 7 余り 512.75
|
42
|
-
# * 0.75 * 12(1分=12秒) = 9
|
35
|
+
# Lunar 月
|
43
36
|
#
|
44
|
-
|
45
|
-
|
37
|
+
module Lunar
|
38
|
+
# @return [Cycle::LunarRemainder] 変日(1近点月)
|
39
|
+
ANOMALISTIC_MONTH = \
|
40
|
+
Cycle::LunarRemainder.new(day: 27, minute: 743, second: 1)
|
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
|
+
QUARTER = Cycle::LunarRemainder.new(day: 7, minute: 512, second: 9)
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
@@ -7,48 +7,51 @@ require_relative '../const/number'
|
|
7
7
|
# :nodoc:
|
8
8
|
module Zakuro
|
9
9
|
# :nodoc:
|
10
|
-
module
|
10
|
+
module Version
|
11
11
|
# :nodoc:
|
12
|
-
module
|
13
|
-
#
|
14
|
-
|
15
|
-
#
|
16
|
-
class Remainder < Calculation::Cycle::AbstractRemainder
|
17
|
-
# @return [Integer] 分(1分=6秒)
|
18
|
-
MINUTE = 6
|
19
|
-
|
20
|
-
#
|
21
|
-
# 初期化
|
12
|
+
module Gihou
|
13
|
+
# :nodoc:
|
14
|
+
module Cycle
|
22
15
|
#
|
23
|
-
#
|
24
|
-
# @param [Integer] minute 小余("分"に相当)
|
25
|
-
# @param [Integer] second 秒
|
26
|
-
# @param [Integer] total 繰り上げなしの小余
|
16
|
+
# Remainder 時刻情報(大余小余)
|
27
17
|
#
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
18
|
+
class Remainder < Calculation::Cycle::AbstractRemainder
|
19
|
+
# @return [Integer] 分(1分=6秒)
|
20
|
+
MINUTE = 6
|
33
21
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
22
|
+
#
|
23
|
+
# 初期化
|
24
|
+
#
|
25
|
+
# @param [Integer] day 大余("日"に相当)
|
26
|
+
# @param [Integer] minute 小余("分"に相当)
|
27
|
+
# @param [Integer] second 秒
|
28
|
+
# @param [Integer] total 繰り上げなしの小余
|
29
|
+
#
|
30
|
+
def initialize(day: -1, minute: -1, second: -1, total: -1)
|
31
|
+
super(base_day: Const::Number::Cycle::DAY, base_minute: MINUTE,
|
32
|
+
day: day, minute: minute, second: second, total: total)
|
33
|
+
end
|
34
|
+
end
|
40
35
|
|
41
36
|
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
# @param [Integer] day 大余("日"に相当)
|
45
|
-
# @param [Integer] minute 小余("分"に相当)
|
46
|
-
# @param [Integer] second 秒
|
47
|
-
# @param [Integer] total 繰り上げなしの小余
|
37
|
+
# LunarRemainder 月の位相計算向け時刻情報(大余小余)
|
48
38
|
#
|
49
|
-
|
50
|
-
|
51
|
-
|
39
|
+
class LunarRemainder < Calculation::Cycle::AbstractRemainder
|
40
|
+
# @return [Integer] 分(1分=12秒)
|
41
|
+
MINUTE = 12
|
42
|
+
|
43
|
+
#
|
44
|
+
# 初期化
|
45
|
+
#
|
46
|
+
# @param [Integer] day 大余("日"に相当)
|
47
|
+
# @param [Integer] minute 小余("分"に相当)
|
48
|
+
# @param [Integer] second 秒
|
49
|
+
# @param [Integer] total 繰り上げなしの小余
|
50
|
+
#
|
51
|
+
def initialize(day: -1, minute: -1, second: -1, total: -1)
|
52
|
+
super(base_day: Const::Number::Cycle::DAY, base_minute: MINUTE,
|
53
|
+
day: day, minute: minute, second: second, total: total)
|
54
|
+
end
|
52
55
|
end
|
53
56
|
end
|
54
57
|
end
|
@@ -9,24 +9,27 @@ require_relative './remainder'
|
|
9
9
|
# :nodoc:
|
10
10
|
module Zakuro
|
11
11
|
# :nodoc:
|
12
|
-
module
|
12
|
+
module Version
|
13
13
|
# :nodoc:
|
14
|
-
module
|
15
|
-
#
|
16
|
-
|
17
|
-
#
|
18
|
-
class SolarTerm < Calculation::Cycle::AbstractSolarTerm
|
19
|
-
# @return [Remainder] 気策(24分の1年)
|
20
|
-
SOLAR_TERM_AVERAGE = Const::Remainder::Solar::SOLAR_TERM_AVERAGE
|
21
|
-
|
22
|
-
#
|
23
|
-
# 初期化
|
14
|
+
module Gihou
|
15
|
+
# :nodoc:
|
16
|
+
module Cycle
|
24
17
|
#
|
25
|
-
#
|
26
|
-
# @param [Remainder] remainder 時刻情報(大余小余)
|
18
|
+
# SolarTerm 二十四節気
|
27
19
|
#
|
28
|
-
|
29
|
-
|
20
|
+
class SolarTerm < Calculation::Cycle::AbstractSolarTerm
|
21
|
+
# @return [Remainder] 気策(24分の1年)
|
22
|
+
SOLAR_TERM_AVERAGE = Const::Remainder::Solar::SOLAR_TERM_AVERAGE
|
23
|
+
|
24
|
+
#
|
25
|
+
# 初期化
|
26
|
+
#
|
27
|
+
# @param [Integer] index 連番
|
28
|
+
# @param [Remainder] remainder 時刻情報(大余小余)
|
29
|
+
#
|
30
|
+
def initialize(index: -1, remainder: Remainder.new)
|
31
|
+
super(index: index, remainder: remainder, average: SOLAR_TERM_AVERAGE)
|
32
|
+
end
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|