graph-6.tex 911 B

1234567891011121314151617181920212223242526272829
  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. \node[vertex,red] (N-1) at ({1*(360/\n)}:5.4cm) {};
  16. \node[vertex,red] (N-2) at ({2*(360/\n)}:5.4cm) {};
  17. \node[vertex,red] (N-5) at ({5*(360/\n)}:5.4cm) {};
  18. \draw (N-1) -- (N-2);
  19. \draw (N-2) -- (N-3);
  20. \draw[green, ultra thick] (N-3) -- (N-4);
  21. \draw (N-4) -- (N-5);
  22. \draw (N-5) -- (N-1);
  23. \end{tikzpicture}
  24. \end{document}