| 1234567891011121314151617181920212223242526272829 |
- % A complete graph
- % Author: Quintin Jean-Noël
- % <http://moais.imag.fr/membres/jean-noel.quintin/>
- \documentclass[varwidth=true, border=2pt]{standalone}
- \usepackage[nomessages]{fp}% http://ctan.org/pkg/fp
- \usepackage{tikz}
- \usetikzlibrary[topaths]
- \begin{document}
- \newcommand\n{5}
- \begin{tikzpicture}
- %the multiplication with floats is not possible. Thus I split the loop in two.
- \foreach \number in {1,...,\n}{
- \node[vertex] (N-\number) at ({\number*(360/\n)}:5.4cm) {};
- }
- \foreach \number in {1,...,\n}{
- \foreach \y in {1,...,\n}{
- \draw (N-\number) -- (N-\y);
- }
- }
- \node[vertex,red] (N-3) at ({3*(360/\n)}:5.4cm) {};
- \node[vertex,red] (N-5) at ({5*(360/\n)}:5.4cm) {};
- \draw[green, ultra thick] (N-3) -- (N-5);
- \end{tikzpicture}
- \end{document}
|