# Picture indicating the fifth roots of unity

I would like to have the unit circle, centered at the origin, on the Cartesian plane drawn. The origin is to be marked with a dot and labeled "O" and five dots are to be drawn on the circle, one on the x-axis, and the others at k(2\pi/5) radians from the positive x-axis for each integer 1 \leq k < 5, and they are to be labeled "w_{k}". Arrows are to be drawn from the origin to each w_{k}, too. One angle is to be drawn and labeled - the one from the positive x-axis to the ray through w_{1}.

I have included some of the code. It starts with the following commands.

\tikzset{mydot/.style={fill,circle,inner sep=1.5pt}}


Is there a manual that explains each of these commands? I guess that this is instructing LaTeX how to make the dots indicating the coordinates each time "\mydot" is in the code.

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{newlfont}
\usepackage{mathtools}
\usepackage{tikz}

\tikzset{
mydot/.style={
fill,
circle,
inner sep=1.5pt
}
}

\begin{document}

\begin{tikzpicture}[>=latex]

% the coordinates of the vertices
\coordinate (O) at (0,0);
\coordinate (w_{1}) at (\cos(2\pi/5), \sin(2\pi/5));

% the axes
\draw[help lines,->] (-1.5,0) -- (1.5,0);
\draw[help lines,->] (0,-1.5) -- (0,1.5);

% labelling the vertices
\node[mydot,label={below:$O$}] at (O) {};
\node[mydot,label={right:$w_{1} = \bigl(\cos(2\pi/5), \sin(2\pi/5)\bigr)$}] at (w_{1}) {};

% the arcs for the angle
\begin{scope}[gray]
\draw[->]
(1,0) +(0:0.5cm) arc [radius=1cm,start angle=0,end angle=2\pi/5] node[midway,right] {$2\pi/5$};
\end{scope}

\end{tikzpicture}
\end{document}


To learn more about TikZ read pgfmanual.pdf. Via the macro \n you can adjust the order of the root to be taken.

\documentclass[tikz]{standalone}
\usepackage{amsmath}% for \Re and \Im
\def\n{5}
\begin{document}
\begin{tikzpicture}[
dot/.style={draw,fill,circle,inner sep=1pt}
]
\draw[->] (-2,0) -- (2,0) node[below] {$\Re$};
\draw[->] (0,-2) -- (0,2) node[left] {$\Im$};
\draw[help lines] (0,0) circle (1);

\node[dot,label={below right:$O$}] (O) at (0,0) {};
\foreach \i in {1,...,\n} {
\node[dot,label={\i*360/\n-(\i==\n)*45:$w_{\i}$}] (w\i) at (\i*360/\n:1) {};
\draw[->] (O) -- (w\i);
}
\draw[->] (0:.3) arc (0:360/\n:.3);
\node at (360/\n/2:.5) {$\alpha$};
\end{tikzpicture}
\end{document} For 1 < n < 13: • Shouldn't the labels w_2 and w_3 be placed symmetrically? They are conjugate, after all. Likewise for w_1 and w_4. – egreg Jul 26 '14 at 17:51
• @egreg Yes, you're right. I also was unsatisfied and looked up in the documentation how to write a Kronecker delta. Now the angle is computed by \i*360/5-(\i==5)*45. – Henri Menke Jul 26 '14 at 17:54
• +1 Now you have just to generalize it to the n-th roots for any n > 2. ;-) – egreg Jul 26 '14 at 17:57
• @egreg Done, but the label placement doesn't really work as expected, e.g. for the angle 270° the label isn't placed below the node. – Henri Menke Jul 26 '14 at 18:12
• @user143462 To get only fifth root change every occurrence of \n to 5 and remove \def\n{5}. In the argument of the tikzpicture I define a new style with the name dot. What it does is, it applies all options given in the braces to the path where I apply it. For a tutorial see section "2.8 Adding a Touch of Style", for the reference see section "82.4.4 Defining Styles" in the pgfmanual.pdf. – Henri Menke Jul 27 '14 at 17:50

Just for fun with PSTricks.

\documentclass[pstricks,border=24pt,12pt]{standalone}
\usepackage{pst-node,pst-plot}

\def\Object#1{%
\begin{pspicture}[saveNodeCoors,arrows=->](-2,-2)(2,2)
\pscircle{2}
\curvepnodes[plotpoints=\numexpr#1+1]{0}{360}{2 t PtoC}{w}
\multido{\i=0+1}{\wnodecount}{\psline(w\i)\uput[!N-w\i.y N-w\i.x atan](w\i){$w_{\i}$}}
\end{pspicture}}

\begin{document}
\foreach \n in{1,2,...,10}{\Object{\n}}
\end{document} With some additional notations

\documentclass[tikz]{standalone}
\usepackage{amsmath}% for \Re and \Im
\def\n{8}
\begin{document}
\begin{tikzpicture}[
dot/.style={draw,fill,circle,inner sep=1pt}
]
\draw[->] (-2,0) -- (2,0) node[below] {$\Re$};
\draw[->] (0,-2) -- (0,2) node[left] {$\Im$};
\draw[help lines] (0,0) circle (1);
\node[dot] (O) at (0,0) {};
\node[label={above right:$+i$}] (I1) at (0,1) {};
\node[label={below right:$-i$}] (I2) at (0,-1) {};
\node[label={above right:$1$}] (U1) at (1,0) {};
\node[dot,label={above right:$-1$}] (I2) at (-1,0) {};

\foreach \i in {1,...,\n} {

\node[dot,label={\i*360/\n-(\i==\n)*45:$w_{\i}$}] (w\i) at ( \i*360/\n:1)   {};
\draw[->] (O) -- (w\i);
}
\draw[->] (0:.3) arc (0:360/\n:.3);
\node at (360/\n/2:.5) {$\alpha$};
\end{tikzpicture}
\end{document} • I took the liberty of adding a picture. I'd also recommend not using \def\n{8}, but something like \newcommand{\lastnumber}{8} (or any other command name): with \def you risk redefining important commands, which could lead to puzzling errors or output. Just to be picky: \Re and \Im don't need amsmath, which is recommended anyway when math typesetting is involved. – egreg Sep 6 '15 at 22:00