summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/lapdf/trochoid.tex
blob: b76b527b4fec697fcd1a2c2ba93c0e9efdba468c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
\input preamble.tex

\Defnum(\n,0)
\Defdim(\m,-2.5)
\newdimen\x
\newdimen\y

% ---------------------------------------------------------------------------
% 1. Trochoids: In case of a=b the graph is a cycloid.
%    x(t)=a*t-b*sint
%    y(t)=a-b*cost
% ---------------------------------------------------------------------------
\def\Trochoid(#1,#2){
\def\Tx(##1,##2){\Dset(##2,##1) ##2=#1##2 \Sin(##1,\y) \y=#2\y \Sub(##2,\y)}
\def\Ty(##1,##2){\Dset(##2,#1) \Cos(##1,\y) \y=#2\y \Sub(##2,\y)}
\Tplot(200)(-6.2832,6.2832)}

% ---------------------------------------------------------------------------
% 2. Epitrochoid:
%    x(t)=a*cos(t)-b*cos(a/2*t)
%    y(t)=a*sin(t)-b*sin(a/2*t)
% ---------------------------------------------------------------------------
\def\Epitrochoid(#1,#2){\Dset(\x,#1) \x=0.5\x
 \def\Tx(##1,##2){\Cos(##1,##2) ##2=#1##2 \y=##1\x \Cos(\Np\y,\y) \y=#2\y \Sub(##2,\y) ##2=0.5##2}
 \def\Ty(##1,##2){\Sin(##1,##2) ##2=#1##2 \y=##1\x \Sin(\Np\y,\y) \y=#2\y \Sub(##2,\y) ##2=0.5##2}
 \Tplot(360)(0,12.5664)}

% ---------------------------------------------------------------------------
% 3. Hypotrochoid:
%    x(t)=a*cos(t)+b*cos(a/2*t)
%    y(t)=a*sin(t)-b*sin(a/2*t)
% ---------------------------------------------------------------------------
\def\Hypotrochoid(#1,#2){\Dset(\x,#1) \x=0.5\x
 \def\Tx(##1,##2){\Cos(##1,##2) ##2=#1##2 \y=##1\x \Cos(\Np\y,\y) \y=#2\y \Add(##2,\y) ##2=0.5##2}
 \def\Ty(##1,##2){\Sin(##1,##2) ##2=#1##2 \y=##1\x \Sin(\Np\y,\y) \y=#2\y \Sub(##2,\y) ##2=0.5##2}
 \Tplot(360)(0,12.5664)}

% ---------------------------------------------------------------------------
\begin{document}
\unitlength1.25cm

\begin{center}
{\Huge \bf{I. Trochoids}}
\bigskip

\begin{lapdf}(14,7)(-7,-2)
 \Lingrid(10)(0,2)(-7,7)(-2,4)
 \Whiledim{\m<3}{\Stepcol(0,23,4) \Trochoid(1,\Np\m) \Stroke \Dadd(\m,0.5)}
\end{lapdf}

$x(t)=a \cdot t - b\sin(t)$ \qquad$y(t)=a-b\cos(t)$

\newpage

{\Huge\bf{II. Epitrochoids}}
\bigskip

\begin{lapdf}(14,14)(-7,-7)
 \Polgrid(0,2)(7)
 \Whilenum{\n<6}{\Stepcol(0,23,4) \Epitrochoid(8,\n) \Stroke \Add(\n,1)}
\end{lapdf}

$x(t)=a\cos(t)-b\cos(a/2 \cdot t)$ \qquad $y(t)=a\sin(t)-b\sin(a/2 \cdot t)$

\newpage

{\Huge\bf{III. Hypotrochoids}}
\bigskip

\begin{lapdf}(14,14)(-7,-7)
 \Resetcol
 \Polgrid(0,2)(7)
 \Whilenum{\n<6}{\Stepcol(0,23,4) \Hypotrochoid(8,\n) \Stroke \Add(\n,1)}
\end{lapdf}

$x(t)=a\cos(t)+b\cos(a/2 \cdot t)$ \qquad $y(t)=a\sin(t)-b\sin(a/2 \cdot t)$
\end{center}
\end{document}