-
Notifications
You must be signed in to change notification settings - Fork 26
/
animation-dynamic_labels.tex
49 lines (36 loc) · 1.32 KB
/
animation-dynamic_labels.tex
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
% https://tex.stackexchange.com/a/347917/173708
\documentclass[tikz]{standalone}
\usepackage{verbatim}
\begin{comment}
This example is a demonstration of an animation by creating a GIF file out of
a PDF file with several pages. Once the PDF file has been created with the
"pgfmathsetmacro" macor, convert the PDF file to a GIF.
Create the gif with:
convert -delay 0 -density 120 animation-dynamic_labels.pdf animation-dynamic_labels.gif
\end{comment}
\begin{document}
% this will produce the animation by creating 80 small PDF files
% later we will need to build the GIF file
\foreach {\tangle} in {80,79,...,10}{
\pgfmathsetmacro{\sangle}{-\tangle}
\begin{tikzpicture}[auto]
% constants
\def\rinn{2}
\def\rout{3.8}
% just to fix the global bounding box
\path circle[radius=\rout cm+5mm+2em];
\draw (0,0) circle [radius=\rinn];
\draw (0,0) circle [radius=\rout];
\coordinate (T1) at (\tangle:\rinn);
\coordinate (T2) at (\tangle:\rout);
\coordinate (S1) at (\sangle:\rinn);
\coordinate (S2) at (\sangle:\rout);
\draw (0,0) -- (T1) -- (T2);
\draw (0,0) -- (S1) -- (S2);
\path (T1) ++(\tangle+45:5mm) node{T1};
\path (T2) ++(\tangle+45:5mm) node{T2};
\path (S1) ++(\sangle-45:5mm) node{S1};
\path (S2) ++(\sangle-45:5mm) node{S2};
\end{tikzpicture}
}
\end{document}