# Simple Line in LaTeX Help!

I'm working in a project for university using LaTeX and I'll make a gif explaning the radians of math. And I really don't know how to make this type of line

What I have done so far

\documentclass[border=1cm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}

\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] (0,0) -- (10,-0);
\node[scale=15.5, red, right, opacity=0.5] at (2,2) {r};

\draw[red][fill] (0,0) circle (0.2cm);
\draw[red][fill] (10,-0) circle (0.2cm);

\end{scope}

\end{tikzpicture}

\end{document}

• But you get this type of line in your MWE? What do you want to achieve? The animation? – marmot Apr 21 at 3:24
• yes the frames for the animation, ill uploud my project to mediashare and can you see the result? – Felipe Fonseca Apr 21 at 3:25
• thats the pdf :D – Felipe Fonseca Apr 21 at 3:27

A PSTricks solution only for fun purposes.

\documentclass[pstricks,border=12pt,12pt]{standalone}
\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}


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

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[fat line] (0,0) -- ({\DeltaX*24}:10);
}
\Only<26-\Xmax>{
}
\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)