In the following code the last line in the loop (at the pretty end of the code)) seams not to do what it is supposed to do: to assign \angB
to \angA
:
\begin{tikzpicture}[scale=1]
\coordinate (o) at (0,0);
\draw[thick] (o) circle(1);
\path (o)+(270:1) coordinate (p1);
\path (o)+(90:1.2) coordinate (p2);
\draw[dotted] (p2) -- (p1);
\path (o)+(270:1) coordinate (q1);
\path (o)+(30:1) coordinate (q2);
\path (o)+(150:1) coordinate (q3);
\draw[] (q1) -- (q2);
\draw[] (q2) -- (q3);
\draw[] (q3) -- (q1);
\path (q1)+(90:0.8) coordinate (z);
\draw[->] (z) arc (90:60:0.8);
\path[above right] (z) node{$\theta$};
\path[below] (q1) node{$\theta=30^\circ$};
\begin{scope}[shift={(3,0)}]
\coordinate (o) at (0,0);
\draw[thick] (o) circle(1);
\path (o)+(270:1) coordinate (q1);
\pgfmathtruncatemacro{\angA}{270}
\pgfmathtruncatemacro{\t}{25}
\foreach \n in {0,...,100}
{
\pgfmathtruncatemacro{\angB}{\angA+180-2*\t}
\path (o)+({\angA}:1) coordinate (q1);
\path (o)+({\angB}:1) coordinate (q2);
\draw[] (q1) -- (q2);
\pgfmathtruncatemacro{\angA}{\angB}
}
\path[below] (q1) node{$\theta=\t^\circ$};
\end{scope}
\end{tikzpicture}
Result: the picture on the right should have much more lines:
EDIT Is there some sort of "step variable scope"? I noticed that q1
keeps its value although there are a lot of redefinitions of it in the loop.