Simple Line in LaTeX Help!

If you wish to produce such animated gifs, you may want to compile

\documentclass[border=1cm,tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\foreach \X in {180,175,...,90}
{\begin{tikzpicture}
\begin{scope}
\draw (0,0) circle (10cm);
\draw[line width=0.15cm, blue] (10,0) arc (0:360:10) ;
\draw[-] (-12,0) -- (12,0) node[right] {$x$};
\draw[-] (0,-12) -- (0,12) node[above] {$y$};
\draw[line width=0.15cm,red,{Circle}-{Circle},shorten >=-2*\pgflinewidth,shorten
<=-2*\pgflinewidth] (10,0) -- ++(\X:10);
\node[scale=15.5, red, right, opacity=0.5] at (2,2) {r};
\end{scope}
\end{tikzpicture}}
\end{document}

with pdflatex and then convert the resulting pdf with

convert -density 300 -delay 34 -loop 0 -alpha remove outfile.pdf ani.gif

to get

enter image description here

When you attempt to patch several of those together, you want to define some command which behaves similarly as the beamer command \only.

\documentclass[border=1cm,tikz]{standalone}
\usetikzlibrary{arrows.meta}
\def\Only<#1-#2>#3{\ifnum\numexpr\X+1>#1
\ifnum\numexpr\X-1<#2
\pgfmathtruncatemacro{\DeltaX}{\X+1-#1}
\xdef\DeltaX{\DeltaX}
#3
\fi\fi}
\begin{document}
\pgfmathtruncatemacro{\Xmax}{50}
\foreach \X in {0,1,...,\Xmax}
{\begin{tikzpicture}[fat line/.style={line width=0.15cm,red,{Circle}-{Circle},shorten >=-2*\pgflinewidth,shorten
<=-2*\pgflinewidth},cc/.style={line width=0.15cm,
blue},annot/.style={scale=15.5}]
\draw[-] (-12,0) -- (12,0) node[right] {$x$};
\draw[-] (0,-12) -- (0,12) node[above] {$y$};
%
\Only<2-5>{
\draw[fat line] (0,0) -- (2*\X,0);
}
\Only<6-10>{
\draw[fat line] (0,0) -- (10,0) node[midway,above,annot,red]{$r$};
}
\Only<11-25>{
\typeout{Delta=\DeltaX}
\draw[cc] (10,0) arc[start angle=0,end angle={\DeltaX*24},radius=10];
\draw[fat line] (0,0) -- ({\DeltaX*24}:10);
}
\Only<26-\Xmax>{
\draw[cc] circle[radius=10cm];
}
\Only<26-35>{\draw[fat line] (10,0)  -- ++ ({180-\DeltaX*9}:10);}
\Only<36-45>{\draw[fat line] (10,0) arc(0:{18*\DeltaX/pi}:10) -- ++
({18*\DeltaX/pi+90}:{10-\DeltaX});}
\Only<46-50>{
\draw [fill=green!70!black,fill opacity=0.2] (0,0) -- (3,0) 
node[green!70!black,below,annot,opacity=1]{rad} arc[start angle=0,
end angle={180/pi},radius=3] -- cycle;
\draw[cc,green!70!black] (10,0) -- (0,0) 
-- ({180/pi}:10);
}
\end{tikzpicture}}
\end{document}

enter image description here


A PSTricks solution only for fun purposes.

\documentclass[pstricks,border=12pt,12pt]{standalone}
\radians
\def\obj#1{%
\begin{pspicture}(-4,-4)(4,4)
    \pscircle{4}
    \psset{linecolor=red,linewidth=2\pslinewidth}
    \psarc(0,0){4}{0}{#1}
    \rput{#1}(4;#1){\psline(!0 1 #1 sub 4 mul)}
\end{pspicture}}
\begin{document}
    \foreach \i in {0,0.1,...,1.0}{\obj{\i}}
\end{document}

enter image description here