Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132941 views
License: OTHER
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
9
10
\begin{document}
11
\newcommand\n{3}
12
\begin{tikzpicture}
13
%the multiplication with floats is not possible. Thus I split the loop in two.
14
\foreach \number in {1,...,\n}{
15
\node[vertex] (N-\number) at ({\number*(360/\n)}:5.4cm) {};
16
}
17
18
\foreach \number in {1,...,\n}{
19
\foreach \y in {1,...,\n}{
20
\draw (N-\number) -- (N-\y);
21
}
22
}
23
\end{tikzpicture}
24
\end{document}
25
26