Skip to content
Snippets Groups Projects
seasons.sty 3.77 KiB
Newer Older
  • Learn to ignore specific revisions
  • \newcounter{fenestraYear}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcounter{fenestraDay}
    
    \newcommand\cycleDesc{}
    
    \newcommand\setCycle[2]{%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \setcounter{fenestraYear}{\year}%
    
      \multiply\value{fenestraYear}by 4%
      \addtocounter{fenestraYear}{0}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \setcounter{cycle}{#1}% Usually the current month's number, so March = 3.
      \whileboolexpr{%
        test {\ifnumcomp{\value{cycle}}{>}{3}}%
      }{%
        \addtocounter{cycle}{-3}% So April = 1, June = 3
        \stepcounter{fenestraYear}%
      }%
      \multiply\value{cycle}by 2% April = 2, June = 6
      \addtocounter{cycle}{-2}% April = 0, June = 4
      \setcounter{fenestraDay}{#2}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \ifnum\value{fenestraDay}>15%
        \addtocounter{fenestraDay}{-15}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \stepcounter{cycle}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \fi%
      \multiply\value{fenestraDay}by 4%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \addtocounter{fenestraDay}{-3}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \setTemperature%
    
    }
    
    %%% State a Cycle's name.
    
    \newcommand\showCycle[1][\value{cycle}]{%
      \ifcase#1%
    
        \renewcommand\cycleDesc{\glsentrydesc{cOne}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cTwo}}%
      \or%
    
        \glsentrytext{cThree}%
    
        \renewcommand\cycleDesc{\glsentrydesc{cThree}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cFour}}%
      \or%
    
        \renewcommand\cycleDesc{\glsentrydesc{cFive}}%
    
      \else%
        \glsentrytext{cSix}%
    
        \renewcommand\cycleDesc{\glsentrydesc{cSix}}%
      \fi%
    }
    
    
    \newcommand\setTemperature{%
    
      \ifcase\value{cycle}%
    
        \setcounter{temperature}{1}%
      \or%
        \setcounter{temperature}{0}%
      \or%
        \setcounter{temperature}{1}%
      \or%
        \setcounter{temperature}{2}%
      \or%
    
        \setcounter{temperature}{3}%
      \else
    
        \setcounter{temperature}{2}%
    
      \fi%
    }
    
    \newcommand\showTemperature{%
      \ifcase\value{temperature}%
    
        frigid%
    
        warm%
    
      \else%
        scorching%
    
    \newcommand\showInterval[1]{%
      \ifcase#1%
    
        \gls{morning}%
    
        \gls{afternoon}%
    
        \gls{evening}%
    
        \gls{night}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcommand\trackMonth[1][track]{%
      \ifcase\value{#1}\or%
        January\or February\or March\or April\or May\or June\or%
        July\or August\or September\or October\or November\else December\fi%
    }
    
    
    
    \newcounter{ainumarPosition}
    \newcounter{fenestraPosition}
    
    \newcommand\setPlanetPositions[2]{
      \setCycle{#1}{#2}
    
      \setcounter{ainumarPosition}{\value{cycle}}
      \addtocounter{ainumarPosition}{-1}
      \multiply\value{ainumarPosition}by 60
      \setcounter{diceNo}{#2}% get day offset
      \ifnum\value{diceNo}>15%
        \addtocounter{diceNo}{-15}%
      \fi%
      \multiply\value{diceNo}by 2%
      \addtocounter{ainumarPosition}{\value{diceNo}}
    
      \setcounter{fenestraPosition}{\value{ainumarPosition}}
      \setcounter{enc}{\value{cycle}}
      \addtocounter{enc}{-1}
      \multiply\value{enc}by 60
    
      \addtocounter{enc}{-15}% Allow room for day to move things a bit.
    
      \addtocounter{fenestraPosition}{\value{enc}}
    
      \addtocounter{fenestraPosition}{\value{diceNo}}
    
    }
    
    \newcommand\orrery[1][\month/\day]{
      \begin{tikzpicture}
        \coordinate (S) at (0,0);
    
        \draw[background, dotted] (S) circle (3.1);% Orbit
        \draw[background, dotted, thick] (S) circle (1.1);% Orbit
    
        \foreach \m/\d in {#1}{
          \setPlanetPositions{\m}{\d}
          \coordinate (A) at (\arabic{ainumarPosition}:3);
    
          \path (A) +(\arabic{fenestraPosition}:1.2) coordinate (F);
          \setcounter{encnum}{\value{cycle}}
          \stepcounter{encnum}
    
          \colourWheel[cycle]%
          \draw[background, dotted] (S) -- (A) -- (F);
          \draw[background] (A) circle (1.2);% Suborbit
          \fill[background] (A.center)  circle (6pt);
          \fill[black] (F.north) circle (2.5pt);
          \colorlet{foreground}{black}
          \colorlet{background}{white}
          \coordinate [label={{\outline{\Roman{encnum} \Large\scshape\showCycle}}}] (FN) at (A.north);
    
        \fill[background] (S)  circle (25pt);
    
        %
      \end{tikzpicture}
    
      \setCycle{\month}{\day}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \setCycle{\month}{\day}