File: roundtri.tex

package info (click to toggle)
texlive-base 2012.20120611-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 403,288 kB
  • sloc: perl: 37,753; ruby: 4,714; sh: 4,212; makefile: 3,659; xml: 2,387; ansic: 1,731; python: 1,029; tcl: 631; awk: 603; cpp: 549; lisp: 428; java: 32; sed: 8
file content (37 lines) | stat: -rw-r--r-- 938 bytes parent folder | download | duplicates (9)
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}