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