when_exe 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +171 -0
  3. data/lib/when_exe.rb +78 -47
  4. data/lib/when_exe/basictypes.rb +752 -747
  5. data/lib/when_exe/calendarnote.rb +805 -801
  6. data/lib/when_exe/calendartypes.rb +1583 -1531
  7. data/lib/when_exe/coordinates.rb +16 -15
  8. data/lib/when_exe/core/duration.rb +114 -110
  9. data/lib/when_exe/core/extension.rb +504 -504
  10. data/lib/when_exe/ephemeris.rb +1917 -1913
  11. data/lib/when_exe/ephemeris/moon.rb +333 -333
  12. data/lib/when_exe/ephemeris/notes.rb +389 -387
  13. data/lib/when_exe/ephemeris/planets.rb +585 -585
  14. data/lib/when_exe/ephemeris/sun.rb +214 -214
  15. data/lib/when_exe/googlecalendar.rb +144 -140
  16. data/lib/when_exe/icalendar.rb +1636 -1636
  17. data/lib/when_exe/inspect.rb +46 -22
  18. data/lib/when_exe/locales/akt.rb +176 -176
  19. data/lib/when_exe/locales/encoding_conversion.rb +134 -126
  20. data/lib/when_exe/locales/iast.rb +90 -90
  21. data/lib/when_exe/locales/locale.rb +750 -746
  22. data/lib/when_exe/locales/transliteration_table.rb +62 -62
  23. data/lib/when_exe/mini_application.rb +307 -305
  24. data/lib/when_exe/parts/enumerator.rb +2 -2
  25. data/lib/when_exe/parts/geometric_complex.rb +397 -397
  26. data/lib/when_exe/parts/method_cash.rb +224 -224
  27. data/lib/when_exe/parts/resource.rb +1069 -1071
  28. data/lib/when_exe/parts/timezone.rb +240 -230
  29. data/lib/when_exe/region/armenian.rb +56 -56
  30. data/lib/when_exe/region/babylonian.rb +405 -0
  31. data/lib/when_exe/region/bahai.rb +146 -146
  32. data/lib/when_exe/region/balinese.rb +622 -622
  33. data/lib/when_exe/region/chinese.rb +95 -25
  34. data/lib/when_exe/region/chinese/calendars.rb +1016 -1016
  35. data/lib/when_exe/region/chinese/epochs.rb +1 -1
  36. data/lib/when_exe/region/chinese/twins.rb +803 -795
  37. data/lib/when_exe/region/christian.rb +824 -824
  38. data/lib/when_exe/region/coptic.rb +106 -87
  39. data/lib/when_exe/region/discordian.rb +225 -225
  40. data/lib/when_exe/region/far_east.rb +188 -188
  41. data/lib/when_exe/region/french.rb +56 -56
  42. data/lib/when_exe/region/geologicalage.rb +639 -639
  43. data/lib/when_exe/region/goddess.rb +58 -58
  44. data/lib/when_exe/region/indian.rb +1254 -1251
  45. data/lib/when_exe/region/iranian.rb +8 -8
  46. data/lib/when_exe/region/islamic.rb +3 -3
  47. data/lib/when_exe/region/japanese.rb +93 -99
  48. data/lib/when_exe/region/japanese/calendars.rb +396 -397
  49. data/lib/when_exe/region/japanese/epochs.rb +26 -26
  50. data/lib/when_exe/region/japanese/nihon_shoki.rb +71 -71
  51. data/lib/when_exe/region/japanese/notes.rb +1383 -1386
  52. data/lib/when_exe/region/japanese/residues.rb +1306 -1306
  53. data/lib/when_exe/region/japanese/twins.rb +225 -225
  54. data/lib/when_exe/region/japanese/weeks.rb +112 -0
  55. data/lib/when_exe/region/javanese.rb +230 -230
  56. data/lib/when_exe/region/jewish.rb +126 -126
  57. data/lib/when_exe/region/korean.rb +378 -378
  58. data/lib/when_exe/region/m17n.rb +114 -113
  59. data/lib/when_exe/region/martian.rb +258 -255
  60. data/lib/when_exe/region/mayan.rb +32 -32
  61. data/lib/when_exe/region/residue.rb +89 -89
  62. data/lib/when_exe/region/roman.rb +36 -24
  63. data/lib/when_exe/region/ryukyu.rb +97 -97
  64. data/lib/when_exe/region/shire.rb +240 -240
  65. data/lib/when_exe/region/soviet.rb +209 -0
  66. data/lib/when_exe/region/symmetry.rb +50 -50
  67. data/lib/when_exe/region/thai.rb +336 -335
  68. data/lib/when_exe/region/tibetan.rb +316 -315
  69. data/lib/when_exe/region/vietnamese.rb +440 -439
  70. data/lib/when_exe/region/weekdate.rb +80 -80
  71. data/lib/when_exe/region/world.rb +175 -175
  72. data/lib/when_exe/region/yerm.rb +14 -14
  73. data/lib/when_exe/region/zoroastrian.rb +203 -203
  74. data/lib/when_exe/timestandard.rb +707 -681
  75. data/lib/when_exe/tmduration.rb +338 -330
  76. data/lib/when_exe/tmobjects.rb +1346 -1325
  77. data/lib/when_exe/tmposition.rb +2115 -2072
  78. data/lib/when_exe/tmreference.rb +1693 -1669
  79. data/lib/when_exe/version.rb +1 -1
  80. data/link_to_online_documents +1 -1
  81. data/test/examples/JapanHolidaysRFC6350.ics +1 -1
  82. data/test/test.rb +67 -61
  83. data/test/test/basictypes.rb +409 -409
  84. data/test/test/calendarnote.rb +86 -69
  85. data/test/test/calendartypes.rb +97 -97
  86. data/test/test/coordinates.rb +396 -396
  87. data/test/test/ephemeris.rb +83 -74
  88. data/test/test/ephemeris/moon.rb +14 -14
  89. data/test/test/ephemeris/planets.rb +14 -14
  90. data/test/test/ephemeris/sun.rb +14 -14
  91. data/test/test/googlecalendar.rb +194 -176
  92. data/test/test/icalendar.rb +867 -858
  93. data/test/test/inspect.rb +117 -117
  94. data/test/test/parts.rb +487 -487
  95. data/test/test/region/balinese.rb +34 -0
  96. data/test/test/region/chinese.rb +218 -206
  97. data/test/test/region/christian.rb +245 -245
  98. data/test/test/region/coptic.rb +27 -27
  99. data/test/test/region/french.rb +33 -33
  100. data/test/test/region/geologicalage.rb +17 -17
  101. data/test/test/region/indian.rb +57 -57
  102. data/test/test/region/iran.rb +54 -54
  103. data/test/test/region/islamic.rb +18 -18
  104. data/test/test/region/japanese.rb +237 -219
  105. data/test/test/region/jewish.rb +61 -61
  106. data/test/test/region/m17n.rb +184 -184
  107. data/test/test/region/mayan.rb +195 -195
  108. data/test/test/region/residue.rb +147 -139
  109. data/test/test/region/thai.rb +116 -116
  110. data/test/test/region/tibetan.rb +30 -30
  111. data/test/test/region/vietnamese.rb +102 -102
  112. data/test/test/region/yerm.rb +146 -146
  113. data/test/test/timestandard.rb +81 -81
  114. data/test/test/tmobjects.rb +328 -328
  115. data/test/test/tmposition.rb +397 -284
  116. data/test/test/tmreference.rb +157 -157
  117. metadata +13 -10
@@ -391,7 +391,7 @@ module When
391
391
  ["[永寧]1" , "@A" , "name=[石祗];350-01=", "351-04="] # 3102-1
392
392
  ],
393
393
  [self,
394
- "period:[]",
394
+ "period:[冉魏]",
395
395
  ["[永興]1" , "@A" , "name=[冉閔];350-02=^Chinese0239", "352-04="] # 3102-1 考異あり
396
396
  ],
397
397
  [self,
@@ -1,795 +1,803 @@
1
- # -*- coding: utf-8 -*-
2
- =begin
3
- Copyright (C) 2011-2014 Takashi SUGA
4
-
5
- You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
- =end
7
-
8
- module When
9
-
10
- class TM::CalendarEra
11
-
12
- # Chinese Luni-Solar Calendar Series for Chinese Note
13
- ChineseLuniSolar = [self, [
14
- 'locale:[ja=ja:, en=en:]',
15
- 'area:[中国の暦月=, *ChineseLuniSolar=]',
16
- ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦', '85-01-01'], # 西暦が正になるところから開始(実際は-103.01.01)
17
- ['[四分暦]85.01.01', '@CR', '85-01-01^ChineseTwin::四分暦', '265-01-01'],
18
- ['[乾象暦]222.01.01', '@CR', '222-01-01^ChineseTwin::乾象暦', '281-01-01'],
19
- ['[景初暦]237.01.01', '@CR', '237-01-01^ChineseTwin::景初暦', '452-01-01'],
20
- ['[元嘉暦]445.01.01', '@CR', '445-01-01^ChineseTwin::元嘉暦', '510-01-01'],
21
- ['[大明暦]510.01.01', '@CR', '510-01-01^ChineseTwin::大明暦', '590-01-01'],
22
- ['[三紀暦=]384.01.01', '@CR', '384-01-01^ChineseTwin::三紀暦', '418-01-01'],
23
- ['[玄始暦=]412.01.01', '@CR', '412-01-01^ChineseTwin::玄始暦', '440-01-01'],
24
- ['[玄始暦=]452.01.01', '@CR', '452-01-01^ChineseTwin::玄始暦', '523-01-01'],
25
- ['[正光暦=]523.01.01', '@CR', '523-01-01^ChineseTwin::正光暦', '566-01-01'],
26
- ['[興和暦=]540.01.01', '@CR', '540-01-01^ChineseTwin::興和暦', '551-01-01'],
27
- ['[天保暦=]551.01.01', '@CR', '551-01-01^ChineseTwin::天保暦', '578-01-01'],
28
- ['[天和暦=]566.01.01', '@CR', '566-01-01^ChineseTwin::天和暦', '579-01-01'],
29
- ['[大象暦=]579.01.01', '@CR', '579-01-01^ChineseTwin::大象暦', '584-01-01'],
30
- ['[開皇暦=]584.01.01', '@CR', '584-01-01^ChineseTwin::開皇暦', '597-01-01'],
31
- ['[大業暦=]597.01.01', '@CR', '597-01-01^ChineseTwin::大業暦', '619-01-01'],
32
- ['[戊寅元暦]619.01.01', '@CR', '619-01-01^ChineseTwin::戊寅元暦', '645-01-01'],
33
- ['[平朔戊寅暦=]645.01.01','@CR','645-01-01^ChineseTwin::平朔戊寅暦','665-01-01'],
34
- ['[麟徳暦]665.01.01', '@CR', '665-01-01^ChineseTwin::麟徳暦', '729-01-01'],
35
- ['[大衍暦]729.01.01', '@CR', '729-01-01^ChineseTwin::大衍暦', '762-01-01'],
36
- ['[五紀暦]762.01.01', '@CR', '762-01-01^ChineseTwin::五紀暦', '784-01-01'],
37
- ['[正元暦=]784.01.01', '@CR', '784-01-01^ChineseTwin::正元暦', '807-01-01'],
38
- ['[宣明暦]822.01.01', '@CR', '822-01-01^ChineseTwin::宣明暦', '893-01-01'],
39
- ['[崇玄暦=]893.01.01', '@CR', '893-01-01^ChineseTwin::崇玄暦', '956-01-01'],
40
- ['[授時暦]1281.01.01', '@CR','1281-01-01^ChineseTwin::授時暦', '1368-01-01'],
41
- ['[大統暦]1368.01.01', '@CR','1368-01-01^ChineseTwin::大統暦', '1645-01-01']
42
- ]]
43
-
44
- # Chinese Solar Calendar Series for Chinese Note
45
- ChineseSolar = [self, [
46
- 'locale:[ja=ja:, en=en:]',
47
- 'area:[中国の節月=, *ChineseSolar=]',
48
- ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦(節月)', '85-01-06'], # 西暦が正になるところから開始(実際は-103.01.15)
49
- ['[四分暦]85.01.07', '@CR', '85-01-07^ChineseTwin::四分暦(節月)', '264-12-28'],
50
- ['[乾象暦]221.12.23', '@CR', '221-12-23^ChineseTwin::乾象暦(節月)', '280-12-31'],
51
- ['[景初暦]237.01.07', '@CR', '237-01-07^ChineseTwin::景初暦(節月)', '451-12-31'],
52
- ['[元嘉暦]444.12.22', '@CR', '444-12-22^ChineseTwin::元嘉暦(節月)', '509-12-24'],
53
- ['[大明暦]509.12.23', '@CR', '509-12-23^ChineseTwin::大明暦(節月)', '590-01-08'],
54
- ['[三紀暦=]384.01.02', '@CR', '384-01-02^ChineseTwin::三紀暦(節月)', '418-01-16'],
55
- ['[玄始暦=]411.12.26', '@CR', '411-12-26^ChineseTwin::玄始暦(節月)', '440-01-15'],
56
- ['[玄始暦=]452.01.02', '@CR', '452-01-02^ChineseTwin::玄始暦(節月)', '522-12-29'],
57
- ['[正光暦=]522.12.29', '@CR', '522-12-29^ChineseTwin::正光暦(節月)', '566-01-05'],
58
- ['[興和暦=]539.12.22', '@CR', '539-12-22^ChineseTwin::興和暦(節月)', '550-12-20'],
59
- ['[天保暦=]550.12.19', '@CR', '550-12-19^ChineseTwin::天保暦(節月)', '577-12-21'],
60
- ['[天和暦=]566.01.05', '@CR', '566-01-05^ChineseTwin::天和暦(節月)', '579-01-11'],
61
- ['[大象暦=]579.01.11', '@CR', '579-01-11^ChineseTwin::大象暦(節月)', '584-01-15'],
62
- ['[開皇暦=]584.01.16', '@CR', '584-01-16^ChineseTwin::開皇暦(節月)', '596-12-23'],
63
- ['[大業暦=]596.12.22', '@CR', '596-12-22^ChineseTwin::大業暦(節月)', '618-12-19'],
64
- ['[戊寅元暦]618.12.19', '@CR', '618-12-19^ChineseTwin::戊寅元暦(節月)', '664-12-21'],
65
- ['[麟徳暦]664.12.21', '@CR', '664-12-21^ChineseTwin::麟徳暦(節月)', '729-01-03'],
66
- ['[大衍暦]729.01.03', '@CR', '729-01-03^ChineseTwin::大衍暦(節月)', '761-12-29'],
67
- ['[五紀暦]761.12.29', '@CR', '761-12-29^ChineseTwin::五紀暦(節月)', '783-12-26'],
68
- ['[正元暦=]783.12.26', '@CR', '783-12-26^ChineseTwin::正元暦(節月)', '807-01-11'],
69
- ['[宣明暦]821.01.01', '@CR', '821-01-01^ChineseTwin::宣明暦(節月)', '892-12-22'], # 年の始めに遡って開始(実際は12.27)
70
- ['[崇玄暦=]892.12.22', '@CR', '892-12-22^ChineseTwin::崇玄暦(節月)', '956-01-15'],
71
- ['[授時暦]1280.01.01', '@CR', '1280-01-01^ChineseTwin::授時暦(節月)', '1367-12-24'],
72
- ['[大統暦]1367.12.24', '@CR', '1367-12-24^ChineseTwin::大統暦(節月)', '1644-12-24']
73
- ]]
74
- end
75
-
76
- module CalendarTypes
77
-
78
- _chinese_common ={
79
- 'day_epoch' => 2188871 + 55.06, # 暦元天正冬至のユリウス日
80
- 'year_epoch' => 1281, # 暦元の西暦年
81
- 'year_length' => 365.2425, # 暦元の冬至年 / 日
82
- 'lunation_length' => 29.530593, # 朔実(朔望月)
83
- 'lunation_shift' => 20.185, # 閏應(暦元前経朔から暦元天正冬至までの日数)
84
- 'lunar_mean_motion' => 13.36875, # 月平行(恒星天に対する月の平均運動 / 日)
85
- 'anomalistic_month_length' => 27.5546, # 転終(近点月)
86
- 'anomalistic_month_shift' => 13.1904, # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
87
- 'anomaly_method' => 'a', # (経朔-定朔)の計算方法(a:差分, b:微分, c:幾何学的補正)
88
- 'lunar_unit' => 27.5546 / (84*4), # 太陰遅速計算用招差法定数の時間の単位(限)
89
- 'solar_weight' => 0, # (経朔-定朔)の計算で用いる実行差での太陽盈縮の重み(0:非考慮,1:考慮)
90
- 's' => [ # 太陽盈縮計算用招差法定数
91
- [ 0 ... 88.909225, 0, [0, +513_3200, -2_4600, -31]],
92
- [ 88.909225...182.62125, 182.62125, [0, +487_0600, -2_2100, -27]],
93
- [182.62125 ...276.333275, 182.62125, [0, -487_0600, +2_2100, +27]],
94
- [276.333275.. 365.2425, 365.2425, [0, -513_3200, +2_4600, +31]]
95
- ],
96
- 'm' => [ # 太陰遅速計算用招差法定数
97
- [ 0... 82, 0, [ +0, +1111_0000, -2_8100, -325 ]],
98
- [ 82... 86, 84, [+5_4293_4424, +0, -1_9292, -0, +1484]],
99
- [ 86...168, 168, [ +0, +1111_0000, -2_8100, -325 ]],
100
- [168...250, 168, [ -0, -1111_0000, +2_8100, +325 ]],
101
- [250...254, 252, [-5_4293_4424, -0, +1_9292, +0, -1484]],
102
- [254.. 336, 336, [ -0, -1111_0000, +2_8100, +325 ]]
103
- ]
104
- }
105
-
106
- ChineseTwin = [{}, When::BasicTypes::M17n, ChineseSolar.twin('ChineseTwin', [
107
- "locale:[=ja:, en=en:, alias]",
108
- "area:[中国,China]",
109
-
110
- [ChineseLuniSolar,
111
- 'name:[黄帝暦]',
112
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1228331',
113
- 'intercalary_month:12'
114
- ],
115
-
116
- [ChineseLuniSolar,
117
- 'name:[顓頊暦]',
118
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1171396&longitude_shift=-1/8',
119
- 'time_basis:+00,+#{P:12}',
120
- 'intercalary_month:9'
121
- ],
122
-
123
- [ChineseLuniSolar,
124
- 'name:[夏暦]',
125
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1328411',
126
- 'intercalary_month:12'
127
- ],
128
-
129
- [ChineseLuniSolar,
130
- 'name:[殷暦]',
131
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1149071',
132
- 'intercalary_month:12'
133
- ],
134
-
135
- [ChineseLuniSolar,
136
- 'name:[周暦]',
137
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1128251',
138
- 'intercalary_month:12'
139
- ],
140
-
141
- [ChineseLuniSolar,
142
- 'name:[魯暦]',
143
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1048991',
144
- 'intercalary_month:12'
145
- ],
146
-
147
- [ChineseLuniSolar,
148
- 'name:[太初暦]',
149
- 'formula:MeanLunation?year_length=562120/1539&lunation_length=2392/81&day_epoch=1683431'
150
- ],
151
-
152
- [ChineseLuniSolar,
153
- 'name:[四分暦]',
154
- 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1662611'
155
- ],
156
-
157
- [ChineseLuniSolar,
158
- 'name:[乾象暦]',
159
- 'formula:MeanLunation?year_length=215130/589&lunation_length=43026/1457&day_epoch=-898129'
160
- ],
161
-
162
- [ChineseLuniSolar,
163
- 'name:[景初暦]',
164
- 'formula:MeanLunation?year_length=673150/1843&lunation_length=134630/4559&day_epoch=+330191'
165
- ],
166
-
167
- [ChineseLuniSolar,
168
- 'name:[三紀暦]',
169
- 'formula:MeanLunation?year_length=895220/2451&lunation_length=179044/6063&day_epoch=-28760989'
170
- ],
171
-
172
- [ChineseLuniSolar,
173
- 'name:[玄始暦]',
174
- 'formula:MeanLunation?year_length=2629759/7200&lunation_length=2629759/89052&day_epoch=-20568349'
175
- ],
176
-
177
- [ChineseLuniSolar,
178
- 'name:[元嘉暦]',
179
- 'formula:MeanLunation?year_length=111035/304&lunation_length=22207/752&day_epoch=-200089&longitude_shift=-1/12' # 春分の1ヶ月前
180
- ],
181
-
182
- [ChineseLuniSolar,
183
- 'name:[大明暦]',
184
- 'formula:MeanLunation?year_length=14423804/39491&lunation_length=116321/3939&day_epoch=-17080189'
185
- ],
186
-
187
- [ChineseLuniSolar,
188
- 'name:[正光暦]',
189
- 'formula:MeanLunation?year_length=2213377/6060&lunation_length=2213377/74952&day_epoch=-59357929'
190
- ],
191
-
192
- [ChineseLuniSolar,
193
- 'name:[興和暦]',
194
- 'formula:MeanLunation?year_length=6158017/16860&lunation_length=6158017/208530&day_epoch=-105462049'
195
- ],
196
-
197
- [ChineseLuniSolar,
198
- 'name:[天保暦]',
199
- 'formula:MeanLunation?year_length=8641687/23660&lunation_length=8641687/292635&day_epoch=-38447089'
200
- ],
201
-
202
- [ChineseLuniSolar,
203
- 'name:[天和暦]',
204
- 'formula:MeanLunation?year_length=8568631/23460&lunation_length=8568631/290160&day_epoch=-317950249'
205
- ],
206
-
207
- [ChineseLuniSolar,
208
- 'name:[大象暦]',
209
- 'formula:MeanLunation?year_length=4745247/12992&lunation_length=1581749/53563&day_epoch=-13244449'
210
- ],
211
-
212
- [ChineseLuniSolar,
213
- 'name:[開皇暦]',
214
- 'formula:MeanLunation?year_length=37605463/102960&lunation_length=5372209/181920&day_epoch=-1506155749'
215
- ],
216
-
217
- [ChineseLuniSolar,
218
- 'name:[大業暦]',
219
- 'formula:MeanLunation?year_length=15573963/42640&lunation_length=33783/1144&day_epoch=-519493909'
220
- ],
221
-
222
- [ChineseLuniSolar,
223
- 'name:[戊寅元暦]',
224
- 'time_basis:+00,+#{P:00}',
225
- {'formula'=>['12S', '1L'].map {|f| [
226
- Ephemeris::ChineseTrueLunation, {
227
- 'formula' => f,
228
- 'day_epoch' => -58077529,
229
- 'year_length' => '3456675/9464', # 365.0 + 2315/9464(度法)
230
- 'lunation_length' => '384075/13006', # 29.0 + 6901/13006(日法)
231
- 'anomalistic_month_length' => '99775/3621', # 27.0 + 16064/28968 (798200(暦周)/28968(暦法))
232
- 'rissei' => 'a',
233
- 'method' => 'C',
234
- 's' => [
235
- #(先後數) 盈縮數
236
- [ 0.0, 0], # 冬至
237
- [ 0.0, +896], # 大寒
238
- [ 0.0, +1294], # 小寒
239
- [ 0.0, +1694], # 立春
240
- [ 0.0, +1922], # 啓蟄
241
- [ 0.0, +2263], # 雨水
242
- [ 0.0, +2713], # 春分
243
- [ 0.0, +2213], # 清明
244
- [ 0.0, +1758], # 穀雨
245
- [ 0.0, +1403], # 立夏
246
- [ 0.0, +848], # 小満
247
- [ 0.0, 0], # 芒種
248
- [ 0.0, -739], # 夏至
249
- [ 0.0, -1365], # 小暑
250
- [ 0.0, -1821], # 大暑
251
- [ 0.0, -2109], # 立秋
252
- [ 0.0, -2149], # 処暑
253
- [ 0.0, -2491], # 白露
254
- [ 0.0, -2946], # 秋分
255
- [ 0.0, -2264], # 寒露
256
- [ 0.0, -1639], # 霜降
257
- [ 0.0, -1069], # 立冬
258
- [ 0.0, -556], # 小雪
259
- [ 0.0, -100] # 大雪
260
- ],
261
- 'm' => [
262
- #(変日差) 盈縮積分の差分(9037=章歳(676)+章月(8361))
263
- [13006.0, -11341226.0/9037], # 1日
264
- [13006.0, -10053632.0/9037], # 2日
265
- [13006.0, -8557946.0/9037], # 3日
266
- [13006.0, -6841146.0/9037], # 4日
267
- [13006.0, -4903257.0/9037], # 5日
268
- [13006.0, -2978403.0/9037], # 6日
269
- [13006.0, -1053445.0/9037], # 7日
270
- [13006.0, +1092498.0/9037], # 8日
271
- [13006.0, +3238489.0/9037], # 9日
272
- [13006.0, +5163376.0/9037], # 10日
273
- [13006.0, +6880164.0/9037], # 11日
274
- [13006.0, +8388868.0/9037], # 12日
275
- [13006.0, +9884554.0/9037], # 13日
276
- [13006.0, +11172149.0/9037], # 14日
277
- [13006.0, +10742961.0/9037], # 15日
278
- [13006.0, +9455368.0/9037], # 16日
279
- [13006.0, +7959678.0/9037], # 17日
280
- [13006.0, +6242886.0/9037], # 18
281
- [13006.0, +4526094.0/9037], # 19
282
- [13006.0, +2601205.0/9037], # 20
283
- [13006.0, +663312.0/9037], # 21
284
- [13006.0, -1482690.0/9037], # 22
285
- [13006.0, -3407578.0/9037], # 23
286
- [13006.0, -5332465.0/9037], # 24
287
- [13006.0, -7036252.0/9037], # 25
288
- [13006.0, -8753044.0/9037], # 26
289
- [13006.0, -10040638.0/9037], # 27
290
- [ 7212.4, -6229880.0/9037] # 28
291
- ]
292
- }]
293
- }
294
- }
295
- ],
296
-
297
- [ChineseLuniSolar,
298
- 'name:[平朔戊寅暦]',
299
- 'formula:MeanLunation?year_length=3456675/9464&lunation_length=384075/13006&day_epoch=-58077529'
300
- ],
301
-
302
- [ChineseLuniSolar,
303
- 'name:[麟徳暦]',
304
- 'time_basis:+00,+#{P:00}',
305
- {'formula'=>['12S', '1L'].map {|f| [
306
- Ephemeris::ChineseTrueLunation, {
307
- 'formula' => f,
308
- 'day_epoch' => -96608689,
309
- 'year_length' => '122357/335',
310
- 'lunation_length' => '39571/1340',
311
- 'anomalistic_month_length' => '443077/16080', # 27.0 + (743.0+1.0/12)/1340,
312
- # 'rissei' => 'B',
313
- 'method' => '#{Method:A}',
314
- 's' => [
315
- # 消息總 盈朒積 立成b 立成c
316
- [ 0.0, 0, +3.9546, -0.0372], # 冬至
317
- [ -722.0, +54, +3.4091, -0.0372], # 大寒
318
- [-1340.0, +100, +2.8636, -0.0372], # 小寒
319
- [-1854.0, +138, +2.3181, +0.0372], # 立春
320
- [-2368.0, +176, +2.8636, +0.0372], # 啓蟄
321
- [-2986.0, +222, +3.4091, +0.0372], # 雨水
322
- [-3708.0, +276, -3.7220, +0.0329], # 春分
323
- [-2986.0, +222, -3.2086, +0.0329], # 清明
324
- [-2368.0, +176, -2.6952, +0.0329], # 穀雨
325
- [-1854.0, +138, -2.1818, -0.0329], # 立夏
326
- [-1340.0, +100, -2.6952, -0.0329], # 小満
327
- [ -722.0, +54, -3.2086, -0.0329], # 芒種
328
- [ 0.0, 0, -3.7220, +0.0329], # 夏至
329
- [ +722.0, -54, -3.2086, +0.0329], # 小暑
330
- [+1340.0, -100, -2.6952, +0.0329], # 大暑
331
- [+1854.0, -138, -2.1818, -0.0329], # 立秋
332
- [+2368.0, -176, -2.6952, -0.0329], # 処暑
333
- [+2986.0, -222, -3.2086, -0.0329], # 白露
334
- [+3708.0, -276, +3.9546, -0.0372], # 秋分
335
- [+2986.0, -222, +3.4091, -0.0372], # 寒露
336
- [+2368.0, -176, +2.8636, -0.0372], # 霜降
337
- [+1854.0, -138, +2.3181, +0.0372], # 立冬
338
- [+1340.0, -100, +2.8636, +0.0372], # 小雪
339
- [ +722.0, -54, +3.4091, +0.0372], # 大雪
340
- ],
341
- 'm' => [
342
- #(変日差) 増減率
343
- [1340.0, -134], # 1日
344
- [1340.0, -117], # 2日
345
- [1340.0, -99], # 3日
346
- [1340.0, -78], # 4日
347
- [1340.0, -56], # 5日
348
- [1340.0, -33], # 6日
349
- [1191.0, -9], # 7日
350
- [ 149.0, 0], # 7日
351
- [1340.0, +14], # 8日
352
- [1340.0, +38], # 9日
353
- [1340.0, +62], # 10日
354
- [1340.0, +85], # 11日
355
- [1340.0, +104], # 12日
356
- [1340.0, +121], # 13日
357
- [1042.0, +102], # 14日
358
- [ 298.0, +29], # 14日
359
- [1340.0, +128], # 15日
360
- [1340.0, +115], # 16日
361
- [1340.0, +95], # 17
362
- [1340.0, +74], # 18
363
- [1340.0, +52], # 19
364
- [1340.0, +28], # 20
365
- [ 892.0, +4], # 21
366
- [ 448.0, 0], # 21
367
- [1340.0, -20], # 22
368
- [1340.0, -44], # 23
369
- [1340.0, -68], # 24
370
- [1340.0, -89], # 25
371
- [1340.0, -108], # 26
372
- [1340.0, -125], # 27
373
- [ 743.0+1.0/12, -71] # 28
374
- ]
375
- }]
376
- },
377
- 'doyo' => (Rational( 4,15) + 244) / 1340
378
- }
379
- ],
380
-
381
- [ChineseLuniSolar,
382
- 'name:[大衍暦]',
383
- 'time_basis:+00,+#{P:03}',
384
- {'formula'=>['12S', '1L'].map {|f| [
385
- Ephemeris::ChineseTrueLunation, {
386
- 'formula' => f,
387
- 'day_epoch' => -35412747829,
388
- 'year_length' => '1110343/3040',
389
- 'lunation_length' => '89773/3040',
390
- 'anomalistic_month_length' => '6701279/243200', # 27.0 +(1685.0+79.0/80)/3040,
391
- # 'rissei' => 'C',
392
- 's' => [
393
- # 先後數 朓朒積 立成b 立成c
394
- [ 0.0, 0, +13.4524, -0.1886], # 冬至
395
- [-2353.0, +176, +10.5564, -0.1634], # 大寒
396
- [-4198.0, +314, +8.0408, -0.1446], # 小寒
397
- [-5588.0, +418, +5.8160, -0.1318], # 立春
398
- [-6564.0, +491, +3.7987, -0.1240], # 雨水
399
- [-7152.0, +535, +1.9265, -0.1240], # 啓蟄
400
- [-7366.0, +551, -0.2048, -0.1178], # 春分
401
- [-7152.0, +535, -1.9968, -0.1190], # 清明
402
- [-6564.0, +491, -3.7956, -0.1240], # 穀雨
403
- [-5588.0, +418, -5.6626, -0.1324], # 立夏
404
- [-4198.0, +314, -7.6555, -0.1436], # 小満
405
- [-2353.0, +176, -9.9405, -0.1436], # 芒種
406
- [ 0.0, 0, -12.0819, +0.1436], # 夏至
407
- [+2353.0, -176, -9.7018, +0.1324], # 小暑
408
- [+4198.0, -314, -7.5450, +0.1240], # 大暑
409
- [+5588.0, -418, -5.5634, +0.1190], # 立秋
410
- [+6564.0, -491, -3.7038, +0.1178], # 処暑
411
- [+7152.0, -535, -1.8954, +0.1178], # 白露
412
- [+7366.0, -551, +0.1783, +0.1240], # 秋分
413
- [+7152.0, -535, +2.0042, +0.1318], # 寒露
414
- [+6564.0, -491, +3.8950, +0.1446], # 霜降
415
- [+5588.0, -418, +5.9214, +0.1634], # 立冬
416
- [+4198.0, -314, +8.1610, +0.1886], # 小雪
417
- [+2353.0, -176, +10.9010, +0.1886], # 大雪
418
- ],
419
- 'm' => [
420
- #(変日差) 損益率
421
- [3040.0, +297], # 1日
422
- [3040.0, +259], # 2日
423
- [3040.0, +220], # 3日
424
- [3040.0, +180], # 4日
425
- [3040.0, +139], # 5日
426
- [3040.0, +97], # 6日
427
- [2701.0, +48], # 7日
428
- [ 339.0, -6], # 7日
429
- [3040.0, -64], # 8日
430
- [3040.0, -106], # 9日
431
- [3040.0, -148], # 10日
432
- [3040.0, -189], # 11日
433
- [3040.0, -229], # 12日
434
- [3040.0, -267], # 13日
435
- [2363.0, -231], # 14日
436
- [ 677.0, -66], # 14日
437
- [3040.0, -289], # 15日
438
- [3040.0, -250], # 16日
439
- [3040.0, -211], # 17
440
- [3040.0, -171], # 18
441
- [3040.0, -130], # 19
442
- [3040.0, -87], # 20
443
- [2024.0, -36], # 21
444
- [1016.0, +18], # 21
445
- [3040.0, +73], # 22
446
- [3040.0, +116], # 23
447
- [3040.0, +157], # 24
448
- [3040.0, +198], # 25
449
- [3040.0, +237], # 26
450
- [3040.0, +276], # 27
451
- [1686.0, +165] # 28
452
- ]
453
- }]
454
- },
455
- 'doyo' => (Rational(13,30) + 531) / 3040
456
- }
457
- ],
458
-
459
- [ChineseLuniSolar,
460
- 'name:[五紀暦]',
461
- 'time_basis:+00,+#{P:06}',
462
- {'formula'=>['12S', '1L'].map {|f| [
463
- Ephemeris::ChineseTrueLunation, {
464
- 'formula' => f,
465
- 'day_epoch' => -96608689,
466
- 'year_length' => '122357/335',
467
- 'lunation_length' => '39571/1340',
468
- 'anomalistic_month_length' => '1366156/49580', # 27.0 + (743.0+5.0/37)/1340,
469
- # 'rissei' => 'C',
470
- 's' => [
471
- # 先後數 朓朒積 立成b 立成c
472
- [ 0.0, 0, +5.9668, -0.0843], # 冬至
473
- [-1037.0, +78, +4.6652, -0.0721], # 大寒
474
- [-1850.0, +139, +3.5656, -0.0653], # 小寒
475
- [-2463.0, +185, +2.5583, -0.0590], # 立春
476
- [-2893.0, +217, +1.6375, -0.0532], # 雨水
477
- [-3152.0, +236, +0.8384, -0.0532], # 啓蟄
478
- [-3246.0, +243, -0.0972, -0.0505], # 春分
479
- [-3152.0, +236, -0.8480, -0.0534], # 清明
480
- [-2893.0, +217, -1.6517, -0.0561], # 穀雨
481
- [-2463.0, +185, -2.5057, -0.0584], # 立夏
482
- [-1850.0, +139, -3.3781, -0.0643], # 小満
483
- [-1037.0, +78, -4.3954, -0.0643], # 芒種
484
- [ 0.0, 0, -5.3592, +0.0643], # 夏至
485
- [+1037.0, -78, -4.2877, +0.0584], # 小暑
486
- [+1850.0, -139, -3.3459, +0.0561], # 大暑
487
- [+2463.0, -185, -2.4475, +0.0534], # 立秋
488
- [+2893.0, -217, -1.5966, +0.0505], # 処暑
489
- [+3152.0, -236, -0.8185, +0.0505], # 白露
490
- [+3246.0, -243, +0.0858, +0.0532], # 秋分
491
- [+3152.0, -236, +0.8505, +0.0590], # 寒露
492
- [+2893.0, -217, +1.6943, +0.0653], # 霜降
493
- [+2463.0, -185, +2.6205, +0.0721], # 立冬
494
- [+1850.0, -139, +3.6007, +0.0843], # 小雪
495
- [+1037.0, -78, +4.8330, +0.0843], # 大雪
496
- ],
497
- 'm' => [
498
- #(変日差) 損益率
499
- [1340.0, -135], # 1日
500
- [1340.0, -117], # 2日
501
- [1340.0, -99], # 3日
502
- [1340.0, -78], # 4日
503
- [1340.0, -56], # 5日
504
- [1340.0, -33], # 6日
505
- [1191.0, -8], # 7日
506
- [ 149.0, +1], # 7日
507
- [1340.0, +14], # 8日
508
- [1340.0, +38], # 9日
509
- [1340.0, +62], # 10日
510
- [1340.0, +85], # 11日
511
- [1340.0, +103], # 12日
512
- [1340.0, +118], # 13日
513
- [1042.0, +105], # 14日
514
- [ 298.0, +30], # 14日
515
- [1340.0, +128], # 15日
516
- [1340.0, +115], # 16日
517
- [1340.0, +95], # 17
518
- [1340.0, +74], # 18
519
- [1340.0, +52], # 19
520
- [1340.0, +28], # 20
521
- [ 892.0, +6], # 21
522
- [ 448.0, -3], # 21
523
- [1340.0, -20], # 22
524
- [1340.0, -42], # 23
525
- [1340.0, -65], # 24
526
- [1340.0, -89], # 25
527
- [1340.0, -109], # 26
528
- [1340.0, -125], # 27
529
- [ 743.0+5.0/37, -75] # 28
530
- ]
531
- }]
532
- },
533
- 'doyo' => (Rational( 4,15) + 244) / 1340
534
- }
535
- ],
536
-
537
- [ChineseLuniSolar,
538
- 'name:[正元暦]',
539
- 'time_basis:+00,+#{P:06}',
540
- {'formula'=>['12S', '1L'].map {|f| [
541
- Ephemeris::ChineseTrueLunation, {
542
- 'formula' => f,
543
- 'day_epoch' => -145149709,
544
- 'year_length' => '399943/1095', # 365.0 + 268/1095(通法)
545
- 'lunation_length' => '32336/1095', # 29.0 + 581/1095
546
- 'anomalistic_month_length' => '301720132/10950000', # 27.0 + 607.0132(轉終日)/1095 (301720132(轉終分)/10950000)
547
- 'rissei' => 'c',
548
- 'method' => 'C',
549
- 's' => [
550
- # 先後數 朓朒積
551
- [ 0.0, 0], # 冬至
552
- [ -848.0, +63], # 大寒
553
- [-1512.0, +113], # 小寒
554
- [-2013.0, +150], # 立春
555
- [-2364.0, +176], # 雨水
556
- [-2576.0, +192], # 啓蟄
557
- [-2653.0, +198], # 春分
558
- [-2576.0, +192], # 清明
559
- [-2364.0, +176], # 穀雨
560
- [-2013.0, +150], # 立夏
561
- [-1512.0, +113], # 小満
562
- [ -848.0, +63], # 芒種
563
- [ 0.0, 0], # 夏至
564
- [ +848.0, -63], # 小暑
565
- [+1512.0, -113], # 大暑
566
- [+2013.0, -150], # 立秋
567
- [+2364.0, -176], # 処暑
568
- [+2576.0, -192], # 白露
569
- [+2653.0, -198], # 秋分
570
- [+2576.0, -192], # 寒露
571
- [+2364.0, -176], # 霜降
572
- [+2013.0, -150], # 立冬
573
- [+1512.0, -113], # 小雪
574
- [ +848.0, -63], # 大雪
575
- ],
576
- 'm' => [
577
- #(変日差) 損益率
578
- [1095.0, -110], # 1日
579
- [1095.0, -96], # 2日
580
- [1095.0, -81], # 3日
581
- [1095.0, -64], # 4日
582
- [1095.0, -46], # 5日
583
- [1095.0, -27], # 6日
584
- [ 973.0, -7], # 7日
585
- [ 122.0, +1], # 7日
586
- [1095.0, +12], # 8日
587
- [1095.0, +31], # 9日
588
- [1095.0, +51], # 10日
589
- [1095.0, +68], # 11日
590
- [1095.0, +85], # 12日
591
- [1095.0, +96], # 13日
592
- [ 851.0, +87], # 14日
593
- [ 244.0, +25], # 14日
594
- [1095.0, +107], # 15日
595
- [1095.0, +94], # 16日
596
- [1095.0, +78], # 17
597
- [1095.0, +61], # 18
598
- [1095.0, +42], # 19
599
- [1095.0, +23], # 20
600
- [ 729.0, +5], # 21
601
- [ 366.0, -2], # 21
602
- [1095.0, -16], # 22
603
- [1095.0, -35], # 23
604
- [1095.0, -53], # 24
605
- [1095.0, -71], # 25
606
- [1095.0, -88], # 26
607
- [1095.0, -102], # 27
608
- [ 607.0, -68], # 28
609
- [ 366.0, -42] # 28
610
- ]
611
- }]
612
- }
613
- }
614
- ],
615
-
616
- [ChineseLuniSolar,
617
- 'name:[宣明暦]',
618
- 'time_basis:+00,+#{P:06}',
619
- {'formula'=>['12S', '1L'].map {|f| [
620
- Ephemeris::ChineseTrueLunation, {
621
- 'formula' => f,
622
- 'day_epoch' => -2580308749,
623
- 'year_length' => '3068055/8400',
624
- 'lunation_length' => '248057/8400',
625
- 'anomalistic_month_length' => '23145819/840000', # 27.0 + 4658.19 / 8400,
626
- # 'rissei' => 'C',
627
- 's' => [
628
- # 先後數 朓朒数 立成b 立成c
629
- [ 0.0, 0, +33.4511, -0.3695], # 冬至
630
- [ -6000.0, +449, +28.0389, -0.3606], # 大寒
631
- [-11000.0, +823, +22.6998, -0.3519], # 小寒
632
- [-15000.0, +1122, +17.8923, -0.4068], # 立春
633
- [-18000.0, +1346, +11.7966, -0.3998], # 雨水
634
- [-19800.0, +1481, +5.7986, -0.3998], # 啓蟄
635
- [-20400.0, +1526, -0.2433, -0.3779], # 春分
636
- [-19800.0, +1481, -6.1254, -0.3634], # 清明
637
- [-18000.0, +1346, -12.2048, -0.2987], # 穀雨
638
- [-15000.0, +1122, -16.9060, -0.2919], # 立夏
639
- [-11000.0, +823, -21.5362, -0.2854], # 小満
640
- [ -6000.0, +449, -26.0498, -0.2854], # 芒種
641
- [ 0.0, 0, -30.3119, +0.2854], # 夏至
642
- [ +6000.0, -449, -25.8126, +0.2919], # 小暑
643
- [+11000.0, -823, -21.2454, +0.2987], # 大暑
644
- [+15000.0, -1122, -17.0296, +0.3634], # 立秋
645
- [+18000.0, -1346, -11.4744, +0.3779], # 処暑
646
- [+19800.0, -1481, -5.6429, +0.3779], # 白露
647
- [+20400.0, -1526, +0.1432, +0.3998], # 秋分
648
- [+19800.0, -1481, +6.1488, +0.4068], # 寒露
649
- [+18000.0, -1346, +12.6336, +0.3519], # 霜降
650
- [+15000.0, -1122, +17.8043, +0.3606], # 立冬
651
- [+11000.0, -823, +23.0590, +0.3695], # 小雪
652
- [ +6000.0, -449, +28.4618, +0.3695], # 大雪
653
- ],
654
- 'm' => [
655
- #(変日差) 損益率
656
- [ 8400.0, +830], # 進1日
657
- [ 8400.0, +726], # 2日
658
- [ 8400.0, +606], # 3日
659
- [ 8400.0, +471], # 4日
660
- [ 8400.0, +337], # 5日
661
- [ 8400.0, +202], # 6日
662
- [ 7465.0, +53], # 7日
663
- [ 935.0, -7], # 7日
664
- [ 8400.0, -82], # 8日
665
- [ 8400.0, -224], # 9日
666
- [ 8400.0, -366], # 10日
667
- [ 8400.0, -509], # 11日
668
- [ 8400.0, -643], # 12日
669
- [ 8400.0, -748], # 13日
670
- [ 6529.095, -646], # 14日
671
- [ 8400.0, -830], # 退1日
672
- [ 8400.0, -726], # 2日
673
- [ 8400.0, -598], # 3日
674
- [ 8400.0, -464], # 4日
675
- [ 8400.0, -329], # 5日
676
- [ 8400.0, -195], # 6日
677
- [ 7465.0, -53], # 7日
678
- [ 935.0, +7], # 7日
679
- [ 8400.0, +82], # 8日
680
- [ 8400.0, +225], # 9日
681
- [ 8400.0, +366], # 10日
682
- [ 8400.0, +501], # 11日
683
- [ 8400.0, +628], # 12日
684
- [ 8400.0, +740], # 13日
685
- [ 6529.095, +646] # 14日
686
- ]
687
- }]
688
- },
689
- 'doyo' => (Rational( 1, 2) + 1468) / 8400
690
- }
691
- ],
692
-
693
- [ChineseLuniSolar,
694
- 'name:[崇玄暦]',
695
- 'time_basis:+00,+#{P:06}',
696
- {'formula'=>['12S', '1L'].map {|f| [
697
- Ephemeris::ChineseTrueLunation, {
698
- 'formula' => f,
699
- 'day_epoch' => -19701911689,
700
- 'year_length' => '4930801/13500', # 365.0+3301/13500(通法)
701
- 'lunation_length' => '398663/13500', # 29.0+7163/13500
702
- 'anomalistic_month_length' => '37198697/1350000', # 27.0+7486.97(轉終日)/13500
703
- 'rissei' => 'c',
704
- 's' => [
705
- # 盈縮分 朓朒積
706
- [ 0*1.35, 0], # 冬至
707
- [ -7740*1.35, +782], # 大寒
708
- [-13809*1.35, +1395], # 小寒
709
- [-18381*1.35, +1857], # 立春
710
- [-21631*1.35, +2185], # 雨水
711
- [-23608*1.35, +2385], # 啓蟄
712
- [-24268*1.35, +2452], # 春分
713
- [-23608*1.35, +2385], # 清明
714
- [-21631*1.35, +2185], # 穀雨
715
- [-18381*1.35, +1857], # 立夏
716
- [-13809*1.35, +1395], # 小満
717
- [ -7740*1.35, +782], # 芒種
718
- [ 0*1.35, 0], # 夏至
719
- [ +7740*1.35, -782], # 小暑
720
- [+13809*1.35, -1395], # 大暑
721
- [+18381*1.35, -1857], # 立秋
722
- [+21631*1.35, -2185], # 処暑
723
- [+23608*1.35, -2385], # 白露
724
- [+24268*1.35, -2452], # 秋分
725
- [+23608*1.35, -2385], # 寒露
726
- [+21631*1.35, -2185], # 霜降
727
- [+18381*1.35, -1857], # 立冬
728
- [+13809*1.35, -1395], # 小雪
729
- [ +7740*1.35, -782], # 大雪
730
- ],
731
- 'm' => [
732
- #(変日差) 損益率
733
- [13500.0, +1319], # 1日
734
- [13500.0, +1150], # 2日
735
- [13500.0, +978], # 3日
736
- [13500.0, +799], # 4日
737
- [13500.0, +617], # 5日
738
- [13500.0, +431], # 6日
739
- [11996.75, +213], # 7日
740
- [ 1503.25, -27], # 7日
741
- [13500.0, -285], # 8日
742
- [13500.0, -471], # 9日
743
- [13500.0, -650], # 10日
744
- [13500.0, -840], # 11日
745
- [13500.0, -1017], # 12日
746
- [13500.0, -1185], # 13日
747
- [10493.5, -1032], # 14日
748
- [ 3006.5, -293], # 14日
749
- [13500.0, -1284], # 15日
750
- [13500.0, -1110], # 16日
751
- [13500.0, -941], # 17
752
- [13500.0, -757], # 18
753
- [13500.0, -578], # 19
754
- [13500.0, -386], # 20
755
- [ 8990.25, -160], # 21
756
- [ 4509.75, +80], # 21
757
- [13500.0, +324], # 22
758
- [13500.0, +516], # 23
759
- [13500.0, +697], # 24
760
- [13500.0, +879], # 25
761
- [13500.0, +1053], # 26
762
- [13500.0, +1223], # 27
763
- [ 7487.0, +737] # 28
764
- ]
765
- }]
766
- }
767
- }
768
- ],
769
-
770
- [ChineseLuniSolar,
771
- 'name:[授時暦]',
772
- {'formula'=>['12S', '1L'].map {|f| [
773
- Ephemeris::ChineseTrueLunation, _chinese_common.merge({
774
- 'formula' => f,
775
- 'year_delta' => 1, # 冬至年の変化率 / (10^(-6)日/年)
776
- 'year_span' => 100 # 冬至年の改訂周期 / 年
777
- })]
778
- }
779
- }
780
- ],
781
-
782
- [ChineseLuniSolar,
783
- 'name:[大統暦]',
784
- {'formula'=>['12S', '1L'].map {|f| [
785
- Ephemeris::ChineseTrueLunation, _chinese_common.merge({
786
- 'formula' => f,
787
- 'year_delta' => 0, # 冬至年の変化率 / (10^(-6)日/年)
788
- 'year_span' => 1 # 冬至年の改訂周期 / 年
789
- })]
790
- }
791
- }
792
- ]
793
- ])]
794
- end
795
- end
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2011-2014 Takashi SUGA
4
+
5
+ You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
+ =end
7
+
8
+ module When
9
+
10
+ class TM::CalendarEra
11
+
12
+ # Chinese Luni-Solar Calendar Series for Chinese Note
13
+ ChineseLuniSolar = [self, [
14
+ 'locale:[=ja:, en=en:]',
15
+ 'area:[中国の暦月=, *ChineseLuniSolar=]',
16
+ ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦', '85-01-01'], # 西暦が正になるところから開始(実際は-103.01.01)
17
+ ['[四分暦]85.01.01', '@CR', '85-01-01^ChineseTwin::四分暦', '265-01-01'],
18
+ ['[乾象暦]222.01.01', '@CR', '222-01-01^ChineseTwin::乾象暦', '281-01-01'],
19
+ ['[景初暦]237.01.01', '@CR', '237-01-01^ChineseTwin::景初暦', '452-01-01'],
20
+ ['[元嘉暦]445.01.01', '@CR', '445-01-01^ChineseTwin::元嘉暦', '510-01-01'],
21
+ ['[大明暦]510.01.01', '@CR', '510-01-01^ChineseTwin::大明暦', '590-01-01'],
22
+ ['[三紀暦=]384.01.01', '@CR', '384-01-01^ChineseTwin::三紀暦', '418-01-01'],
23
+ ['[玄始暦=]412.01.01', '@CR', '412-01-01^ChineseTwin::玄始暦', '440-01-01'],
24
+ ['[玄始暦=]452.01.01', '@CR', '452-01-01^ChineseTwin::玄始暦', '523-01-01'],
25
+ ['[正光暦=]523.01.01', '@CR', '523-01-01^ChineseTwin::正光暦', '566-01-01'],
26
+ ['[興和暦=]540.01.01', '@CR', '540-01-01^ChineseTwin::興和暦', '551-01-01'],
27
+ ['[天保暦=]551.01.01', '@CR', '551-01-01^ChineseTwin::天保暦', '578-01-01'],
28
+ ['[天和暦=]566.01.01', '@CR', '566-01-01^ChineseTwin::天和暦', '579-01-01'],
29
+ ['[大象暦=]579.01.01', '@CR', '579-01-01^ChineseTwin::大象暦', '584-01-01'],
30
+ ['[開皇暦=]584.01.01', '@CR', '584-01-01^ChineseTwin::開皇暦', '597-01-01'],
31
+ ['[大業暦=]597.01.01', '@CR', '597-01-01^ChineseTwin::大業暦', '619-01-01'],
32
+ ['[戊寅元暦]619.01.01', '@CR', '619-01-01^ChineseTwin::戊寅元暦', '645-01-01'],
33
+ ['[平朔戊寅暦=]645.01.01','@CR','645-01-01^ChineseTwin::平朔戊寅暦','665-01-01'],
34
+ ['[麟徳暦]665.01.01', '@CR', '665-01-01^ChineseTwin::麟徳暦', '729-01-01'],
35
+ ['[大衍暦]729.01.01', '@CR', '729-01-01^ChineseTwin::大衍暦', '762-01-01'],
36
+ ['[五紀暦]762.01.01', '@CR', '762-01-01^ChineseTwin::五紀暦', '784-01-01'],
37
+ ['[正元暦=]784.01.01', '@CR', '784-01-01^ChineseTwin::正元暦', '807-01-01'],
38
+ ['[宣明暦]822.01.01', '@CR', '822-01-01^ChineseTwin::宣明暦', '893-01-01'],
39
+ ['[崇玄暦=]893.01.01', '@CR', '893-01-01^ChineseTwin::崇玄暦', '956-01-01'],
40
+ ['[授時暦]1281.01.01', '@CR','1281-01-01^ChineseTwin::授時暦', '1368-01-01'],
41
+ ['[大統暦]1368.01.01', '@CR','1368-01-01^ChineseTwin::大統暦', '1645-01-01']
42
+ ]]
43
+
44
+ # Chinese Solar Calendar Series for Chinese Note
45
+ ChineseSolar = [self, [
46
+ 'locale:[=ja:, en=en:]',
47
+ 'area:[中国の節月=, *ChineseSolar=]',
48
+ ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦(節月)', '85-01-06'], # 西暦が正になるところから開始(実際は-103.01.15)
49
+ ['[四分暦]85.01.07', '@CR', '85-01-07^ChineseTwin::四分暦(節月)', '264-12-28'],
50
+ ['[乾象暦]221.12.23', '@CR', '221-12-23^ChineseTwin::乾象暦(節月)', '280-12-31'],
51
+ ['[景初暦]237.01.07', '@CR', '237-01-07^ChineseTwin::景初暦(節月)', '451-12-31'],
52
+ ['[元嘉暦]444.12.22', '@CR', '444-12-22^ChineseTwin::元嘉暦(節月)', '509-12-24'],
53
+ ['[大明暦]509.12.23', '@CR', '509-12-23^ChineseTwin::大明暦(節月)', '590-01-08'],
54
+ ['[三紀暦=]384.01.02', '@CR', '384-01-02^ChineseTwin::三紀暦(節月)', '418-01-16'],
55
+ ['[玄始暦=]411.12.26', '@CR', '411-12-26^ChineseTwin::玄始暦(節月)', '440-01-15'],
56
+ ['[玄始暦=]452.01.02', '@CR', '452-01-02^ChineseTwin::玄始暦(節月)', '522-12-29'],
57
+ ['[正光暦=]522.12.29', '@CR', '522-12-29^ChineseTwin::正光暦(節月)', '566-01-05'],
58
+ ['[興和暦=]539.12.22', '@CR', '539-12-22^ChineseTwin::興和暦(節月)', '550-12-20'],
59
+ ['[天保暦=]550.12.19', '@CR', '550-12-19^ChineseTwin::天保暦(節月)', '577-12-21'],
60
+ ['[天和暦=]566.01.05', '@CR', '566-01-05^ChineseTwin::天和暦(節月)', '579-01-11'],
61
+ ['[大象暦=]579.01.11', '@CR', '579-01-11^ChineseTwin::大象暦(節月)', '584-01-15'],
62
+ ['[開皇暦=]584.01.16', '@CR', '584-01-16^ChineseTwin::開皇暦(節月)', '596-12-23'],
63
+ ['[大業暦=]596.12.22', '@CR', '596-12-22^ChineseTwin::大業暦(節月)', '618-12-19'],
64
+ ['[戊寅元暦]618.12.19', '@CR', '618-12-19^ChineseTwin::戊寅元暦(節月)', '664-12-21'],
65
+ ['[麟徳暦]664.12.21', '@CR', '664-12-21^ChineseTwin::麟徳暦(節月)', '729-01-03'],
66
+ ['[大衍暦]729.01.03', '@CR', '729-01-03^ChineseTwin::大衍暦(節月)', '761-12-29'],
67
+ ['[五紀暦]761.12.29', '@CR', '761-12-29^ChineseTwin::五紀暦(節月)', '783-12-26'],
68
+ ['[正元暦=]783.12.26', '@CR', '783-12-26^ChineseTwin::正元暦(節月)', '807-01-11'],
69
+ ['[宣明暦]821.01.01', '@CR', '821-01-01^ChineseTwin::宣明暦(節月)', '892-12-22'], # 年の始めに遡って開始(実際は12.27)
70
+ ['[崇玄暦=]892.12.22', '@CR', '892-12-22^ChineseTwin::崇玄暦(節月)', '956-01-15'],
71
+ ['[授時暦]1280.01.01', '@CR', '1280-01-01^ChineseTwin::授時暦(節月)', '1367-12-24'],
72
+ ['[大統暦]1367.12.24', '@CR', '1367-12-24^ChineseTwin::大統暦(節月)', '1644-12-24']
73
+ ]]
74
+ end
75
+
76
+ module CalendarTypes
77
+
78
+ _chinese_common ={
79
+ 'day_epoch' => 2188871 + 55.06, # 暦元天正冬至のユリウス日
80
+ 'year_epoch' => 1281, # 暦元の西暦年
81
+ 'year_length' => 365.2425, # 暦元の冬至年 / 日
82
+ 'lunation_length' => 29.530593, # 朔実(朔望月)
83
+ 'lunation_shift' => 20.185, # 閏應(暦元前経朔から暦元天正冬至までの日数)
84
+ 'lunar_mean_motion' => 13.36875, # 月平行(恒星天に対する月の平均運動 / 日)
85
+ 'anomalistic_month_length' => 27.5546, # 転終(近点月)
86
+ 'anomalistic_month_shift' => 13.1904, # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
87
+ 'anomaly_method' => 'a', # (経朔-定朔)の計算方法(a:階差, b:微分, c:幾何学的補正, d:差分)
88
+ 'lunar_unit' => 27.5546 / (84*4), # 太陰遅速計算用招差法定数の時間の単位(限)
89
+ 'solar_weight' => 0, # (経朔-定朔)の計算で用いる実行差での太陽盈縮の重み(0:非考慮,1:考慮)
90
+ 's' => [ # 太陽盈縮計算用招差法定数
91
+ [ 0 ... 88.909225, 0, [0, +513_3200, -2_4600, -31]],
92
+ [ 88.909225...182.62125, 182.62125, [0, +487_0600, -2_2100, -27]],
93
+ [182.62125 ...276.333275, 182.62125, [0, -487_0600, +2_2100, +27]],
94
+ [276.333275.. 365.2425, 365.2425, [0, -513_3200, +2_4600, +31]]
95
+ ],
96
+ 'm' => [ # 太陰遅速計算用招差法定数
97
+ [ 0... 82, 0, [ +0, +1111_0000, -2_8100, -325 ]],
98
+ [ 82... 86, 84, [+5_4293_4424, +0, -1_9292, -0, +1484]],
99
+ [ 86...168, 168, [ +0, +1111_0000, -2_8100, -325 ]],
100
+ [168...250, 168, [ -0, -1111_0000, +2_8100, +325 ]],
101
+ [250...254, 252, [-5_4293_4424, -0, +1_9292, +0, -1484]],
102
+ [254.. 336, 336, [ -0, -1111_0000, +2_8100, +325 ]]
103
+ ]
104
+ }
105
+
106
+ ChineseTwin = [{}, When::BasicTypes::M17n, ChineseSolar.twin('ChineseTwin', [
107
+ "locale:[=ja:, en=en:, alias]",
108
+ "area:[中国,China]",
109
+
110
+ [ChineseLuniSolar,
111
+ 'name:[黄帝暦=]',
112
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1228331',
113
+ 'intercalary_month:12'
114
+ ],
115
+
116
+ [ChineseLuniSolar,
117
+ 'name:[顓頊暦]',
118
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1171396&longitude_shift=-1/8',
119
+ 'time_basis:+00,+#{P:12}',
120
+ 'intercalary_month:9'
121
+ ],
122
+
123
+ [ChineseLuniSolar,
124
+ 'name:[顓頊暦後期=]',
125
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1171396&longitude_shift=-1/8',
126
+ 'time_basis:+00,+#{P:12}',
127
+ 'base_month:1',
128
+ 'intercalary_month:9'
129
+ ],
130
+
131
+ [ChineseLuniSolar,
132
+ 'name:[夏暦]',
133
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1328411',
134
+ 'intercalary_month:12'
135
+ ],
136
+
137
+ [ChineseLuniSolar,
138
+ 'name:[殷暦]',
139
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1149071',
140
+ 'intercalary_month:12'
141
+ ],
142
+
143
+ [ChineseLuniSolar,
144
+ 'name:[周暦]',
145
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1128251',
146
+ 'intercalary_month:12'
147
+ ],
148
+
149
+ [ChineseLuniSolar,
150
+ 'name:[魯暦=]',
151
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1048991',
152
+ 'intercalary_month:12'
153
+ ],
154
+
155
+ [ChineseLuniSolar,
156
+ 'name:[太初暦]',
157
+ 'formula:MeanLunation?year_length=562120/1539&lunation_length=2392/81&day_epoch=1683431'
158
+ ],
159
+
160
+ [ChineseLuniSolar,
161
+ 'name:[四分暦]',
162
+ 'formula:MeanLunation?year_length=1461/4&lunation_length=27759/940&day_epoch=1662611'
163
+ ],
164
+
165
+ [ChineseLuniSolar,
166
+ 'name:[乾象暦]',
167
+ 'formula:MeanLunation?year_length=215130/589&lunation_length=43026/1457&day_epoch=-898129'
168
+ ],
169
+
170
+ [ChineseLuniSolar,
171
+ 'name:[景初暦]',
172
+ 'formula:MeanLunation?year_length=673150/1843&lunation_length=134630/4559&day_epoch=+330191'
173
+ ],
174
+
175
+ [ChineseLuniSolar,
176
+ 'name:[三紀暦=]',
177
+ 'formula:MeanLunation?year_length=895220/2451&lunation_length=179044/6063&day_epoch=-28760989'
178
+ ],
179
+
180
+ [ChineseLuniSolar,
181
+ 'name:[玄始暦]',
182
+ 'formula:MeanLunation?year_length=2629759/7200&lunation_length=2629759/89052&day_epoch=-20568349'
183
+ ],
184
+
185
+ [ChineseLuniSolar,
186
+ 'name:[元嘉暦=]',
187
+ 'formula:MeanLunation?year_length=111035/304&lunation_length=22207/752&day_epoch=-200089&longitude_shift=-1/12' # 春分の1ヶ月前
188
+ ],
189
+
190
+ [ChineseLuniSolar,
191
+ 'name:[大明暦]',
192
+ 'formula:MeanLunation?year_length=14423804/39491&lunation_length=116321/3939&day_epoch=-17080189'
193
+ ],
194
+
195
+ [ChineseLuniSolar,
196
+ 'name:[正光暦=]',
197
+ 'formula:MeanLunation?year_length=2213377/6060&lunation_length=2213377/74952&day_epoch=-59357929'
198
+ ],
199
+
200
+ [ChineseLuniSolar,
201
+ 'name:[興和暦=]',
202
+ 'formula:MeanLunation?year_length=6158017/16860&lunation_length=6158017/208530&day_epoch=-105462049'
203
+ ],
204
+
205
+ [ChineseLuniSolar,
206
+ 'name:[天保暦=]',
207
+ 'formula:MeanLunation?year_length=8641687/23660&lunation_length=8641687/292635&day_epoch=-38447089'
208
+ ],
209
+
210
+ [ChineseLuniSolar,
211
+ 'name:[天和暦=]',
212
+ 'formula:MeanLunation?year_length=8568631/23460&lunation_length=8568631/290160&day_epoch=-317950249'
213
+ ],
214
+
215
+ [ChineseLuniSolar,
216
+ 'name:[大象暦=]',
217
+ 'formula:MeanLunation?year_length=4745247/12992&lunation_length=1581749/53563&day_epoch=-13244449'
218
+ ],
219
+
220
+ [ChineseLuniSolar,
221
+ 'name:[開皇暦=]',
222
+ 'formula:MeanLunation?year_length=37605463/102960&lunation_length=5372209/181920&day_epoch=-1506155749'
223
+ ],
224
+
225
+ [ChineseLuniSolar,
226
+ 'name:[大業暦=]',
227
+ 'formula:MeanLunation?year_length=15573963/42640&lunation_length=33783/1144&day_epoch=-519493909'
228
+ ],
229
+
230
+ [ChineseLuniSolar,
231
+ 'name:[戊寅元暦]',
232
+ 'time_basis:+00,+#{P:00}',
233
+ {'formula'=>['12S', '1L'].map {|f| [
234
+ Ephemeris::ChineseTrueLunation, {
235
+ 'formula' => f,
236
+ 'day_epoch' => -58077529,
237
+ 'year_length' => '3456675/9464', # 365.0 + 2315/9464(度法)
238
+ 'lunation_length' => '384075/13006', # 29.0 + 6901/13006(日法)
239
+ 'anomalistic_month_length' => '99775/3621', # 27.0 + 16064/28968 (798200(暦周)/28968(暦法))
240
+ 'rissei' => 'a',
241
+ 'method' => 'W',
242
+ 's' => [
243
+ #(先後數) 盈縮數
244
+ [ 0.0, 0], # 冬至
245
+ [ 0.0, +896], # 小寒
246
+ [ 0.0, +1294], # 大寒
247
+ [ 0.0, +1694], # 立春
248
+ [ 0.0, +1922], # 啓蟄
249
+ [ 0.0, +2263], # 雨水
250
+ [ 0.0, +2713], # 春分
251
+ [ 0.0, +2213], # 清明
252
+ [ 0.0, +1758], # 穀雨
253
+ [ 0.0, +1403], # 立夏
254
+ [ 0.0, +848], # 小満
255
+ [ 0.0, 0], # 芒種
256
+ [ 0.0, -739], # 夏至
257
+ [ 0.0, -1365], # 小暑
258
+ [ 0.0, -1821], # 大暑
259
+ [ 0.0, -2109], # 立秋
260
+ [ 0.0, -2149], # 処暑
261
+ [ 0.0, -2491], # 白露
262
+ [ 0.0, -2946], # 秋分
263
+ [ 0.0, -2264], # 寒露
264
+ [ 0.0, -1639], # 霜降
265
+ [ 0.0, -1069], # 立冬
266
+ [ 0.0, -556], # 小雪
267
+ [ 0.0, -100] # 大雪
268
+ ],
269
+ 'm' => [
270
+ #(変日差) 盈縮積分の差分(9037=章歳(676)+章月(8361))
271
+ [13006.0, -11341226.0/9037], # 1日
272
+ [13006.0, -10053632.0/9037], # 2日
273
+ [13006.0, -8557946.0/9037], # 3日
274
+ [13006.0, -6841146.0/9037], # 4日
275
+ [13006.0, -4903257.0/9037], # 5日
276
+ [13006.0, -2978403.0/9037], # 6日
277
+ [13006.0, -1053445.0/9037], # 7日
278
+ [13006.0, +1092498.0/9037], # 8日
279
+ [13006.0, +3238489.0/9037], # 9日
280
+ [13006.0, +5163376.0/9037], # 10
281
+ [13006.0, +6880164.0/9037], # 11
282
+ [13006.0, +8388868.0/9037], # 12
283
+ [13006.0, +9884554.0/9037], # 13
284
+ [13006.0, +11172149.0/9037], # 14
285
+ [13006.0, +10742961.0/9037], # 15
286
+ [13006.0, +9455368.0/9037], # 16
287
+ [13006.0, +7959678.0/9037], # 17
288
+ [13006.0, +6242886.0/9037], # 18
289
+ [13006.0, +4526094.0/9037], # 19
290
+ [13006.0, +2601205.0/9037], # 20
291
+ [13006.0, +663312.0/9037], # 21日
292
+ [13006.0, -1482690.0/9037], # 22日
293
+ [13006.0, -3407578.0/9037], # 23日
294
+ [13006.0, -5332465.0/9037], # 24日
295
+ [13006.0, -7036252.0/9037], # 25日
296
+ [13006.0, -8753044.0/9037], # 26日
297
+ [13006.0, -10040638.0/9037], # 27日
298
+ [ 7295.0, -6229880.0/9037] # 28日
299
+ ]
300
+ }]
301
+ }
302
+ }
303
+ ],
304
+
305
+ [ChineseLuniSolar,
306
+ 'name:[平朔戊寅暦=]',
307
+ 'formula:MeanLunation?year_length=3456675/9464&lunation_length=384075/13006&day_epoch=-58077529'
308
+ ],
309
+
310
+ [ChineseLuniSolar,
311
+ 'name:[麟徳暦]',
312
+ 'time_basis:+00,+#{P:00}',
313
+ {'formula'=>['12S', '1L'].map {|f| [
314
+ Ephemeris::ChineseTrueLunation, {
315
+ 'formula' => f,
316
+ 'day_epoch' => -96608689,
317
+ 'year_length' => '122357/335',
318
+ 'lunation_length' => '39571/1340',
319
+ 'anomalistic_month_length' => '443077/16080', # 27.0 + (743.0+1.0/12)/1340,
320
+ # 'rissei' => 'B',
321
+ 'method' => '#{Method:A}',
322
+ 's' => [
323
+ # 消息總 盈朒積 立成b 立成c
324
+ [ 0.0, 0, +3.9546, -0.0372], # 冬至
325
+ [ -722.0, +54, +3.4091, -0.0372], # 小寒
326
+ [-1340.0, +100, +2.8636, -0.0372], # 大寒
327
+ [-1854.0, +138, +2.3181, +0.0372], # 立春
328
+ [-2368.0, +176, +2.8636, +0.0372], # 啓蟄
329
+ [-2986.0, +222, +3.4091, +0.0372], # 雨水
330
+ [-3708.0, +276, -3.7220, +0.0329], # 春分
331
+ [-2986.0, +222, -3.2086, +0.0329], # 清明
332
+ [-2368.0, +176, -2.6952, +0.0329], # 穀雨
333
+ [-1854.0, +138, -2.1818, -0.0329], # 立夏
334
+ [-1340.0, +100, -2.6952, -0.0329], # 小満
335
+ [ -722.0, +54, -3.2086, -0.0329], # 芒種
336
+ [ 0.0, 0, -3.7220, +0.0329], # 夏至
337
+ [ +722.0, -54, -3.2086, +0.0329], # 小暑
338
+ [+1340.0, -100, -2.6952, +0.0329], # 大暑
339
+ [+1854.0, -138, -2.1818, -0.0329], # 立秋
340
+ [+2368.0, -176, -2.6952, -0.0329], # 処暑
341
+ [+2986.0, -222, -3.2086, -0.0329], # 白露
342
+ [+3708.0, -276, +3.9546, -0.0372], # 秋分
343
+ [+2986.0, -222, +3.4091, -0.0372], # 寒露
344
+ [+2368.0, -176, +2.8636, -0.0372], # 霜降
345
+ [+1854.0, -138, +2.3181, +0.0372], # 立冬
346
+ [+1340.0, -100, +2.8636, +0.0372], # 小雪
347
+ [ +722.0, -54, +3.4091, +0.0372], # 大雪
348
+ ],
349
+ 'm' => [
350
+ #(変日差) 増減率
351
+ [1340.0, -134], # 1日
352
+ [1340.0, -117], # 2日
353
+ [1340.0, -99], # 3日
354
+ [1340.0, -78], # 4日
355
+ [1340.0, -56], # 5日
356
+ [1340.0, -33], # 6日
357
+ [1191.0, -9], # 7日
358
+ [ 149.0, 0], # 7日
359
+ [1340.0, +14], # 8日
360
+ [1340.0, +38], # 9日
361
+ [1340.0, +62], # 10
362
+ [1340.0, +85], # 11
363
+ [1340.0, +104], # 12
364
+ [1340.0, +121], # 13
365
+ [1042.0, +102], # 14
366
+ [ 298.0, +29], # 14
367
+ [1340.0, +128], # 15
368
+ [1340.0, +115], # 16
369
+ [1340.0, +95], # 17
370
+ [1340.0, +74], # 18
371
+ [1340.0, +52], # 19
372
+ [1340.0, +28], # 20
373
+ [ 892.0, +4], # 21
374
+ [ 448.0, 0], # 21日
375
+ [1340.0, -20], # 22日
376
+ [1340.0, -44], # 23日
377
+ [1340.0, -68], # 24日
378
+ [1340.0, -89], # 25日
379
+ [1340.0, -108], # 26日
380
+ [1340.0, -125], # 27日
381
+ [ 743.0+1.0/12, -71] # 28日
382
+ ]
383
+ }]
384
+ },
385
+ 'doyo' => (Rational( 4,15) + 244) / 1340
386
+ }
387
+ ],
388
+
389
+ [ChineseLuniSolar,
390
+ 'name:[大衍暦]',
391
+ 'time_basis:+00,+#{P:03}',
392
+ {'formula'=>['12S', '1L'].map {|f| [
393
+ Ephemeris::ChineseTrueLunation, {
394
+ 'formula' => f,
395
+ 'day_epoch' => -35412747829,
396
+ 'year_length' => '1110343/3040',
397
+ 'lunation_length' => '89773/3040',
398
+ 'anomalistic_month_length' => '6701279/243200', # 27.0 +(1685.0+79.0/80)/3040,
399
+ # 'rissei' => 'C',
400
+ 's' => [
401
+ # 先後數 朓朒積 立成b 立成c
402
+ [ 0.0, 0, +13.4524, -0.1886], # 冬至
403
+ [-2353.0, +176, +10.5564, -0.1634], # 小寒
404
+ [-4198.0, +314, +8.0408, -0.1446], # 大寒
405
+ [-5588.0, +418, +5.8160, -0.1318], # 立春
406
+ [-6564.0, +491, +3.7987, -0.1240], # 雨水
407
+ [-7152.0, +535, +1.9265, -0.1240], # 啓蟄
408
+ [-7366.0, +551, -0.2048, -0.1178], # 春分
409
+ [-7152.0, +535, -1.9968, -0.1190], # 清明
410
+ [-6564.0, +491, -3.7956, -0.1240], # 穀雨
411
+ [-5588.0, +418, -5.6626, -0.1324], # 立夏
412
+ [-4198.0, +314, -7.6555, -0.1436], # 小満
413
+ [-2353.0, +176, -9.9405, -0.1436], # 芒種
414
+ [ 0.0, 0, -12.0819, +0.1436], # 夏至
415
+ [+2353.0, -176, -9.7018, +0.1324], # 小暑
416
+ [+4198.0, -314, -7.5450, +0.1240], # 大暑
417
+ [+5588.0, -418, -5.5634, +0.1190], # 立秋
418
+ [+6564.0, -491, -3.7038, +0.1178], # 処暑
419
+ [+7152.0, -535, -1.8954, +0.1178], # 白露
420
+ [+7366.0, -551, +0.1783, +0.1240], # 秋分
421
+ [+7152.0, -535, +2.0042, +0.1318], # 寒露
422
+ [+6564.0, -491, +3.8950, +0.1446], # 霜降
423
+ [+5588.0, -418, +5.9214, +0.1634], # 立冬
424
+ [+4198.0, -314, +8.1610, +0.1886], # 小雪
425
+ [+2353.0, -176, +10.9010, +0.1886], # 大雪
426
+ ],
427
+ 'm' => [
428
+ #(変日差) 損益率
429
+ [3040.0, +297], # 1日
430
+ [3040.0, +259], # 2日
431
+ [3040.0, +220], # 3日
432
+ [3040.0, +180], # 4日
433
+ [3040.0, +139], # 5日
434
+ [3040.0, +97], # 6日
435
+ [2701.0, +48], # 7日
436
+ [ 339.0, -6], # 7日
437
+ [3040.0, -64], # 8日
438
+ [3040.0, -106], # 9日
439
+ [3040.0, -148], # 10
440
+ [3040.0, -189], # 11
441
+ [3040.0, -229], # 12
442
+ [3040.0, -267], # 13
443
+ [2363.0, -231], # 14
444
+ [ 677.0, -66], # 14
445
+ [3040.0, -289], # 15
446
+ [3040.0, -250], # 16
447
+ [3040.0, -211], # 17
448
+ [3040.0, -171], # 18
449
+ [3040.0, -130], # 19
450
+ [3040.0, -87], # 20
451
+ [2024.0, -36], # 21
452
+ [1016.0, +18], # 21日
453
+ [3040.0, +73], # 22日
454
+ [3040.0, +116], # 23日
455
+ [3040.0, +157], # 24日
456
+ [3040.0, +198], # 25日
457
+ [3040.0, +237], # 26日
458
+ [3040.0, +276], # 27日
459
+ [1686.0, +165] # 28日
460
+ ]
461
+ }]
462
+ },
463
+ 'doyo' => (Rational(13,30) + 531) / 3040
464
+ }
465
+ ],
466
+
467
+ [ChineseLuniSolar,
468
+ 'name:[五紀暦]',
469
+ 'time_basis:+00,+#{P:06}',
470
+ {'formula'=>['12S', '1L'].map {|f| [
471
+ Ephemeris::ChineseTrueLunation, {
472
+ 'formula' => f,
473
+ 'day_epoch' => -96608689,
474
+ 'year_length' => '122357/335',
475
+ 'lunation_length' => '39571/1340',
476
+ 'anomalistic_month_length' => '1366156/49580', # 27.0 + (743.0+5.0/37)/1340,
477
+ # 'rissei' => 'C',
478
+ 's' => [
479
+ # 先後數 朓朒積 立成b 立成c
480
+ [ 0.0, 0, +5.9668, -0.0843], # 冬至
481
+ [-1037.0, +78, +4.6652, -0.0721], # 小寒
482
+ [-1850.0, +139, +3.5656, -0.0653], # 大寒
483
+ [-2463.0, +185, +2.5583, -0.0590], # 立春
484
+ [-2893.0, +217, +1.6375, -0.0532], # 雨水
485
+ [-3152.0, +236, +0.8384, -0.0532], # 啓蟄
486
+ [-3246.0, +243, -0.0972, -0.0505], # 春分
487
+ [-3152.0, +236, -0.8480, -0.0534], # 清明
488
+ [-2893.0, +217, -1.6517, -0.0561], # 穀雨
489
+ [-2463.0, +185, -2.5057, -0.0584], # 立夏
490
+ [-1850.0, +139, -3.3781, -0.0643], # 小満
491
+ [-1037.0, +78, -4.3954, -0.0643], # 芒種
492
+ [ 0.0, 0, -5.3592, +0.0643], # 夏至
493
+ [+1037.0, -78, -4.2877, +0.0584], # 小暑
494
+ [+1850.0, -139, -3.3459, +0.0561], # 大暑
495
+ [+2463.0, -185, -2.4475, +0.0534], # 立秋
496
+ [+2893.0, -217, -1.5966, +0.0505], # 処暑
497
+ [+3152.0, -236, -0.8185, +0.0505], # 白露
498
+ [+3246.0, -243, +0.0858, +0.0532], # 秋分
499
+ [+3152.0, -236, +0.8505, +0.0590], # 寒露
500
+ [+2893.0, -217, +1.6943, +0.0653], # 霜降
501
+ [+2463.0, -185, +2.6205, +0.0721], # 立冬
502
+ [+1850.0, -139, +3.6007, +0.0843], # 小雪
503
+ [+1037.0, -78, +4.8330, +0.0843], # 大雪
504
+ ],
505
+ 'm' => [
506
+ #(変日差) 損益率
507
+ [1340.0, -135], # 1日
508
+ [1340.0, -117], # 2日
509
+ [1340.0, -99], # 3日
510
+ [1340.0, -78], # 4日
511
+ [1340.0, -56], # 5日
512
+ [1340.0, -33], # 6日
513
+ [1191.0, -8], # 7日
514
+ [ 149.0, +1], # 7日
515
+ [1340.0, +14], # 8日
516
+ [1340.0, +38], # 9日
517
+ [1340.0, +62], # 10
518
+ [1340.0, +85], # 11
519
+ [1340.0, +103], # 12
520
+ [1340.0, +118], # 13
521
+ [1042.0, +105], # 14
522
+ [ 298.0, +30], # 14
523
+ [1340.0, +128], # 15
524
+ [1340.0, +115], # 16
525
+ [1340.0, +95], # 17
526
+ [1340.0, +74], # 18
527
+ [1340.0, +52], # 19
528
+ [1340.0, +28], # 20
529
+ [ 892.0, +6], # 21
530
+ [ 448.0, -3], # 21日
531
+ [1340.0, -20], # 22日
532
+ [1340.0, -42], # 23日
533
+ [1340.0, -65], # 24日
534
+ [1340.0, -89], # 25日
535
+ [1340.0, -109], # 26日
536
+ [1340.0, -125], # 27日
537
+ [ 743.0+5.0/37, -75] # 28日
538
+ ]
539
+ }]
540
+ },
541
+ 'doyo' => (Rational( 4,15) + 244) / 1340
542
+ }
543
+ ],
544
+
545
+ [ChineseLuniSolar,
546
+ 'name:[正元暦=]',
547
+ 'time_basis:+00,+#{P:06}',
548
+ {'formula'=>['12S', '1L'].map {|f| [
549
+ Ephemeris::ChineseTrueLunation, {
550
+ 'formula' => f,
551
+ 'day_epoch' => -145149709,
552
+ 'year_length' => '399943/1095', # 365.0 + 268/1095(通法)
553
+ 'lunation_length' => '32336/1095', # 29.0 + 581/1095
554
+ 'anomalistic_month_length' => '301720132/10950000', # 27.0 + 607.0132(轉終日)/1095 (301720132(轉終分)/10950000)
555
+ 'rissei' => 'c',
556
+ 'method' => 'C',
557
+ 's' => [
558
+ # 先後數 朓朒積
559
+ [ 0.0, 0], # 冬至
560
+ [ -848.0, +63], # 小寒
561
+ [-1512.0, +113], # 大寒
562
+ [-2013.0, +150], # 立春
563
+ [-2364.0, +176], # 雨水
564
+ [-2576.0, +192], # 啓蟄
565
+ [-2653.0, +198], # 春分
566
+ [-2576.0, +192], # 清明
567
+ [-2364.0, +176], # 穀雨
568
+ [-2013.0, +150], # 立夏
569
+ [-1512.0, +113], # 小満
570
+ [ -848.0, +63], # 芒種
571
+ [ 0.0, 0], # 夏至
572
+ [ +848.0, -63], # 小暑
573
+ [+1512.0, -113], # 大暑
574
+ [+2013.0, -150], # 立秋
575
+ [+2364.0, -176], # 処暑
576
+ [+2576.0, -192], # 白露
577
+ [+2653.0, -198], # 秋分
578
+ [+2576.0, -192], # 寒露
579
+ [+2364.0, -176], # 霜降
580
+ [+2013.0, -150], # 立冬
581
+ [+1512.0, -113], # 小雪
582
+ [ +848.0, -63], # 大雪
583
+ ],
584
+ 'm' => [
585
+ #(変日差) 損益率
586
+ [1095.0, -110], # 1日
587
+ [1095.0, -96], # 2日
588
+ [1095.0, -81], # 3日
589
+ [1095.0, -64], # 4日
590
+ [1095.0, -46], # 5日
591
+ [1095.0, -27], # 6日
592
+ [ 973.0, -7], # 7日
593
+ [ 122.0, +1], # 7日
594
+ [1095.0, +12], # 8日
595
+ [1095.0, +31], # 9日
596
+ [1095.0, +51], # 10
597
+ [1095.0, +68], # 11
598
+ [1095.0, +85], # 12
599
+ [1095.0, +96], # 13
600
+ [ 851.0, +87], # 14
601
+ [ 244.0, +25], # 14
602
+ [1095.0, +107], # 15
603
+ [1095.0, +94], # 16
604
+ [1095.0, +78], # 17
605
+ [1095.0, +61], # 18
606
+ [1095.0, +42], # 19
607
+ [1095.0, +23], # 20
608
+ [ 729.0, +5], # 21
609
+ [ 366.0, -2], # 21
610
+ [1095.0, -16], # 22日
611
+ [1095.0, -35], # 23日
612
+ [1095.0, -53], # 24日
613
+ [1095.0, -71], # 25日
614
+ [1095.0, -88], # 26日
615
+ [1095.0, -102], # 27日
616
+ [ 607.0, -68], # 28日
617
+ [ 366.0, -42] # 28日
618
+ ]
619
+ }]
620
+ }
621
+ }
622
+ ],
623
+
624
+ [ChineseLuniSolar,
625
+ 'name:[宣明暦]',
626
+ 'time_basis:+00,+#{P:06}',
627
+ {'formula'=>['12S', '1L'].map {|f| [
628
+ Ephemeris::ChineseTrueLunation, {
629
+ 'formula' => f,
630
+ 'day_epoch' => -2580308749,
631
+ 'year_length' => '3068055/8400',
632
+ 'lunation_length' => '248057/8400',
633
+ 'anomalistic_month_length' => '23145819/840000', # 27.0 + 4658.19 / 8400,
634
+ # 'rissei' => 'C',
635
+ 's' => [
636
+ # 先後數 朓朒数 立成b 立成c
637
+ [ 0.0, 0, +33.4511, -0.3695], # 冬至
638
+ [ -6000.0, +449, +28.0389, -0.3606], # 小寒
639
+ [-11000.0, +823, +22.6998, -0.3519], # 大寒
640
+ [-15000.0, +1122, +17.8923, -0.4068], # 立春
641
+ [-18000.0, +1346, +11.7966, -0.3998], # 雨水
642
+ [-19800.0, +1481, +5.7986, -0.3998], # 啓蟄
643
+ [-20400.0, +1526, -0.2433, -0.3779], # 春分
644
+ [-19800.0, +1481, -6.1254, -0.3634], # 清明
645
+ [-18000.0, +1346, -12.2048, -0.2987], # 穀雨
646
+ [-15000.0, +1122, -16.9060, -0.2919], # 立夏
647
+ [-11000.0, +823, -21.5362, -0.2854], # 小満
648
+ [ -6000.0, +449, -26.0498, -0.2854], # 芒種
649
+ [ 0.0, 0, -30.3119, +0.2854], # 夏至
650
+ [ +6000.0, -449, -25.8126, +0.2919], # 小暑
651
+ [+11000.0, -823, -21.2454, +0.2987], # 大暑
652
+ [+15000.0, -1122, -17.0296, +0.3634], # 立秋
653
+ [+18000.0, -1346, -11.4744, +0.3779], # 処暑
654
+ [+19800.0, -1481, -5.6429, +0.3779], # 白露
655
+ [+20400.0, -1526, +0.1432, +0.3998], # 秋分
656
+ [+19800.0, -1481, +6.1488, +0.4068], # 寒露
657
+ [+18000.0, -1346, +12.6336, +0.3519], # 霜降
658
+ [+15000.0, -1122, +17.8043, +0.3606], # 立冬
659
+ [+11000.0, -823, +23.0590, +0.3695], # 小雪
660
+ [ +6000.0, -449, +28.4618, +0.3695], # 大雪
661
+ ],
662
+ 'm' => [
663
+ #(変日差) 損益率
664
+ [ 8400.0, +830], # 進1日
665
+ [ 8400.0, +726], # 2日
666
+ [ 8400.0, +606], # 3日
667
+ [ 8400.0, +471], # 4日
668
+ [ 8400.0, +337], # 5日
669
+ [ 8400.0, +202], # 6日
670
+ [ 7465.0, +53], # 7日
671
+ [ 935.0, -7], # 7日
672
+ [ 8400.0, -82], # 8日
673
+ [ 8400.0, -224], # 9日
674
+ [ 8400.0, -366], # 10日
675
+ [ 8400.0, -509], # 11日
676
+ [ 8400.0, -643], # 12日
677
+ [ 8400.0, -748], # 13日
678
+ [ 6529.095, -646], # 14日
679
+ [ 8400.0, -830], # 退1日
680
+ [ 8400.0, -726], # 2日
681
+ [ 8400.0, -598], # 3日
682
+ [ 8400.0, -464], # 4日
683
+ [ 8400.0, -329], # 5日
684
+ [ 8400.0, -195], # 6日
685
+ [ 7465.0, -53], # 7日
686
+ [ 935.0, +7], # 7日
687
+ [ 8400.0, +82], # 8日
688
+ [ 8400.0, +225], # 9日
689
+ [ 8400.0, +366], # 10日
690
+ [ 8400.0, +501], # 11日
691
+ [ 8400.0, +628], # 12日
692
+ [ 8400.0, +740], # 13日
693
+ [ 6529.095, +646] # 14日
694
+ ]
695
+ }]
696
+ },
697
+ 'doyo' => (Rational( 1, 2) + 1468) / 8400
698
+ }
699
+ ],
700
+
701
+ [ChineseLuniSolar,
702
+ 'name:[崇玄暦=]',
703
+ 'time_basis:+00,+#{P:06}',
704
+ {'formula'=>['12S', '1L'].map {|f| [
705
+ Ephemeris::ChineseTrueLunation, {
706
+ 'formula' => f,
707
+ 'day_epoch' => -19701911689,
708
+ 'year_length' => '4930801/13500', # 365.0+3301/13500(通法)
709
+ 'lunation_length' => '398663/13500', # 29.0+7163/13500
710
+ 'anomalistic_month_length' => '37198697/1350000', # 27.0+7486.97(轉終日)/13500
711
+ 'rissei' => 'c',
712
+ 's' => [
713
+ # 盈縮分 朓朒積
714
+ [ 0*1.35, 0], # 冬至
715
+ [ -7740*1.35, +782], # 小寒
716
+ [-13809*1.35, +1395], # 大寒
717
+ [-18381*1.35, +1857], # 立春
718
+ [-21631*1.35, +2185], # 雨水
719
+ [-23608*1.35, +2385], # 啓蟄
720
+ [-24268*1.35, +2452], # 春分
721
+ [-23608*1.35, +2385], # 清明
722
+ [-21631*1.35, +2185], # 穀雨
723
+ [-18381*1.35, +1857], # 立夏
724
+ [-13809*1.35, +1395], # 小満
725
+ [ -7740*1.35, +782], # 芒種
726
+ [ 0*1.35, 0], # 夏至
727
+ [ +7740*1.35, -782], # 小暑
728
+ [+13809*1.35, -1395], # 大暑
729
+ [+18381*1.35, -1857], # 立秋
730
+ [+21631*1.35, -2185], # 処暑
731
+ [+23608*1.35, -2385], # 白露
732
+ [+24268*1.35, -2452], # 秋分
733
+ [+23608*1.35, -2385], # 寒露
734
+ [+21631*1.35, -2185], # 霜降
735
+ [+18381*1.35, -1857], # 立冬
736
+ [+13809*1.35, -1395], # 小雪
737
+ [ +7740*1.35, -782], # 大雪
738
+ ],
739
+ 'm' => [
740
+ #(変日差) 損益率
741
+ [13500.0, +1319], # 1日
742
+ [13500.0, +1150], # 2日
743
+ [13500.0, +978], # 3日
744
+ [13500.0, +799], # 4日
745
+ [13500.0, +617], # 5日
746
+ [13500.0, +431], # 6日
747
+ [11996.75, +213], # 7日
748
+ [ 1503.25, -27], # 7日
749
+ [13500.0, -285], # 8日
750
+ [13500.0, -471], # 9日
751
+ [13500.0, -650], # 10
752
+ [13500.0, -840], # 11
753
+ [13500.0, -1017], # 12
754
+ [13500.0, -1185], # 13
755
+ [10493.5, -1032], # 14
756
+ [ 3006.5, -293], # 14
757
+ [13500.0, -1284], # 15
758
+ [13500.0, -1110], # 16
759
+ [13500.0, -941], # 17
760
+ [13500.0, -757], # 18
761
+ [13500.0, -578], # 19
762
+ [13500.0, -386], # 20
763
+ [ 8990.25, -160], # 21
764
+ [ 4509.75, +80], # 21日
765
+ [13500.0, +324], # 22日
766
+ [13500.0, +516], # 23日
767
+ [13500.0, +697], # 24日
768
+ [13500.0, +879], # 25日
769
+ [13500.0, +1053], # 26日
770
+ [13500.0, +1223], # 27日
771
+ [ 7487.0, +737] # 28日
772
+ ]
773
+ }]
774
+ }
775
+ }
776
+ ],
777
+
778
+ [ChineseLuniSolar,
779
+ 'name:[授時暦]',
780
+ {'formula'=>['12S', '1L'].map {|f| [
781
+ Ephemeris::ChineseTrueLunation, _chinese_common.merge({
782
+ 'formula' => f,
783
+ 'year_delta' => 1, # 冬至年の変化率 / (10^(-6)日/年)
784
+ 'year_span' => 100 # 冬至年の改訂周期 / 年
785
+ })]
786
+ }
787
+ }
788
+ ],
789
+
790
+ [ChineseLuniSolar,
791
+ 'name:[大統暦]',
792
+ {'formula'=>['12S', '1L'].map {|f| [
793
+ Ephemeris::ChineseTrueLunation, _chinese_common.merge({
794
+ 'formula' => f,
795
+ 'year_delta' => 0, # 冬至年の変化率 / (10^(-6)日/年)
796
+ 'year_span' => 1 # 冬至年の改訂周期 / 年
797
+ })]
798
+ }
799
+ }
800
+ ]
801
+ ])]
802
+ end
803
+ end