Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
42
Task/Biorhythms/Mathematica/biorhythms.math
Normal file
42
Task/Biorhythms/Mathematica/biorhythms.math
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
targetdate = "1972-07-11";
|
||||
birthdate = "1943-03-09";
|
||||
targetdate //= DateObject;
|
||||
birthdate //= DateObject;
|
||||
|
||||
cyclelabels = {"Physical", "Emotional", "Mental"};
|
||||
cyclelengths = {23, 28, 33};
|
||||
quadrants = {{"up and rising", "peak"}, {"up but falling",
|
||||
"transition"}, {"down and falling", "valley"}, {"down but rising",
|
||||
"transition"}};
|
||||
|
||||
d = QuantityMagnitude[DateDifference[birthdate, targetdate], "Days"];
|
||||
Print["Day ", d, ":"];
|
||||
Do[
|
||||
label = cyclelabels[[i]];
|
||||
length = cyclelengths[[i]];
|
||||
position = Mod[d, length];
|
||||
quadrant = Floor[4 (position + 1)/length];
|
||||
percentage = Round[100*Sin[2*Pi*position/length]];
|
||||
transitiondate =
|
||||
DatePlus[targetdate, Floor[(quadrant + 1)/4*length] - position];
|
||||
{trend, next} = quadrants[[quadrant]];
|
||||
If[percentage > 95,
|
||||
description = "peak"
|
||||
,
|
||||
If[percentage < -95,
|
||||
description = "valley"
|
||||
,
|
||||
If[Abs[percentage] < 5,
|
||||
description = "critical transition"
|
||||
,
|
||||
description =
|
||||
ToString[percentage] <> "% (" <> trend <> ", next " <> next <>
|
||||
" " <> DateString[transitiondate, "ISODate"] <> ")"
|
||||
]
|
||||
]
|
||||
];
|
||||
Print[label <> " day " <> ToString[position] <> ": " <>
|
||||
description];
|
||||
,
|
||||
{i, 3}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue