Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
67
Task/Mayan-calendar/Mathematica/mayan-calendar.math
Normal file
67
Task/Mayan-calendar/Mathematica/mayan-calendar.math
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
sacred = {"Imix\[CloseCurlyQuote]", "Ik\[CloseCurlyQuote]",
|
||||
"Ak\[CloseCurlyQuote]bal", "K\[CloseCurlyQuote]an", "Chikchan",
|
||||
"Kimi", "Manik\[CloseCurlyQuote]", "Lamat", "Muluk", "Ok",
|
||||
"Chuwen", "Eb", "Ben", "Hix", "Men",
|
||||
"K\[CloseCurlyQuote]ib\[CloseCurlyQuote]", "Kaban",
|
||||
"Etz\[CloseCurlyQuote]nab\[CloseCurlyQuote]", "Kawak", "Ajaw"};
|
||||
civil = {"Pop", "Wo\[CloseCurlyQuote]", "Sip",
|
||||
"Sotz\[CloseCurlyQuote]", "Sek", "Xul", "Yaxk\[CloseCurlyQuote]in",
|
||||
"Mol", "Ch\[CloseCurlyQuote]en", "Yax", "Sak\[CloseCurlyQuote]",
|
||||
"Keh", "Mak", "K\[CloseCurlyQuote]ank\[CloseCurlyQuote]in",
|
||||
"Muwan\[CloseCurlyQuote]", "Pax", "K\[CloseCurlyQuote]ayab",
|
||||
"Kumk\[CloseCurlyQuote]u", "Wayeb\[CloseCurlyQuote]"};
|
||||
date1 = {2012, 12, 21, 0, 0, 0};
|
||||
date2 = {2019, 4, 2, 0, 0, 0};
|
||||
|
||||
ClearAll[Tzolkin]
|
||||
Tzolkin[date_] := Module[{diff, rem, num},
|
||||
diff = QuantityMagnitude[DateDifference[date1, date], "Days"];
|
||||
rem = Mod[diff, 13];
|
||||
If[rem <= 9,
|
||||
num = rem + 4
|
||||
,
|
||||
num = rem - 9
|
||||
];
|
||||
rem = Mod[diff, 20, 1];
|
||||
ToString[num] <> " " <> sacred[[rem]]
|
||||
]
|
||||
ClearAll[Haab]
|
||||
Haab[date_] := Module[{diff, rem, month, last, d},
|
||||
diff = QuantityMagnitude[DateDifference[date2, date], "Days"];
|
||||
rem = Mod[diff, 365];
|
||||
month = civil[[Floor[(rem + 1)/20] + 1]];
|
||||
last = 20;
|
||||
If[month == Last[civil],
|
||||
last = 5
|
||||
];
|
||||
d = Mod[rem, 20] + 1;
|
||||
If[d < last,
|
||||
ToString[d] <> " " <> month
|
||||
,
|
||||
"Chum " <> month
|
||||
]
|
||||
]
|
||||
ClearAll[LongCount]
|
||||
LongCount[date_] := Module[{diff, baktun, katun, tun, winal, kin},
|
||||
diff = QuantityMagnitude[DateDifference[date1, date], "Days"];
|
||||
diff += 13 400 360;
|
||||
{baktun, diff} = QuotientRemainder[diff, 400 360];
|
||||
{katun, diff} = QuotientRemainder[diff, 20 360];
|
||||
{tun, diff} = QuotientRemainder[diff, 360];
|
||||
{winal, kin} = QuotientRemainder[diff, 20];
|
||||
StringRiffle[ToString /@ {baktun, katun, tun, winal, kin}, "."]
|
||||
]
|
||||
ClearAll[LordOfTheNight]
|
||||
LordOfTheNight[date_] := Module[{diff, rem},
|
||||
diff = QuantityMagnitude[DateDifference[date1, date], "Days"];
|
||||
rem = Mod[diff, 9, 1];
|
||||
"G" <> ToString[rem]
|
||||
]
|
||||
data = {{2004, 06, 19}, {2012, 12, 18}, {2012, 12, 21}, {2019, 01,
|
||||
19}, {2019, 03, 27}, {2020, 02, 29}, {2020, 03, 01}, {2071, 05,
|
||||
16}};
|
||||
tzolkindata = Tzolkin /@ data;
|
||||
haabdata = Haab /@ data;
|
||||
longcountdata = LongCount /@ data;
|
||||
lotndata = LordOfTheNight /@ data;
|
||||
{DateObject /@ data, tzolkindata, haabdata, longcountdata, lotndata} // Transpose // Grid
|
||||
Loading…
Add table
Add a link
Reference in a new issue