when_exe 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -33
  3. data/bin/locales.rb +1 -1
  4. data/bin/make_ttl.rb.config +1 -1
  5. data/lib/when_exe.rb +27 -16
  6. data/lib/when_exe/basictypes.rb +772 -771
  7. data/lib/when_exe/calendartypes.rb +1485 -1453
  8. data/lib/when_exe/coordinates.rb +5 -0
  9. data/lib/when_exe/core/compatibility.rb +1 -1
  10. data/lib/when_exe/core/duration.rb +147 -116
  11. data/lib/when_exe/core/extension.rb +499 -497
  12. data/lib/when_exe/ephemeris.rb +1952 -1951
  13. data/lib/when_exe/ephemeris/eclipse.rb +5 -4
  14. data/lib/when_exe/ephemeris/notes.rb +457 -421
  15. data/lib/when_exe/ephemeris/planets.rb +585 -585
  16. data/lib/when_exe/ephemeris/sun.rb +214 -214
  17. data/lib/when_exe/google_api.rb +153 -0
  18. data/lib/when_exe/icalendar.rb +1640 -1632
  19. data/lib/when_exe/inspect.rb +42 -20
  20. data/lib/when_exe/linkeddata.rb +28 -7
  21. data/lib/when_exe/locales/autoload.rb +2 -1
  22. data/lib/when_exe/locales/locale.rb +35 -15
  23. data/lib/when_exe/locales/zh.rb +77 -0
  24. data/lib/when_exe/mini_application.rb +3 -1
  25. data/lib/when_exe/{googlecalendar.rb → obsolete/googlecalendar.rb} +144 -144
  26. data/lib/when_exe/parts/enumerator.rb +498 -486
  27. data/lib/when_exe/parts/geometric_complex.rb +397 -397
  28. data/lib/when_exe/parts/timezone.rb +246 -241
  29. data/lib/when_exe/region/armenian.rb +55 -56
  30. data/lib/when_exe/region/babylonian.rb +406 -405
  31. data/lib/when_exe/region/bahai.rb +107 -106
  32. data/lib/when_exe/region/balinese.rb +624 -622
  33. data/lib/when_exe/region/chinese.rb +1071 -1026
  34. data/lib/when_exe/region/chinese/epochs.rb +28 -28
  35. data/lib/when_exe/region/chinese/notes.rb +219 -0
  36. data/lib/when_exe/region/chinese/twins.rb +803 -803
  37. data/lib/when_exe/region/christian.rb +21 -15
  38. data/lib/when_exe/region/coptic.rb +107 -106
  39. data/lib/when_exe/region/discordian.rb +218 -218
  40. data/lib/when_exe/region/east_asian.rb +1 -1
  41. data/lib/when_exe/region/french.rb +126 -56
  42. data/lib/when_exe/region/geologicalage.rb +639 -639
  43. data/lib/when_exe/region/goddess.rb +60 -58
  44. data/lib/when_exe/region/hanke_henry.rb +2 -2
  45. data/lib/when_exe/region/indian.rb +1225 -1222
  46. data/lib/when_exe/region/international_fixed.rb +96 -97
  47. data/lib/when_exe/region/iranian.rb +206 -203
  48. data/lib/when_exe/region/islamic.rb +102 -102
  49. data/lib/when_exe/region/japanese.rb +126 -71
  50. data/lib/when_exe/region/japanese/epochs.rb +426 -426
  51. data/lib/when_exe/region/japanese/notes.rb +101 -81
  52. data/lib/when_exe/region/japanese/residues.rb +1345 -1311
  53. data/lib/when_exe/region/japanese/twins.rb +225 -225
  54. data/lib/when_exe/region/japanese/weeks.rb +112 -112
  55. data/lib/when_exe/region/javanese.rb +230 -230
  56. data/lib/when_exe/region/jewish.rb +130 -131
  57. data/lib/when_exe/region/m17n.rb +114 -114
  58. data/lib/when_exe/region/martian.rb +258 -258
  59. data/lib/when_exe/region/mayan.rb +11 -8
  60. data/lib/when_exe/region/pax.rb +4 -5
  61. data/lib/when_exe/region/pope.rb +1 -1
  62. data/lib/when_exe/region/positivist.rb +100 -100
  63. data/lib/when_exe/region/residue.rb +162 -162
  64. data/lib/when_exe/region/roman.rb +333 -333
  65. data/lib/when_exe/region/{soviet.rb → russian.rb} +221 -209
  66. data/lib/when_exe/region/shire.rb +222 -223
  67. data/lib/when_exe/region/symmetry.rb +50 -50
  68. data/lib/when_exe/region/thai.rb +336 -336
  69. data/lib/when_exe/region/tibetan.rb +315 -316
  70. data/lib/when_exe/region/tranquility.rb +207 -208
  71. data/lib/when_exe/region/vanishing_leprechaun.rb +3 -1
  72. data/lib/when_exe/region/vietnamese.rb +449 -440
  73. data/lib/when_exe/region/weekdate.rb +80 -80
  74. data/lib/when_exe/region/world.rb +170 -171
  75. data/lib/when_exe/region/world_season.rb +89 -89
  76. data/lib/when_exe/region/yerm.rb +3 -3
  77. data/lib/when_exe/region/zoroastrian.rb +205 -205
  78. data/lib/when_exe/timestandard.rb +708 -707
  79. data/lib/when_exe/tmduration.rb +338 -338
  80. data/lib/when_exe/tmobjects.rb +1356 -1356
  81. data/lib/when_exe/tmposition.rb +66 -31
  82. data/lib/when_exe/version.rb +16 -2
  83. data/test/examples/Residue.m17n +83 -83
  84. data/test/examples/Terms.m17n +2 -2
  85. data/test/test.rb +2 -2
  86. data/test/test/google_api.rb +65 -0
  87. data/test/test/linkeddata.rb +1 -1
  88. data/test/test/{googlecalendar.rb → obsolete/googlecalendar.rb} +194 -194
  89. data/test/test/region/indian.rb +90 -85
  90. data/test/test/region/m17n.rb +7 -7
  91. data/test/test/region/mayan.rb +195 -195
  92. data/test/test/region/residue.rb +153 -153
  93. data/test/test/tmposition.rb +11 -1
  94. data/when_exe.gemspec +2 -2
  95. metadata +95 -8
  96. data/test/test.rb.config +0 -1
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  =begin
3
- Copyright (C) 2011-2014 Takashi SUGA
3
+ Copyright (C) 2011-2015 Takashi SUGA
4
4
 
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
@@ -16,7 +16,7 @@ module When
16
16
  #
17
17
  Chinese = [{'V'=>{'0618'=>{'A'=>'0618', 'B'=>'0618B', 'C'=>'0618C'}}}, self, [
18
18
  "locale:[=ja:, en=en:]",
19
- 'area:[中国#{?V=V}=ja:%%<元号>#%.<中国>,China#{?V=V}=en:Chinese_era_name]',
19
+ 'area:[中国#{?V=V}=ja:%%<元号>#%.<中国>,China#{?V=V}=en:Chinese_era_name, zh:中國#{?V=V}=zh:%%<年号>#%.<中國>]',
20
20
  [self,
21
21
  "period:[秦]",
22
22
  ["[<始皇帝>]25*", "@F" , "name=[始皇帝];-221*10-01^Chinese_221"],# 歳首は10月
@@ -144,7 +144,7 @@ module When
144
144
  ["[延康=ja:%%<延康_(漢)>]1" , "" , " 220-03", "220-10-29"]
145
145
  ],
146
146
  [self,
147
- "period:[三国=ja:%%<三国時代_(中国)>]",
147
+ "period:[三国=ja:%%<三国時代_(中国)>, zh:三國=zh:%%<三国>]",
148
148
  [self,
149
149
  "period:[蜀漢]",
150
150
  ["[章武]1" , "@A" , "name=[昭烈帝=ja:%%<劉備>];221-04-06^Chinese_103"], # 劉備 丙午 2185-4 四分暦を使用
@@ -334,7 +334,7 @@ module When
334
334
  ]
335
335
  ],
336
336
  [self,
337
- "period:[五胡十六国=ja:%%<五胡十六国時代>]",
337
+ "period:[五胡十六国=ja:%%<五胡十六国時代>, zh:五胡十六國=zh:%%<五胡十六国>]",
338
338
  [self,
339
339
  "period:[成漢]",
340
340
  ["[建初=ja:%%<建初_(成漢)>]1" , "@F" , "name=[李特];303-01^Chinese0239", # 景帝 2677-1 考異多
@@ -535,7 +535,7 @@ module When
535
535
  ["[太平真君]1" , "" , " 440-06-21"], # 丁丑
536
536
  ["[正平=ja:%%<正平_(北魏)>]1" , "" , " 451-06-09"], # 壬戌 本年以前は景初暦を使用していた模様
537
537
  ["[承平=ja:%%<承平_(北魏)>,alias:永平=ja:%%<承平_(北魏)>]1","@A" , "name=[南安王=ja:%%<拓跋余>];452-02^Chinese0412"], # 3974-2
538
- ["[興安=ja:%%<興安_(北魏)>]1" ,"@A","name=[文成帝=ja:%%<文成帝_(北魏)>];452-10-03"], # 戊申 本年から元始暦を使用
538
+ ["[興安=ja:%%<興安_(北魏)>]1" ,"@A","name=[文成帝=ja:%%<文成帝_(北魏)>];452-10-03"], # 戊申 本年から玄始暦を使用
539
539
  ["[興光]1" , "" , " 454-07-06"], # 辛丑
540
540
  ["[太安=ja:%%<太安_(北魏)>]1" , "" , " 455-06-02"], # 壬戌
541
541
  ["[和平=ja:%%<和平_(北魏)>]1" , "" , " 460-01-01"], # 甲子
@@ -607,83 +607,83 @@ module When
607
607
  ["[開皇]1" , "@F","name=[文帝=ja:%%<楊堅>];581-02-13^Chinese0523"], # 甲子 開皇4年から開皇暦を使用
608
608
  ["[仁寿=ja:%%<仁寿_(隋)>]1" , "" , " 601-01-01"], # 乙酉 開皇17年から大業暦を使用
609
609
  ["[大業]1" , "@A" , "name=[煬帝];605-01-01", "618-03-10="], # 壬辰
610
- ["[皇泰]1" , "@A","name=[恭帝=ja:%%<恭帝トウ>];618-05-24^ChineseTwin::大業暦", "619-04-08"], # 戊辰 5791-26
610
+ ["[皇泰]1" , "@A","name=[恭帝=ja:%%<恭帝トウ>];618-05-24^ChineseTwin?note=Chinese::大業暦", "619-04-08"], # 戊辰 5791-26
611
611
  [self,
612
612
  "period:[鄭<王世充>=ja:%%<王世充>]",
613
- ["[開明=ja:%%<開明_(王世充)>]1" ,"@F" ,"name=[王世充];619-04-08^ChineseTwin::大業暦", "621-05-{丁卯}"] # 丙午 5853-45, 621-05-09=は丁卯
613
+ ["[開明=ja:%%<開明_(王世充)>]1" ,"@F" ,"name=[王世充];619-04-08^ChineseTwin?note=Chinese::大業暦", "621-05-{丁卯}"] # 丙午 5853-45, 621-05-09=は丁卯
614
614
  ],
615
615
  [self,
616
616
  "period:[梁<蕭銑>=ja:%%<蕭銑>]",
617
- ["[鳳鳴, alias:鳴鳳=ja:%%<鳳鳴>]1", "@F", "name=[蕭銑];617-10^ChineseTwin::大業暦", "621-10-21="] # 5761-17
617
+ ["[鳳鳴, alias:鳴鳳=ja:%%<鳳鳴>]1", "@F", "name=[蕭銑];617-10^ChineseTwin?note=Chinese::大業暦", "621-10-21="] # 5761-17
618
618
  ],
619
619
  [self,
620
620
  "period:[梁<梁師都>=ja:%%<梁師都>]",
621
- ["[永隆=ja:%%<永隆_(梁師都)>]1" ,"@F" ,"name=[梁師都];617-03^ChineseTwin::大業暦", "628-04-26="] # 5725-9
621
+ ["[永隆=ja:%%<永隆_(梁師都)>]1" ,"@F" ,"name=[梁師都];617-03^ChineseTwin?note=Chinese::大業暦", "628-04-26="] # 5725-9
622
622
  ],
623
623
  [self,
624
624
  "period:[梁<沈法興>=ja:%%<沈法興>]",
625
- ["[延康=ja:%%<延康_(沈法興)>]1" ,"@F" ,"name=[沈法興];619-08^ChineseTwin::大業暦", "620-12="] # 5863-77
625
+ ["[延康=ja:%%<延康_(沈法興)>]1" ,"@F" ,"name=[沈法興];619-08^ChineseTwin?note=Chinese::大業暦", "620-12="] # 5863-77
626
626
  ],
627
627
  [self,
628
628
  "period:[元興<操師乞>=ja:%%<操師乞>]",
629
- ["[始興=ja:%%<始興_(操師乞))>,alias:天成=ja:%%<始興_(操師乞))>]1","@F","name=[操師乞];616-12-01^ChineseTwin::大業暦", "616-12="] # 『隋書』十二月癸未 Wikipedia
629
+ ["[始興=ja:%%<始興_(操師乞))>,alias:天成=ja:%%<始興_(操師乞))>]1","@F","name=[操師乞];616-12-01^ChineseTwin?note=Chinese::大業暦", "616-12="] # 『隋書』十二月癸未 Wikipedia
630
630
  ],
631
631
  [self,
632
632
  "period:[呉<李子通>=ja:%%<李子通>]",
633
- ["[明政=ja:%%<明政_(李子通)>]1" ,"@F" ,"name=[李子通];619-08^ChineseTwin::大業暦", "621-11="] # 5863-77
633
+ ["[明政=ja:%%<明政_(李子通)>]1" ,"@F" ,"name=[李子通];619-08^ChineseTwin?note=Chinese::大業暦", "621-11="] # 5863-77
634
634
  ],
635
635
  [self,
636
636
  "period:[楚<林士弘>=ja:%%<林士弘>]",
637
- ["[太平=ja:%%<太平_(林士弘)>]1" ,"@F" ,"name=[林士弘];616-12-10^ChineseTwin::大業暦", "622-10-21="] # 壬辰 5712-16
637
+ ["[太平=ja:%%<太平_(林士弘)>]1" ,"@F" ,"name=[林士弘];616-12-10^ChineseTwin?note=Chinese::大業暦", "622-10-21="] # 壬辰 5712-16
638
638
  ],
639
639
  [self,
640
640
  "period:[楚<朱粲>=ja:%%<朱粲>]",
641
- ["[昌達]1" , "@F" ,"name=[朱粲];618-10^ChineseTwin::大業暦", "619-02?"] # 5817-22
641
+ ["[昌達]1" , "@F" ,"name=[朱粲];618-10^ChineseTwin?note=Chinese::大業暦", "619-02?"] # 5817-22
642
642
  ],
643
643
  [self,
644
644
  "period:[夏<竇建徳>=ja:%%<竇建徳>]",
645
- ["[丁丑=ja:%%<丁丑_(夏)>]1", "@F", "name=[竇建徳];617-01-05^ChineseTwin::大業暦"], # 丙辰 5718-2
645
+ ["[丁丑=ja:%%<丁丑_(夏)>]1", "@F", "name=[竇建徳];617-01-05^ChineseTwin?note=Chinese::大業暦"], # 丙辰 5718-2
646
646
  ["[五鳳=ja:%%<五鳳_(夏)>]1", "", " 618-07", "621-05-{丁卯}"] # 5805-54, 621-05-09=は丁卯
647
647
  ],
648
648
  [self,
649
649
  "period:[漢東<劉黒闥>=ja:%%<劉黒闥>]",
650
- ["[天造]1" , "@F" ,"name=[劉黒闥];622-01^ChineseTwin::大業暦", "623-01-{庚辰}"] # 5942-1, 623-01-03=は庚辰
650
+ ["[天造]1" , "@F" ,"name=[劉黒闥];622-01^ChineseTwin?note=Chinese::大業暦", "623-01-{庚辰}"] # 5942-1, 623-01-03=は庚辰
651
651
  ],
652
652
  [self,
653
653
  "period:[魏<李密>=ja:%%<李密_(隋)>]",
654
- ["[永平=ja:%%<永平_(李密)>]1" , "@F" ,"name=[李密=ja:%%<李密_(隋)>];617-02-19^ChineseTwin::大業暦", "618-09="] # 庚子 5720-7
654
+ ["[永平=ja:%%<永平_(李密)>]1" , "@F" ,"name=[李密=ja:%%<李密_(隋)>];617-02-19^ChineseTwin?note=Chinese::大業暦", "618-09="] # 庚子 5720-7
655
655
  ],
656
656
  [self,
657
657
  "period:[許<宇文化及>=ja:%%<宇文化及>]",
658
- ["[天寿=ja:%%<天寿_(宇文化及)>]1" ,"@F" ,"name=[宇文化及];618-09^ChineseTwin::大業暦", "619-02?"] # 5761-17
658
+ ["[天寿=ja:%%<天寿_(宇文化及)>]1" ,"@F" ,"name=[宇文化及];618-09^ChineseTwin?note=Chinese::大業暦", "619-02?"] # 5761-17
659
659
  ],
660
660
  [self,
661
661
  "period:[涼<李軌>=ja:%%<李軌>]",
662
- ["[安楽=ja:%%<安楽_(年号)>]1" , "@F" ,"name=[李軌];618-11-04^ChineseTwin::大業暦", "619-05-{辛巳}"] # 乙巳 5820-28, 619-05-13=は辛巳
662
+ ["[安楽=ja:%%<安楽_(年号)>]1" , "@F" ,"name=[李軌];618-11-04^ChineseTwin?note=Chinese::大業暦", "619-05-{辛巳}"] # 乙巳 5820-28, 619-05-13=は辛巳
663
663
  ],
664
664
  [self,
665
665
  "period:[燕<高開道>=ja:%%<高開道>]",
666
- ["[始興=ja:%%<始興_(高開道)>]1" ,"@F" ,"name=[高開道];618-12^ChineseTwin::大業暦", "620-10-{己酉}"] # 5833-47, 620-10-19=は己酉
666
+ ["[始興=ja:%%<始興_(高開道)>]1" ,"@F" ,"name=[高開道];618-12^ChineseTwin?note=Chinese::大業暦", "620-10-{己酉}"] # 5833-47, 620-10-19=は己酉
667
667
  ],
668
668
  [self,
669
669
  "period:[乗<高曇晟>=ja:%%<高曇晟>]",
670
- ["[法輪=ja:%%<法輪_(高曇晟)>]1" ,"@F" ,"name=[高曇晟];618-12^ChineseTwin::大業暦", "619-02="] # 5833-47
670
+ ["[法輪=ja:%%<法輪_(高曇晟)>]1" ,"@F" ,"name=[高曇晟];618-12^ChineseTwin?note=Chinese::大業暦", "619-02="] # 5833-47
671
671
  ],
672
672
  [self,
673
673
  "period:[定楊<劉武周>=ja:%%<劉武周>]",
674
- ["[天興=ja:%%<天興_(劉武周)>]1" ,"@F" ,"name=[劉武周];617-03-17^ChineseTwin::大業暦", "620-04="] # 丁卯 5725-8
674
+ ["[天興=ja:%%<天興_(劉武周)>]1" ,"@F" ,"name=[劉武周];617-03-17^ChineseTwin?note=Chinese::大業暦", "620-04="] # 丁卯 5725-8
675
675
  ],
676
676
  [self,
677
677
  "period:[西秦<薛挙>=zh:%%<薛舉>]",
678
- ["[秦興]1" , "@F" ,"name=[薛挙=zh:%%<薛舉>];617-04-03^ChineseTwin::大業暦", "618-11-08="] # 癸未 5725-11
678
+ ["[秦興]1" , "@F" ,"name=[薛挙=zh:%%<薛舉>];617-04-03^ChineseTwin?note=Chinese::大業暦", "618-11-08="] # 癸未 5725-11
679
679
  ],
680
680
  [self,
681
681
  "period:[永楽<郭子和>=ja:%%<郭子和>]",
682
- ["[正平=ja:%%<正平_(郭子和)>, alias:丑平=]1","@F","name=[郭子和];617-03^ChineseTwin::大業暦", "618-12="] # 5725-10
682
+ ["[正平=ja:%%<正平_(郭子和)>, alias:丑平=]1","@F","name=[郭子和];617-03^ChineseTwin?note=Chinese::大業暦", "618-12="] # 5725-10
683
683
  ],
684
684
  [self,
685
685
  "period:[<曹武徹>]",
686
- ["[通聖]1" , "@F" ,"name=[曹武徹];617-12-11^ChineseTwin::大業暦", "617-12="] # 隋書による
686
+ ["[通聖]1" , "@F" ,"name=[曹武徹];617-12-11^ChineseTwin?note=Chinese::大業暦", "617-12="] # 隋書による
687
687
  ],
688
688
  [self,
689
689
  "period:[隋<恭帝>=ja:%%<恭帝侑>]",
@@ -790,7 +790,7 @@ module When
790
790
  ]
791
791
  ],
792
792
  [self,
793
- "period:[五代十国=ja:%%<五代十国時代>]",
793
+ "period:[五代十国=ja:%%<五代十国時代>, zh:五代十國=zh:%%<五代十国>]",
794
794
  [self,
795
795
  "period:[呉=ja:%%<呉_(十国)>]",
796
796
  ["[天祐=ja:%%<天祐_(唐)>,alias:天佑=ja:%%<天祐_(唐)>]4","","name=[楊渥];907-04-22^Chinese0523", # 戊辰 唐滅亡後も、五代を認めず旧年号を使用 4.04.22
@@ -1210,8 +1210,8 @@ module When
1210
1210
  ["[宣統]1" , "@A" , "name=[末帝=ja:%%<愛新覚羅溥儀>];1909-01-01", "1911-11-12="],
1211
1211
  ],
1212
1212
  [self,
1213
- "period:[中華民国=ja:%%<民国紀元>,ROC=en:Chinese_era_name#The_Republic_of_China_Era]",
1214
- ["[民国=ja:%%<民国紀元>,ROC=en:Chinese_era_name#The_Republic_of_China_Era]1",
1213
+ "period:[中華民国=ja:%%<民国紀元>,ROC=en:Chinese_era_name#The_Republic_of_China_Era,zh:中華民國=zh:%%<民國紀年>]",
1214
+ ["[民国=ja:%%<民国紀元>,ROC=en:Chinese_era_name#The_Republic_of_China_Era,zh:民國=zh:%%<民國紀年>]1",
1215
1215
  "@F", "name=;1912-01-01^Gregorian?note=Chinese"]
1216
1216
  ]
1217
1217
  ]]
@@ -0,0 +1,219 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2015 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
+ require 'when_exe/ephemeris/notes'
9
+
10
+ module When
11
+
12
+ class BasicTypes::M17n
13
+
14
+ #
15
+ # 節日の名称
16
+ #
17
+ ChineseLuniSolarHoliday = [self, [
18
+ "locale:[=ja:, en=en:, zh=zh:, alias=ja:]",
19
+ "names:[節日=, *Holiday=, 歲時節日=]", # 節句など
20
+ "[元日, New Year's Day, 春節 ]",
21
+ "[人日, Renri, 人日 ]",
22
+ "[小正月, First Full Moon Festival, 元宵節 ]",
23
+ "[弥生節句=ja:%%<上巳>, Double Third Festival=, 上巳節 ]",
24
+ "[端午節句=ja:%%<端午>, Double Fifth Festival=, 端午節 ]",
25
+ "[七夕節句=ja:%%<七夕>, Qixi Festival, 七夕 ]",
26
+ "[お盆, Bon Festival, 中元節 ]",
27
+ "[田実節句=ja:%%<八朔>, Hassaku=, 八朔= ]",
28
+ "[重陽節句, Double Ninth Festival, 重陽節 ]"
29
+ ]]
30
+ end
31
+
32
+ class CalendarNote
33
+
34
+ #
35
+ # 暦月の暦注
36
+ #
37
+ class ChineseLuniSolar < self
38
+
39
+ #
40
+ # 節日の日付
41
+ #
42
+ Holidays = {
43
+ [1, 1] => When.M17n('ChineseLuniSolarHoliday::元日'),
44
+ [1, 7] => When.M17n('ChineseLuniSolarHoliday::人日'),
45
+ [1,15] => When.M17n('ChineseLuniSolarHoliday::小正月'),
46
+ [3, 3] => When.M17n('ChineseLuniSolarHoliday::弥生節句'),
47
+ [5, 5] => When.M17n('ChineseLuniSolarHoliday::端午節句'),
48
+ [7, 7] => When.M17n('ChineseLuniSolarHoliday::七夕節句'),
49
+ [7,15] => When.M17n('ChineseLuniSolarHoliday::お盆'),
50
+ [8, 1] => When.M17n('ChineseLuniSolarHoliday::田実節句'),
51
+ [9, 9] => When.M17n('ChineseLuniSolarHoliday::重陽節句')
52
+ }
53
+
54
+ #
55
+ # 年月日の暦注
56
+ #
57
+ Notes = [When::BasicTypes::M17n, [
58
+ "locale:[=ja:, en=en:, zh=zh:, alias=en:]",
59
+ "names:[暦月の暦注=, LuniSolarNote=]",
60
+
61
+ # 年の暦注 ----------------------------
62
+ [When::BasicTypes::M17n,
63
+ "names:[年の暦注=, note for year=, prefix:YearNote=, *alias:year=]",
64
+ [When::BasicTypes::M17n,
65
+ "names:[年の暦注=, note for year=, *alias:Year=]"
66
+ ]
67
+ ],
68
+
69
+ # 月の暦注 ----------------------------
70
+ [When::BasicTypes::M17n,
71
+ "names:[月の暦注=, note for month=, prefix:MonthNote=, *alias:month=]",
72
+ [When::BasicTypes::M17n,
73
+ "names:[月の名前=ja:%%<月_(暦)>, month name=en:Month, 該月的名稱=, *alias:Month=]"
74
+ ]
75
+ ],
76
+
77
+ # 日の暦注 ----------------------------
78
+ [When::BasicTypes::M17n,
79
+ "names:[日の暦注=, note for day=, prefix:DayNote=, *alias:day]",
80
+ "[週, *Week, 星期 ]", # 七曜
81
+ "[干支, *StemBranch=en:Sexagenary_cycle, 干支 ]", # 六十干支
82
+ "[二十四節気, *SolarTerm=en:Solar_term, 節気=zh:%%<节气>]", # 二十四節気
83
+ "[没=, *Motsu=, 没= ]", # 没
84
+ "[節日=, *Holiday=, 歲時節日= ]" # 節句など
85
+ ]
86
+ ]]
87
+
88
+ #
89
+ # 年の干支
90
+ #
91
+ # @param [When::TM::TemporalPosition] date
92
+ # @param [Hash] options dummy
93
+ #
94
+ # @return [When::Coordinates::Residue] 六十干支
95
+ #
96
+ def year(date, options={})
97
+ When.Residue('干支')[(date.most_significant_coordinate-4) % 60]
98
+ end
99
+
100
+ #
101
+ # 七曜
102
+ #
103
+ # @param [When::TM::TemporalPosition] date
104
+ # @param [Hash] options dummy
105
+ #
106
+ # @return [When::Coordinates::Residue] 七曜
107
+ #
108
+ def week(date, options={})
109
+ When.Residue('Week')[date.to_i % 7]
110
+ end
111
+
112
+ #
113
+ # 日の干支
114
+ #
115
+ # @param [When::TM::TemporalPosition] date
116
+ # @param [Hash] options dummy
117
+ #
118
+ # @return [When::Coordinates::Residue] 六十干支
119
+ #
120
+ def stembranch(date, options={})
121
+ When.Residue('干支')[(date.to_i-11) % 60]
122
+ end
123
+
124
+ #
125
+ # 二十四節気
126
+ #
127
+ # @param [When::TM::TemporalPosition] date
128
+ # @param [Hash] options dummy
129
+ #
130
+ # @return [When::Coordinates::Residue] 二十四節気 or nil
131
+ #
132
+ def solarterm(date, options={})
133
+ _day_notes(date, options)['二十四節気']
134
+ end
135
+
136
+ #
137
+ # 没
138
+ #
139
+ # @param [When::TM::TemporalPosition] date
140
+ # @param [Hash] options dummy
141
+ #
142
+ # @return [When::BasicTypes::M17n] 没 or nil
143
+ #
144
+ def motsu(date, options={})
145
+ _day_notes(date, options)['没']
146
+ end
147
+
148
+ #
149
+ # 節
150
+ #
151
+ # @param [When::TM::TemporalPosition] date
152
+ # @param [Hash] options dummy
153
+ #
154
+ # @return [When::BasicTypes::M17n] 節 or nil
155
+ #
156
+ def holiday(date, options={})
157
+ Holidays[[+date.cal_date[When::MONTH-1], date.cal_date[When::DAY-1]]]
158
+ end
159
+
160
+ # オブジェクトの正規化
161
+ def _normalize(args=[], options={})
162
+ @_all_keys ||= [%w(Year), %w(Month), %w(Week StemBranch SolarTerm Holiday)]
163
+ super
164
+ end
165
+
166
+ #
167
+ # 日の暦注
168
+ #
169
+ # @param [When::TM::TemporalPosition] date
170
+ # @param [Hash] options dummy
171
+ #
172
+ # @return [Hash] 暦注名=>暦注値
173
+ #
174
+ def _day_notes(date, options={})
175
+ s_date = When.when?(date.to_cal_date.to_s,
176
+ {:frame=>date.frame,
177
+ :clock=>(date.frame.kind_of?(When::CalendarTypes::EphemerisBasedSolar) || !date.frame.twin ?
178
+ date.frame :
179
+ When.Calendar(date.frame.twin))._time_basis[0]
180
+ })
181
+
182
+ # 没
183
+ notes = {}
184
+ longitude, motsu = SolarTerms.new('formula'=>date.frame.formula[0]).position(s_date)
185
+ if motsu == 0
186
+ notes['没'] = '没' unless date.most_significant_coordinate >= 1685 && date.frame.iri =~ /JapaneseTwin/
187
+ return notes
188
+ end
189
+
190
+ # 廿四節気
191
+ div, mod = longitude.divmod(15)
192
+ if mod == 0
193
+ note = (div - 21) % 24
194
+ div, mod = note.divmod(2)
195
+ notes['二十四節気'] ||=
196
+ When.Resource(date.frame.iri =~ /戊寅|麟徳|儀鳳/ ? '_co:Common?V=0618' : '_co:Common')['二十四節気::*'][(note-3) % 24]
197
+ end
198
+ notes
199
+ end
200
+ end
201
+
202
+ #
203
+ # 節月の暦注
204
+ #
205
+ class ChineseSolar < ChineseLuniSolar
206
+
207
+ #
208
+ # 年月日の暦注
209
+ #
210
+ Notes = ChineseLuniSolar::Notes
211
+
212
+ # オブジェクトの正規化
213
+ def _normalize(args=[], options={})
214
+ @_all_keys ||= [%w(Year), %w(Month), %w(Week StemBranch SolarTerm Motsu)]
215
+ super
216
+ end
217
+ end
218
+ end
219
+ end
@@ -1,803 +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:, en=en:]',
15
- 'area:[中国の暦月=, *ChineseLuniSolar=]',
16
- ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦'], # 西暦が正になるところから開始(実際は-103.01.01)
17
- ['[四分暦]85.01.01', '@CR', '85-01-01^ChineseTwin::四分暦', '265'],
18
- ['[乾象暦]222.01.01', '@CR', '222-01-01^ChineseTwin::乾象暦', '281'],
19
- ['[景初暦]237.01.01', '@CR', '237-01-01^ChineseTwin::景初暦', '452'],
20
- ['[元嘉暦]445.01.01', '@CR', '445-01-01^ChineseTwin::元嘉暦'],
21
- ['[大明暦]510.01.01', '@CR', '510-01-01^ChineseTwin::大明暦', '590'],
22
- ['[三紀暦=]384.01.01', '@CR', '384-01-01^ChineseTwin::三紀暦', '418'],
23
- ['[玄始暦=]412.01.01', '@CR', '412-01-01^ChineseTwin::玄始暦', '440'],
24
- ['[玄始暦=]452.01.01', '@CR', '452-01-01^ChineseTwin::玄始暦'],
25
- ['[正光暦=]523.01.01', '@CR', '523-01-01^ChineseTwin::正光暦', '566'],
26
- ['[興和暦=]540.01.01', '@CR', '540-01-01^ChineseTwin::興和暦'],
27
- ['[天保暦=]551.01.01', '@CR', '551-01-01^ChineseTwin::天保暦', '578'],
28
- ['[天和暦=]566.01.01', '@CR', '566-01-01^ChineseTwin::天和暦'],
29
- ['[大象暦=]579.01.01', '@CR', '579-01-01^ChineseTwin::大象暦'],
30
- ['[開皇暦=]584.01.01', '@CR', '584-01-01^ChineseTwin::開皇暦'],
31
- ['[大業暦=]597.01.01', '@CR', '597-01-01^ChineseTwin::大業暦'],
32
- ['[戊寅元暦]619.01.01', '@CR', '619-01-01^ChineseTwin::戊寅元暦'],
33
- ['[平朔戊寅暦=]645.01.01','@CR','645-01-01^ChineseTwin::平朔戊寅暦'],
34
- ['[麟徳暦]665.01.01', '@CR', '665-01-01^ChineseTwin::麟徳暦'],
35
- ['[大衍暦]729.01.01', '@CR', '729-01-01^ChineseTwin::大衍暦'],
36
- ['[五紀暦]762.01.01', '@CR', '762-01-01^ChineseTwin::五紀暦'],
37
- ['[正元暦=]784.01.01', '@CR', '784-01-01^ChineseTwin::正元暦', '807-01-01'],
38
- ['[宣明暦]822.01.01', '@CR', '822-01-01^ChineseTwin::宣明暦'],
39
- ['[崇玄暦=]893.01.01', '@CR', '893-01-01^ChineseTwin::崇玄暦', '956-01-01'],
40
- ['[授時暦]1281.01.01', '@CR','1281-01-01^ChineseTwin::授時暦'],
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::太初暦(節月)'], # 西暦が正になるところから開始(実際は-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::元嘉暦(節月)'],
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::玄始暦(節月)'],
57
- ['[正光暦=]522.12.29', '@CR', '522-12-29^ChineseTwin::正光暦(節月)', '566-01-04'],
58
- ['[興和暦=]539.12.22', '@CR', '539-12-22^ChineseTwin::興和暦(節月)'],
59
- ['[天保暦=]550.12.19', '@CR', '550-12-19^ChineseTwin::天保暦(節月)', '577-12-21'],
60
- ['[天和暦=]566.01.05', '@CR', '566-01-05^ChineseTwin::天和暦(節月)'],
61
- ['[大象暦=]579.01.11', '@CR', '579-01-11^ChineseTwin::大象暦(節月)'],
62
- ['[開皇暦=]584.01.16', '@CR', '584-01-16^ChineseTwin::開皇暦(節月)'],
63
- ['[大業暦=]596.12.22', '@CR', '596-12-22^ChineseTwin::大業暦(節月)'],
64
- ['[戊寅元暦]618.12.19', '@CR', '618-12-19^ChineseTwin::戊寅元暦(節月)'],
65
- ['[麟徳暦]664.12.21', '@CR', '664-12-21^ChineseTwin::麟徳暦(節月)'],
66
- ['[大衍暦]729.01.03', '@CR', '729-01-03^ChineseTwin::大衍暦(節月)'],
67
- ['[五紀暦]761.12.29', '@CR', '761-12-29^ChineseTwin::五紀暦(節月)'],
68
- ['[正元暦=]783.12.26', '@CR', '783-12-26^ChineseTwin::正元暦(節月)', '807-01-11'],
69
- ['[宣明暦]821.01.01', '@CR', '821-01-01^ChineseTwin::宣明暦(節月)'], # 年の始めに遡って開始(実際は12.27)
70
- ['[崇玄暦=]892.12.22', '@CR', '892-12-22^ChineseTwin::崇玄暦(節月)', '956-01-15'],
71
- ['[授時暦]1280.01.01', '@CR', '1280-01-01^ChineseTwin::授時暦(節月)'],
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
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2011-2015 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
+ # Historical Chinese Luni-Solar Calendar for Chinese Note
13
+ ChineseLuniSolar = [self, [
14
+ 'locale:[=ja:, en=en:, zh=zh:, alias]',
15
+ 'area:[中国の暦月=, (Auto selected) ChineseLuniSolar=, 被在中國使用陰陽曆=, *ChineseLuniSolar=]',
16
+ ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦'], # 西暦が正になるところから開始(実際は-103.01.01)
17
+ ['[四分暦]85.01.01', '@CR', '85-01-01^ChineseTwin::四分暦', '265'],
18
+ ['[乾象暦]222.01.01', '@CR', '222-01-01^ChineseTwin::乾象暦', '281'],
19
+ ['[景初暦]237.01.01', '@CR', '237-01-01^ChineseTwin::景初暦', '452'],
20
+ ['[元嘉暦]445.01.01', '@CR', '445-01-01^ChineseTwin::元嘉暦'],
21
+ ['[大明暦]510.01.01', '@CR', '510-01-01^ChineseTwin::大明暦', '590'],
22
+ ['[三紀暦=]384.01.01', '@CR', '384-01-01^ChineseTwin::三紀暦', '418'],
23
+ ['[玄始暦=]412.01.01', '@CR', '412-01-01^ChineseTwin::玄始暦', '440'],
24
+ ['[玄始暦=]451.01.01', '@CR', '451-01-01^ChineseTwin::玄始暦'], # 北魏が実際に採用したのは翌年から
25
+ ['[正光暦=]523.01.01', '@CR', '523-01-01^ChineseTwin::正光暦', '566'],
26
+ ['[興和暦=]540.01.01', '@CR', '540-01-01^ChineseTwin::興和暦'],
27
+ ['[天保暦=]551.01.01', '@CR', '551-01-01^ChineseTwin::天保暦', '578'],
28
+ ['[天和暦=]566.01.01', '@CR', '566-01-01^ChineseTwin::天和暦'],
29
+ ['[大象暦=]579.01.01', '@CR', '579-01-01^ChineseTwin::大象暦', '584-01-01='],
30
+ ['[開皇暦=]584.01.01', '@CR', '584-01-01^ChineseTwin::開皇暦'],
31
+ ['[大業暦=]597.01.01', '@CR', '597-01-01^ChineseTwin::大業暦', '619-01-01='],
32
+ ['[戊寅元暦]619.01.01', '@CR', '619-01-01^ChineseTwin::戊寅元暦'],
33
+ ['[平朔戊寅暦=]645.01.01','@CR','645-01-01^ChineseTwin::平朔戊寅暦'],
34
+ ['[麟徳暦]665.01.01', '@CR', '665-01-01^ChineseTwin::麟徳暦'],
35
+ ['[大衍暦]729.01.01', '@CR', '729-01-01^ChineseTwin::大衍暦'],
36
+ ['[五紀暦]762.01.01', '@CR', '762-01-01^ChineseTwin::五紀暦'],
37
+ ['[正元暦=]784.01.01', '@CR', '784-01-01^ChineseTwin::正元暦', '807-01-01'],
38
+ ['[宣明暦]822.01.01', '@CR', '822-01-01^ChineseTwin::宣明暦'],
39
+ ['[崇玄暦=]893.01.01', '@CR', '893-01-01^ChineseTwin::崇玄暦', '956-01-01'],
40
+ ['[授時暦]1281.01.01', '@CR','1281-01-01^ChineseTwin::授時暦'],
41
+ ['[大統暦]1368.01.01', '@CR','1368-01-01^ChineseTwin::大統暦', '1645-01-01']
42
+ ]]
43
+
44
+ # Historical Chinese Solar Calendar for Chinese Note
45
+ ChineseSolar = [self, [
46
+ 'locale:[=ja:, en=en:, zh=zh:, alias]',
47
+ 'area:[中国の節月=, (Auto selected) ChineseSolar=, 被在中國使用陽曆=, *ChineseSolar]',
48
+ ['[太初暦]1.01.01', '@CR', '1-01-01^ChineseTwin::太初暦(節月)'], # 西暦が正になるところから開始(実際は-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.23='],
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::玄始暦(節月)'],
57
+ ['[正光暦=]522.12.29', '@CR', '522-12-29^ChineseTwin::正光暦(節月)', '566-01-04'],
58
+ ['[興和暦=]539.12.22', '@CR', '539-12-22^ChineseTwin::興和暦(節月)', '550.12.19='],
59
+ ['[天保暦=]550.12.19', '@CR', '550-12-19^ChineseTwin::天保暦(節月)', '577-12-21'],
60
+ ['[天和暦=]566.01.05', '@CR', '566-01-05^ChineseTwin::天和暦(節月)'],
61
+ ['[大象暦=]579.01.11', '@CR', '579-01-11^ChineseTwin::大象暦(節月)'],
62
+ ['[開皇暦=]584.01.16', '@CR', '584-01-16^ChineseTwin::開皇暦(節月)', '596.12.22='],
63
+ ['[大業暦=]596.12.22', '@CR', '596-12-22^ChineseTwin::大業暦(節月)'],
64
+ ['[戊寅元暦]618.12.19', '@CR', '618-12-19^ChineseTwin::戊寅元暦(節月)'],
65
+ ['[麟徳暦]664.12.21', '@CR', '664-12-21^ChineseTwin::麟徳暦(節月)'],
66
+ ['[大衍暦]729.01.03', '@CR', '729-01-03^ChineseTwin::大衍暦(節月)'],
67
+ ['[五紀暦]761.12.29', '@CR', '761-12-29^ChineseTwin::五紀暦(節月)'],
68
+ ['[正元暦=]783.12.26', '@CR', '783-12-26^ChineseTwin::正元暦(節月)', '807-01-11'],
69
+ ['[宣明暦]821.01.01', '@CR', '821-01-01^ChineseTwin::宣明暦(節月)'], # 年の始めに遡って開始(実際は12.27)
70
+ ['[崇玄暦=]892.12.22', '@CR', '892-12-22^ChineseTwin::崇玄暦(節月)', '956-01-15'],
71
+ ['[授時暦]1280.01.01', '@CR', '1280-01-01^ChineseTwin::授時暦(節月)'],
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