I am trying to draw \nb lines from (0,0). All equally spaced.
I keep getting the error "Missing number treated as zero". I have found a lot of similar errors online; these are solved by enclosing the maths in {} curly brackets.
I have tried this but it still does not work. Does anybody know what my error is?
\begin{figure}[h]
\centering
\begin{tikzpicture}
\newcommand\ir{2}%Inner radius
\newcommand\nb{5}%Number of bars
\newcommand\tta{2*pi/\nb}
\foreach \i in {1,...,\nb} {
\newcommand\ctta{{cos(deg(\i*\tta))}}
\newcommand\stta{{sin(deg(\i*\tta))}}
\newcommand\ttta{{tan(deg(\i*\tta))}}
\newcommand\ltpcx{\ir*\ctta}
\newcommand\ltpcy{\ir*\stta}
\draw[] (0,0) -- (\ltpcx,\ltpcy);
}
\end{tikzpicture}
\caption{General structure of a Data Bank in a MIDAS event.}
\label{fig:BV_structure}
\end{figure}



\documentclass{...}, the required\usepackage's,\begin{document}, and\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – SebGlav Sep 09 '21 at 17:13