% --------------------------------------------------------------------------- % The butterfly curve is defined by the equation: % r=exp(cos(a))-2*cos(4*a)+sin^5(a/n). (we use n = 14) % --------------------------------------------------------------------------- \input preamble.tex \Defnum(\n,0) \newcount\m \newdimen\x \newdimen\y \newdimen\z % --------------------------------------------------------------------------- \begin{document} \begin{center} {\Huge \bf{The Butterfly Curve}} \bigskip \begin{lapdf}(16,16)(-7,-8) \col=6 \def\Px(#1,#2){\Dset(\x,#1) \y=4\x \z=0.0714\x \Cos(\Np\x,\x) \Exp(\Np\x,#2) \Cos(\Np\y,\y) \Mul(\y,2) \Sin(\Np\z,\z) \Pot(\Np\z,5,\z) \Sub(#2,\y) \Add(#2,\z) #2=2.2#2} \Whilenum{\n<24}{% \m=\n \Add(\m,1) \Stepcol(0,23, 2) \Pplot(100)(\n,\m) \Stroke \Add(\n,1)} \end{lapdf} $r(\phi)=exp(\cos(\phi))-2cos(4\phi)+sin^5(\phi/14)$ \end{center} \end{document}