Created
August 14, 2013 08:39
-
-
Save felixlindemann/6229067 to your computer and use it in GitHub Desktop.
Latex-Beamer: Create Rooty Helix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Rooty helix | |
% Author: Felix Lindemann | |
\documentclass{minimal} | |
\usepackage{tikz} | |
\usetikzlibrary{calc} | |
\begin{document} | |
\pagestyle{empty} | |
\pgfdeclarelayer{background} | |
\pgfdeclarelayer{foreground} | |
\pgfsetlayers{background,main,foreground} | |
\xdefinecolor{darkgreen}{RGB}{175, 193, 36} | |
\newcounter{cntShader} | |
\newcounter{cntRoot} | |
\setcounter{cntShader}{20} | |
\def\couleur{darkgreen} | |
\begin{tikzpicture} | |
\foreach \y in {86,38,15}{ | |
\setcounter{cntShader}{1} | |
\coordinate (a) at (0,0); | |
\coordinate (b) at (0:1); | |
\foreach \x in {1,...,\y}{% | |
\coordinate (c) at ($ (b)!1cm!270:(a) $); | |
\begin{pgfonlayer}{background} | |
\draw[fill=\couleur!\thecntShader] (a)--(b)--(c)--cycle; | |
\end{pgfonlayer} | |
\setcounter{cntRoot}{\x} | |
\addtocounter{cntRoot}{1} | |
\node[fill=white,draw,circle,inner sep=1pt] at (c) | |
{$\sqrt{\thecntRoot}$}; | |
\coordinate (b) at (c); | |
\pgfmathsetcounter{cntShader}{\thecntShader+4} | |
\setcounter{cntShader}{\thecntShader} | |
} | |
} | |
\node[fill=white,draw,circle,inner sep=1pt] at (0:1) {$\sqrt{1}$}; | |
\end{tikzpicture} | |
\end{document} |
Thanks for the cool script. Can you please explain how you selected the numbers 86, 38 and 15?
Hi, thank you for your reply... after both 15 and 38 full circles were drawn and I had to draw these afterwards on top because as far as I know layers are not supported. the 86 was the age of my grandfather whom I gave this as a birthday present.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the cool script. Can you please explain how you selected the numbers 86, 38 and 15?