graph-6.tex 710 B

12345678910111213141516171819202122232425
  1. % A complete graph
  2. % Author: Quintin Jean-Noël
  3. % <http://moais.imag.fr/membres/jean-noel.quintin/>
  4. \documentclass[varwidth=true, border=2pt]{standalone}
  5. \usepackage[nomessages]{fp}% http://ctan.org/pkg/fp
  6. \usepackage{tikz}
  7. \usetikzlibrary[topaths]
  8. \begin{document}
  9. \newcommand\n{5}
  10. \begin{tikzpicture}
  11. %the multiplication with floats is not possible. Thus I split the loop in two.
  12. \foreach \number in {1,...,\n}{
  13. \node[vertex] (N-\number) at ({\number*(360/\n)}:5.4cm) {};
  14. }
  15. \draw (N-1) -- (N-2);
  16. \draw (N-2) -- (N-3);
  17. \draw (N-3) -- (N-4);
  18. \draw (N-4) -- (N-5);
  19. \draw (N-5) -- (N-1);
  20. \end{tikzpicture}
  21. \end{document}