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
6
\usepackage{tikz}
7
\usetikzlibrary[topaths]
8
9
10
\begin{document}
11
12
% A counter, since TikZ is not clever enough (yet) to handle
13
% arbitrary angle systems.
14
\newcount\mycount
15
16
\tikzstyle{vertexs}=[draw,fill=black,circle,minimum size=4pt,inner sep=0pt]
17
18
\begin{tikzpicture}
19
%the multiplication with floats is not possible. Thus I split the loop in two.
20
\foreach \number in {1,...,8}{
21
% Computer angle:
22
\mycount=\number
23
\advance\mycount by -1
24
\multiply\mycount by 45
25
\advance\mycount by 0
26
\node[draw,circle,inner sep=0.25cm] (N-\number) at (\the\mycount:5.4cm) {};
27
}
28
\foreach \number in {9,...,16}{
29
% Computer angle:
30
\mycount=\number
31
\advance\mycount by -1
32
\multiply\mycount by 45
33
\advance\mycount by 22.5
34
\node[draw,circle,inner sep=0.25cm] (N-\number) at (\the\mycount:5.4cm) {};
35
}
36
\foreach \number in {1,...,15}{
37
\mycount=\number
38
\advance\mycount by 1
39
\foreach \numbera in {\the\mycount,...,16}{
40
\path (N-\number) edge[->,bend right=3] (N-\numbera) edge[<-,bend
41
left=3] (N-\numbera);
42
}
43
}
44
\end{tikzpicture}
45
\end{document}
46
47