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