summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lapdf/buttrfly.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/lapdf/buttrfly.tex')
-rw-r--r--macros/latex/contrib/lapdf/buttrfly.tex31
1 files changed, 31 insertions, 0 deletions
diff --git a/macros/latex/contrib/lapdf/buttrfly.tex b/macros/latex/contrib/lapdf/buttrfly.tex
new file mode 100644
index 0000000000..df8ea18e6d
--- /dev/null
+++ b/macros/latex/contrib/lapdf/buttrfly.tex
@@ -0,0 +1,31 @@
+% ---------------------------------------------------------------------------
+% 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}