summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lapdf/roundtri.tex
blob: 9d38ee35f09db5f2f879090c862e46be42e2beee (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
% ---------------------------------------------------------------------------
% Rounded Triangles:  x=a*exp(cos(t)), y =a*exp(sin(t))
% ---------------------------------------------------------------------------
\input preamble.tex

\Defdim(\a,1)
\newdimen\x
\newdimen\y

\def\Roundtriangle(#1,#2){
 \def\Tx(##1,##2){\Cos(##1,\x) \Pow(2,\Np\x,##2) \Dmul(##2,\a)
  ##2=#1##2}
 \def\Ty(##1,##2){\Sin(##1,\y) \Pow(2,\Np\y,##2) \Dmul(##2,\a)
  ##2=#2##2}
 \Tplot(100)(0,6.2832) \Stroke}

% ---------------------------------------------------------------------------
\begin{document}

\begin{center}
{\Huge\bf{Rounded Triangles}}
\bigskip

\begin{lapdf}(18,18)(-9,-9)
 \Lingrid(10)(1,2)(-9,9)(-9,9)
 \Whiledim{\a<5}{
  \Stepcol(0,23,2)
  \Roundtriangle(+1,+1)
  \Roundtriangle(-1,+1)
  \Roundtriangle(-1,-1)
  \Roundtriangle(+1,-1)
  \Dadd(\a,0.5)}
\end{lapdf}

$x=a \cdot 2^{\cos t}$ \qquad $y=a \cdot 2^{\sin t}$
\end{center}
\end{document}