summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/lapdf/cycloid.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-04 16:35:48 +0000
committerKarl Berry <karl@freefriends.org>2011-09-04 16:35:48 +0000
commit60b4ec6f2bf1ba57aa206b2ac46c454d75f3bf93 (patch)
treecbf61d6f8bd4a2c6ff62d5e7940e22c352757cfa /Master/texmf-dist/doc/latex/lapdf/cycloid.tex
parentd422465c9efb44dd32ba6a50f6ef9879bce018be (diff)
lapdf is back (2sep11)
git-svn-id: svn://tug.org/texlive/trunk@23806 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/lapdf/cycloid.tex')
-rw-r--r--Master/texmf-dist/doc/latex/lapdf/cycloid.tex61
1 files changed, 61 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/lapdf/cycloid.tex b/Master/texmf-dist/doc/latex/lapdf/cycloid.tex
new file mode 100644
index 00000000000..e868d76bede
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lapdf/cycloid.tex
@@ -0,0 +1,61 @@
+\input preamble.tex
+
+\Defnum(\n,2)
+\newdimen\x
+\newdimen\y
+\def\ds{\displaystyle}
+
+% -------------------------------------------------------------------------
+% 1. Epicycloid:
+% x(t)=r/(n+1)*[n*cos(t)-cos(n*t)]
+% y(t)=r/(n+1)*[n*sin(t)-sin(n*t)]
+% -------------------------------------------------------------------------
+\def\Epicycloid(#1,#2){\Dset(\y,#2) \Dset(\x,#1) \Dadd(\x,1) \Ddiv(\y,\x)
+ \def\Tx(##1,##2){\Cos(##1,##2) ##2=#1##2 \Dset(\x,##1) \x=#1\x
+ \Cos(\Np\x,\x) \Sub(##2,\x) \Dmul(##2,\y)}
+ \def\Ty(##1,##2){\Sin(##1,##2) ##2=#1##2 \Dset(\x,##1) \x=#1\x
+ \Sin(\Np\x,\x) \Sub(##2,\x) \Dmul(##2,\y)}
+ \Tplot(200)(0,6.2832)}
+
+% -------------------------------------------------------------------------
+% 2. Hypocycloid:
+% x(t)=r/(n+1)*[n*cos(t)+cos(n*t)]
+% y(t)=r/(n+1)*[n*sin(t)-sin(n*t)]
+% -------------------------------------------------------------------------
+\def\Hypocycloid(#1,#2){\Dset(\y,#2) \Dset(\x,#1) \Dadd(\x,1) \Ddiv(\y,\x)
+ \def\Tx(##1,##2){\Cos(##1,##2) ##2=#1##2 \Dset(\x,##1) \x=#1\x
+ \Cos(\Np\x,\x) \Add(##2,\x) \Dmul(##2,\y)}
+ \def\Ty(##1,##2){\Sin(##1,##2) ##2=#1##2 \Dset(\x,##1) \x=#1\x
+ \Sin(\Np\x,\x) \Sub(##2,\x) \Dmul(##2,\y)}
+ \Tplot(200)(0,6.2832)}
+
+% -------------------------------------------------------------------------
+\begin{document}
+\unitlength1.5cm
+
+\begin{center}
+{\Huge\bf{I. Epicycloids}}
+\bigskip
+
+\begin{lapdf}(12,12)(-6,-6)
+ \Polgrid(1,2)(6)
+ \Whilenum{\n<7}{\Stepcol(0,23,4) \Epicycloid(\n,6) \Stroke \Add(\n,1)}
+\end{lapdf}
+
+$x(t)=\frac{\ds r}{\ds{n+1}}[n\cos(t)-\cos(nt)]$ \qquad
+$y(t)=\frac{\ds r}{\ds{n+1}}[n\sin(t)-\sin(nt)]$
+\newpage
+
+{\Huge\bf{II. Hypocycloids}}
+\bigskip
+
+\begin{lapdf}(12,12)(-6,-6)
+ \Resetcol
+ \Polgrid(1,2)(6)
+ \Whilenum{\n<7}{\Stepcol(0,23,4) \Hypocycloid(\n,6) \Stroke \Add(\n,1)}
+\end{lapdf}
+
+$x(t)=\frac{\ds r}{\ds{n+1}}[n\cos(t)+\cos(nt)]$ \qquad
+$y(t)=\frac{\ds r}{\ds{n+1}}[n\sin(t)-\sin(nt)]$
+\end{center}
+\end{document}