| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% % |
| 3 |
% tkz-berge.sty encodage : utf8 % |
| 4 |
% % |
| 5 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 6 |
% % |
| 7 |
% Créé par Alain Matthes le 08-05-2007. % |
| 8 |
% contribution : Rafael Villarroel 2007 (RV) % |
| 9 |
% contribution : Rafael Villarroel 2009 (RV) % |
| 10 |
% % |
| 11 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12 |
|
| 13 |
% modif Doyle form 1 |
| 14 |
% add \setkeys[GR]{edge}{#1}% in edge's macros |
| 15 |
% remove somme bugs with pgf 2.00 cvs |
| 16 |
|
| 17 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 18 |
%% Objet : Création de graphes classiques |
| 19 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 20 |
\NeedsTeXFormat{LaTeX2e} |
| 21 |
\ProvidesPackage{tkz-berge}[2011/06/01 2.00 tkz-berge for named graphs] |
| 22 |
|
| 23 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 24 |
\RequirePackage{tkz-graph} |
| 25 |
\def\tkzutil@empty{} |
| 26 |
\def\tkzutil@firstofone#1{#1} |
| 27 |
\def\tkzutil@firstoftwo#1#2{#1} |
| 28 |
\def\tkzutil@secondoftwo#1#2{#2} |
| 29 |
%<--------------------------------------------------------------------------–> |
| 30 |
\long\def\tkzutil@ifundefined#1{% |
| 31 |
\expandafter\ifx\csname#1\endcsname\relax |
| 32 |
\expandafter\tkzutil@firstoftwo |
| 33 |
\else |
| 34 |
\expandafter\tkzutil@secondoftwo |
| 35 |
\fi} |
| 36 |
%\input{tkz-tools-arith.tex} |
| 37 |
\tkzutil@ifundefined{pgfmath@function@isfactor}{% |
| 38 |
\pgfmathdeclarefunction{isfactor}{2}{% |
| 39 |
\begingroup |
| 40 |
\c@pgfmath@counta#1\relax% |
| 41 |
\c@pgfmath@countb#2\relax% |
| 42 |
\c@pgfmath@countc#1\relax% |
| 43 |
\divide\c@pgfmath@counta by\c@pgfmath@countb% |
| 44 |
\multiply\c@pgfmath@counta by\c@pgfmath@countb% |
| 45 |
\advance\c@pgfmath@countc by-\c@pgfmath@counta% |
| 46 |
\ifnum\c@pgfmath@countc=0 \def\pgfmathresult{1}% |
| 47 |
\else |
| 48 |
\def\pgfmathresult{0}% |
| 49 |
\fi |
| 50 |
\pgfmath@smuggleone\pgfmathresult% |
| 51 |
\endgroup} |
| 52 |
}{} |
| 53 |
|
| 54 |
|
| 55 |
\edef\tkzAtCode{\the\catcode`\@} |
| 56 |
\catcode`\@=11\relax |
| 57 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 58 |
\newcounter{tkz@bg@cnt} |
| 59 |
% NAMED GRAPHS |
| 60 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 61 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 62 |
% Graphes cls |
| 63 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 64 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 65 |
\define@cmdkey [GR] {cl} {L}{} |
| 66 |
\define@boolkey [GR] {cl} {Math}[true]{} |
| 67 |
\define@boolkey [GR] {cl} {inv}[true]{} |
| 68 |
\define@cmdkey [GR] {cl} {RA}{} |
| 69 |
\define@cmdkey [GR] {cl} {RB}{} |
| 70 |
\define@cmdkey [GR] {cl} {RC}{} |
| 71 |
\define@cmdkey [GR] {cl} {RD}{} |
| 72 |
\define@cmdkey [GR] {cl} {RE}{} |
| 73 |
\define@cmdkey [GR] {cl} {RS}{} |
| 74 |
\define@cmdkey [GR] {cl} {prefix}{} |
| 75 |
\define@cmdkey [GR] {cl} {prefixx}{} |
| 76 |
\define@cmdkey [GR] {cl} {prefixxx}{} |
| 77 |
\define@cmdkey [GR] {cl} {prefixxxx}{} |
| 78 |
\define@cmdkey [GR] {cl} {prefixxxxx}{} |
| 79 |
\define@cmdkey [GR] {cl} {form}{} |
| 80 |
\define@cmdkey [GR] {cl} {num}{} |
| 81 |
\define@cmdkey [GR] {cl} {rotation}{} |
| 82 |
\define@cmdkey [GR] {cl} {x}{} |
| 83 |
\define@cmdkey [GR] {cl} {y}{} |
| 84 |
\define@cmdkey [GR] {cl} {r}{} |
| 85 |
\define@cmdkey [GR] {cl} {d}{} |
| 86 |
\presetkeys [GR] {cl} {RA = 4, |
| 87 |
RB = 3, |
| 88 |
RC = 2, |
| 89 |
RD = 1, |
| 90 |
RE = 0.5, |
| 91 |
RS = 0, |
| 92 |
form = 1, |
| 93 |
prefix = a, |
| 94 |
prefixx = b, |
| 95 |
prefixxx = c, |
| 96 |
prefixxxx = d, |
| 97 |
prefixxxxx = e, |
| 98 |
num = {}, |
| 99 |
Math = false, |
| 100 |
x = 0, |
| 101 |
y = 0, |
| 102 |
r = 0, |
| 103 |
d = 0, |
| 104 |
rotation = 0}{} |
| 105 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 106 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 107 |
% Tools Graphes particuliers |
| 108 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 109 |
% Some tools |
| 110 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 111 |
\newcommand*{\grMathSep}{_} |
| 112 |
\newcommand*{\grLabelSep}{;} |
| 113 |
|
| 114 |
\newcommand*{\write@math}[3]{% |
| 115 |
\Vertex[x = #1,y = #2,% |
| 116 |
L = \cmdGR@cl@prefix\grMathSep{#3}]{\cmdGR@cl@prefix#3}} |
| 117 |
\newcommand*{\write@nomath}[3]{% |
| 118 |
\Vertex[x = #1,y = #2]{\cmdGR@cl@prefix#3}} |
| 119 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 120 |
% Empty graphs |
| 121 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 122 |
\newcommand*{\grEmptyCycle}{\@ifstar% |
| 123 |
\grEmptyCycleStar% |
| 124 |
\grEmptyCycleNoStar} |
| 125 |
\newcommand*{\grEmptyCycleNoStar}[2][]{% |
| 126 |
\begingroup% |
| 127 |
\setkeys[GR]{cl}{#1}% |
| 128 |
\pgfmathsetcounter{tkz@gr@p}{#2-1} |
| 129 |
\edef\tkz@auxctp{\thetkz@gr@p} |
| 130 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 131 |
\pgfmathparse{360/#2*\V@x+\cmdGR@cl@rotation} |
| 132 |
\let\tkz@angle\pgfmathresult% |
| 133 |
\pgfmathsetmacro{\x@result}{% |
| 134 |
\cmdGR@cl@RA*cos(\tkz@angle)+\cmdGR@cl@r*cos(\cmdGR@cl@d)} |
| 135 |
\pgfmathsetmacro{\y@result}{% |
| 136 |
\cmdGR@cl@RA*sin(\tkz@angle)+\cmdGR@cl@r*sin(\cmdGR@cl@d)} |
| 137 |
\ifGR@cl@Math% |
| 138 |
\presetkeys [GR] {vertex} {Math = true}{}% |
| 139 |
\Vertex[x = \x@result+\cmdGR@cl@x,% |
| 140 |
y = \y@result+\cmdGR@cl@y,% |
| 141 |
L = \cmdGR@cl@prefix\grMathSep{\V@x}]{\cmdGR@cl@prefix\V@x}% |
| 142 |
\else% |
| 143 |
\Vertex[x = \x@result+\cmdGR@cl@x,% |
| 144 |
y = \y@result+\cmdGR@cl@y]{\cmdGR@cl@prefix\V@x}% |
| 145 |
\fi% |
| 146 |
}% |
| 147 |
\endgroup% |
| 148 |
} |
| 149 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 150 |
\newcommand{\grEmptyCycleStar}[2][]{% |
| 151 |
\begingroup% |
| 152 |
\setkeys[GR]{cl}{#1}% |
| 153 |
\setcounter{tkz@gr@a}{0} |
| 154 |
\setcounter{tkz@gr@b}{0} |
| 155 |
\foreach \V@x in {#2}{\stepcounter{tkz@gr@b}{1}} |
| 156 |
\foreach \V@x in {#2}{% |
| 157 |
\pgfmathsetmacro{\x@result}{% |
| 158 |
\cmdGR@cl@RA*cos((360/\thetkz@gr@b)*\thetkz@gr@a+\cmdGR@cl@rotation)% |
| 159 |
+\cmdGR@cl@r*cos(\cmdGR@cl@d)% |
| 160 |
} |
| 161 |
\pgfmathsetmacro{\y@result}{% |
| 162 |
\cmdGR@cl@RA*sin((360/\thetkz@gr@b)*\thetkz@gr@a+\cmdGR@cl@rotation)% |
| 163 |
+\cmdGR@cl@r*sin(\cmdGR@cl@d)% |
| 164 |
} |
| 165 |
\ifGR@cl@Math% |
| 166 |
\Vertex[% |
| 167 |
x=\x@result+\cmdGR@cl@x, |
| 168 |
y=\y@result+\cmdGR@cl@y, |
| 169 |
L=$\V@x$]{\cmdGR@cl@prefix\thetkz@gr@a}% |
| 170 |
\else% |
| 171 |
\Vertex[% |
| 172 |
x=\x@result+\cmdGR@cl@x, |
| 173 |
y=\y@result+\cmdGR@cl@y, |
| 174 |
L=\V@x]{\cmdGR@cl@prefix\thetkz@gr@a}% |
| 175 |
\fi% |
| 176 |
\stepcounter{tkz@gr@a}% |
| 177 |
} |
| 178 |
\endgroup% |
| 179 |
} |
| 180 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 181 |
% grEmptyPath from (RV) |
| 182 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 183 |
\newcommand*{\grEmptyPath}{\@ifstar% |
| 184 |
\grEmptyPathStar% |
| 185 |
\grEmptyPathNoStar} |
| 186 |
\newcommand*{\grEmptyPathNoStar}[2][]{% |
| 187 |
\begingroup% |
| 188 |
\setkeys[GR]{cl}{#1}% |
| 189 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 190 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 191 |
\ifcase\cmdGR@cl@form |
| 192 |
\or |
| 193 |
\def\tkzb@result{0} |
| 194 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 195 |
\pgfmathsetmacro{\x@result}{\cmdGR@cl@RA*(\V@x)*cos(\cmdGR@cl@rotation)} |
| 196 |
\pgfmathsetmacro{\y@result}{\cmdGR@cl@RA*(\V@x)*sin(\cmdGR@cl@rotation)} |
| 197 |
\pgfmathsetmacro{\x@coord}{\x@result+\cmdGR@cl@x+\cmdGR@cl@r*cos(\cmdGR@cl@d)} |
| 198 |
\pgfmathsetmacro{\y@coord}{\y@result+\cmdGR@cl@y+ |
| 199 |
\cmdGR@cl@r*sin(\cmdGR@cl@d)+\cmdGR@cl@RS} |
| 200 |
\ifGR@cl@Math% |
| 201 |
\presetkeys [GR] {vertex} {Math = true}{}% |
| 202 |
\ifthenelse{\equal{\cmdGR@cl@num}{}}{% |
| 203 |
\write@math{\x@coord}{\y@coord}{\V@x}}{% |
| 204 |
\write@math{\x@coord}{\y@coord}{\V@x\grLabelSep\cmdGR@cl@num}}% |
| 205 |
\else |
| 206 |
\ifthenelse{\equal{\cmdGR@cl@num}{}}{% |
| 207 |
\write@nomath{\x@coord}{\y@coord}{\V@x}}{% |
| 208 |
\write@nomath{\x@coord+\cmdGR@cl@x}{\y@coord}{% |
| 209 |
\V@x\grLabelSep\cmdGR@cl@num}}% |
| 210 |
\fi}% |
| 211 |
\or |
| 212 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 213 |
\pgfmathsetmacro{\x@result}{% |
| 214 |
\cmdGR@cl@RA*(2*\V@x-\thetkz@gr@a)*0.5*cos(\cmdGR@cl@rotation)} |
| 215 |
\pgfmathsetmacro{\y@result}{% |
| 216 |
\cmdGR@cl@RA*(2*\V@x-\thetkz@gr@a)*0.5*sin(\cmdGR@cl@rotation)} |
| 217 |
\pgfmathsetmacro{\x@coord}{% |
| 218 |
\x@result+\cmdGR@cl@x+\cmdGR@cl@r*cos(\cmdGR@cl@d)} |
| 219 |
\pgfmathsetmacro{\y@coord}{% |
| 220 |
\y@result+\cmdGR@cl@y+\cmdGR@cl@r*sin(\cmdGR@cl@d)+\cmdGR@cl@RS} |
| 221 |
\ifGR@cl@Math% |
| 222 |
\presetkeys [GR] {vertex} {Math = true}{}% |
| 223 |
\ifthenelse{\equal{\cmdGR@cl@num}{}}{% |
| 224 |
\write@math{\x@coord}{\y@coord}{\V@x}}{% |
| 225 |
\write@math{\x@coord}{\y@coord}{\cmdGR@cl@num\grLabelSep\V@x}}% |
| 226 |
\else |
| 227 |
\ifthenelse{\equal{\cmdGR@cl@num}{}}{% |
| 228 |
\write@nomath{\x@coord}{\y@coord}{\V@x}}{% |
| 229 |
\write@nomath{\x@coord}{\y@coord}{\cmdGR@cl@num\grLabelSep\V@x}}% |
| 230 |
\fi |
| 231 |
}% |
| 232 |
\fi |
| 233 |
\endgroup% |
| 234 |
} |
| 235 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 236 |
\newcommand{\grEmptyPathStar}[2][]{% |
| 237 |
\begingroup% |
| 238 |
\setkeys[GR]{cl}{#1}% |
| 239 |
\setcounter{tkz@gr@a}{0} |
| 240 |
\ifcase\cmdGR@cl@form |
| 241 |
\or |
| 242 |
% form 1 |
| 243 |
\foreach \V@x in {#2}{% |
| 244 |
\pgfmathsetmacro{\x@result}{\cmdGR@cl@RA*\value{tkz@gr@a}*cos(\cmdGR@cl@rotation)% |
| 245 |
+\cmdGR@cl@r*cos(\cmdGR@cl@d)}% |
| 246 |
\pgfmathsetmacro{\y@result}{\cmdGR@cl@RA*\value{tkz@gr@a}*sin(\cmdGR@cl@rotation)% |
| 247 |
+\cmdGR@cl@r*sin(\cmdGR@cl@d)}% |
| 248 |
\ifGR@cl@Math% |
| 249 |
\Vertex[% |
| 250 |
x=\x@result+\cmdGR@cl@x, |
| 251 |
y=\y@result+\cmdGR@cl@y, |
| 252 |
L=$\V@x$]{\cmdGR@cl@prefix\thetkz@gr@a}% |
| 253 |
\else% |
| 254 |
\Vertex[% |
| 255 |
x=\x@result+\cmdGR@cl@x, |
| 256 |
y=\y@result+\cmdGR@cl@y, |
| 257 |
L=\V@x]{\cmdGR@cl@prefix\thetkz@gr@a}% |
| 258 |
\fi% |
| 259 |
\stepcounter{tkz@gr@a}% |
| 260 |
}% |
| 261 |
\or |
| 262 |
% form 2 |
| 263 |
\setcounter{tkz@gr@a}{0} |
| 264 |
\setcounter{tkz@gr@b}{0} |
| 265 |
\foreach \V@x in {#2}{\stepcounter{tkz@gr@b}{1}} |
| 266 |
\foreach \V@x in {#2}{% |
| 267 |
\pgfmathsetmacro{\x@result}{\cmdGR@cl@RA*(2*\value{tkz@gr@a}-\value{tkz@gr@b}+1)*0.5% |
| 268 |
*cos(\cmdGR@cl@rotation)% |
| 269 |
+\cmdGR@cl@r*cos(\cmdGR@cl@d)% |
| 270 |
} |
| 271 |
\pgfmathsetmacro{\y@result}{\cmdGR@cl@RA*(2*\value{tkz@gr@a}-\value{tkz@gr@b}+1)*0.5% |
| 272 |
*sin(\cmdGR@cl@rotation)% |
| 273 |
+\cmdGR@cl@r*sin(\cmdGR@cl@d)% |
| 274 |
} |
| 275 |
\ifGR@cl@Math% |
| 276 |
\Vertex[% |
| 277 |
x=\x@result+\cmdGR@cl@x, |
| 278 |
y=\y@result+\cmdGR@cl@y, |
| 279 |
L=$\V@x$]{\cmdGR@cl@prefix\thetkz@gr@a}% |
| 280 |
\else% |
| 281 |
\Vertex[% |
| 282 |
x=\x@result+\cmdGR@cl@x, |
| 283 |
y=\y@result+\cmdGR@cl@y, |
| 284 |
L=\V@x]{\cmdGR@cl@prefix\thetkz@gr@a}% |
| 285 |
\fi% |
| 286 |
\stepcounter{tkz@gr@a} |
| 287 |
} |
| 288 |
\fi |
| 289 |
\endgroup% |
| 290 |
} |
| 291 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 292 |
% grEmptyStar |
| 293 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 294 |
\newcommand*{\grEmptyStar}[2][]{% |
| 295 |
\begingroup% |
| 296 |
\setkeys[GR]{cl}{#1}% |
| 297 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 298 |
\ifGR@cl@Math\presetkeys [GR] {vertex} {Math = true}{}% |
| 299 |
\write@math{0}{0}{\thetkz@gr@a}% |
| 300 |
\else |
| 301 |
\write@nomath{0}{0}{\thetkz@gr@a}% |
| 302 |
\fi |
| 303 |
\grEmptyCycle[#1]{\thetkz@gr@a} |
| 304 |
\endgroup% |
| 305 |
} |
| 306 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 307 |
% grEmptyGrid |
| 308 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 309 |
\newcommand{\grEmptyGrid}[3][]{% |
| 310 |
\begingroup% |
| 311 |
\setkeys[GR]{cl}{#1}% |
| 312 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 313 |
\edef\tkz@auxctpa{\thetkz@gr@a} |
| 314 |
\pgfmathsetcounter{tkz@gr@b}{#3-1} |
| 315 |
\edef\tkz@auxctpb{\thetkz@gr@b} |
| 316 |
\foreach \V@x in {0,...,\tkz@auxctpa}{% |
| 317 |
\foreach \V@y in {0,...,\tkz@auxctpb}{% |
| 318 |
\ifGR@cl@Math\presetkeys [GR] {vertex} {Math = true}{}% |
| 319 |
\write@math{\cmdGR@cl@RA*\V@x}{\cmdGR@cl@RB*\V@y}{\V@x\grLabelSep\V@y}% |
| 320 |
\else |
| 321 |
\write@nomath{\cmdGR@cl@RA*\V@x}{\cmdGR@cl@RB*\V@y}{\V@x\grLabelSep\V@y}% |
| 322 |
\fi}% |
| 323 |
} |
| 324 |
\endgroup% |
| 325 |
} |
| 326 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 327 |
% grEmptyLadder |
| 328 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 329 |
\newcommand*{\grEmptyLadder}[2][]{% |
| 330 |
\begingroup% |
| 331 |
\setkeys[GR]{cl}{#1}% |
| 332 |
\grEmptyPath[#1,RS=0]{#2} |
| 333 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 334 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 335 |
\grEmptyPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} |
| 336 |
\endgroup% |
| 337 |
} |
| 338 |
|
| 339 |
|
| 340 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 341 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 342 |
% Edges |
| 343 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 344 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 345 |
\newcommand*{\EdgeInGraphFromOneToComp}[4][]{% #4 |
| 346 |
\begingroup% |
| 347 |
\setkeys[GR]{edge}{#1}% |
| 348 |
\pgfmathsetcounter{tkz@gr@ta}{#3-1} |
| 349 |
\edef\tkz@auxctp{\thetkz@gr@ta} |
| 350 |
\foreach \cx in {0,...,\tkz@auxctp}{% |
| 351 |
\ifthenelse{\equal{\cx}{#4}}{}{\Edge[#1](#2#4)(#2\cx)}% |
| 352 |
}% |
| 353 |
\endgroup% |
| 354 |
} |
| 355 |
|
| 356 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 357 |
% new tool EdgeInGraphLoop loop 0--1--2.........n--0 |
| 358 |
% star 0--1--2.........n- |
| 359 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 360 |
\newcommand*{\EdgeInGraphLoop}{\@ifstar% |
| 361 |
\EdgeInGraphLoopStar% |
| 362 |
\EdgeInGraphLoopNoStar} |
| 363 |
\newcommand*{\EdgeInGraphLoopNoStar}[3][]{% #4 |
| 364 |
\begingroup% |
| 365 |
\setkeys[GR]{edge}{#1}% |
| 366 |
\pgfmathsetcounter{tkz@gr@ta}{#3-1} |
| 367 |
\setcounter{tkz@gr@n}{0} |
| 368 |
\Edge[#1](#2\thetkz@gr@ta)(#2\thetkz@gr@n) |
| 369 |
\pgfmathaddtocounter{tkz@gr@ta}{-1} |
| 370 |
\edef\tkz@auxctp{\thetkz@gr@ta} |
| 371 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 372 |
\stepcounter{tkz@gr@n} |
| 373 |
\Edge[#1](#2\V@x)(#2\thetkz@gr@n)% |
| 374 |
}% |
| 375 |
\endgroup% |
| 376 |
} |
| 377 |
\newcommand*{\EdgeInGraphLoopStar}[3][]{% #4 |
| 378 |
\begingroup% |
| 379 |
\setkeys[GR]{edge}{#1}% |
| 380 |
\pgfmathsetcounter{tkz@gr@ta}{#3-2} |
| 381 |
\setcounter{tkz@gr@n}{0} |
| 382 |
\edef\tkz@auxctp{\thetkz@gr@ta} |
| 383 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 384 |
\stepcounter{tkz@gr@n} |
| 385 |
\Edge[#1](#2\V@x)(#2\thetkz@gr@n)% |
| 386 |
}% |
| 387 |
\endgroup% |
| 388 |
} |
| 389 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 390 |
% new tool EdgeInGraphMod replace nextmod |
| 391 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 392 |
\newcommand*{\EdgeInGraphMod}{\@ifstar% |
| 393 |
\EdgeInGraphModStar% |
| 394 |
\EdgeInGraphModNoStar} |
| 395 |
\newcommand*{\EdgeInGraphModNoStar}[4][]{% #2 order |
| 396 |
\begingroup% |
| 397 |
\setkeys[GR]{edge}{#1}% |
| 398 |
\pgfmathsetcounter{tkz@gr@ta}{#3-1} |
| 399 |
\edef\tkz@auxctp{\thetkz@gr@ta} |
| 400 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 401 |
\pgfmathsetcounter{tkz@gr@tb}{Mod(\V@x+#4,#3)} |
| 402 |
\Edge[#1](#2\thetkz@gr@tb)(#2\V@x)% |
| 403 |
}% |
| 404 |
\endgroup% |
| 405 |
} |
| 406 |
%#1 prefix #2 order #3 add #4 start #5 décalage |
| 407 |
\newcommand*{\EdgeInGraphModStar}[6][]{% |
| 408 |
\begingroup% |
| 409 |
\setkeys[GR]{edge}{#1}% |
| 410 |
\pgfmathsetcounter{tkz@gr@ta}{#5} |
| 411 |
\whiledo{\value{tkz@gr@ta}<#3}{% |
| 412 |
\pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@ta+#4,#3)} |
| 413 |
\Edge[#1](#2\thetkz@gr@ta)(#2\thetkz@gr@n) |
| 414 |
\pgfmathaddtocounter{tkz@gr@ta}{#6}% |
| 415 |
}% |
| 416 |
\endgroup% |
| 417 |
} |
| 418 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 419 |
% EdgeInGraphModLoop dep #4 add #3 mod #2 until #4 |
| 420 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 421 |
|
| 422 |
\newcommand*{\EdgeInGraphModLoop}[5][]{% #2 order |
| 423 |
\begingroup% |
| 424 |
\setkeys[GR]{edge}{#1}% |
| 425 |
\setcounter{tkz@gr@ta}{#5} |
| 426 |
\setcounter{tkz@gr@n}{#3} |
| 427 |
\whiledo{\not\equal{\value{tkz@gr@n}}{#5}}{% |
| 428 |
\pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@ta+#4,#3)} |
| 429 |
\Edge[#1](#2\thetkz@gr@ta)(#2\thetkz@gr@n)% |
| 430 |
\setcounter{tkz@gr@ta}{\thetkz@gr@n} |
| 431 |
}% |
| 432 |
\endgroup% |
| 433 |
} |
| 434 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 435 |
% EdgeIdentity |
| 436 |
% la version étoilée permet d'utliser une sélection |
| 437 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 438 |
\newcommand*{\EdgeIdentity}{\@ifstar% |
| 439 |
\EdgeIdentityStar% |
| 440 |
\EdgeIdentityNoStar} |
| 441 |
\newcommand*{\EdgeIdentityNoStar}[4][]{% |
| 442 |
\begingroup% |
| 443 |
\setkeys[GR]{edge}{#1}% |
| 444 |
\pgfmathsetcounter{tkz@gr@e}{#4-1} |
| 445 |
\edef\tkz@auxctp{\thetkz@gr@e} |
| 446 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 447 |
\Edge[#1](#2\V@x)(#3\V@x)% |
| 448 |
}% |
| 449 |
\endgroup% |
| 450 |
} |
| 451 |
\newcommand*{\EdgeIdentityStar}[4][]{% |
| 452 |
\begingroup% |
| 453 |
\setkeys[GR]{edge}{#1}% |
| 454 |
\foreach \V@x in {#4}{% |
| 455 |
\Edge[#1](#2\V@x)(#3\V@x)% |
| 456 |
}% |
| 457 |
\endgroup% |
| 458 |
} |
| 459 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 460 |
% EdgeFromOneToAll vertex #1#3 through #2 0...#2 n-1 #5 order of the graph |
| 461 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 462 |
\newcommand*{\EdgeFromOneToAll}[5][]{% #4 = order of the graph |
| 463 |
\begingroup% |
| 464 |
\setkeys[GR]{edge}{#1}% |
| 465 |
\pgfmathsetcounter{tkz@gr@e}{#5-1} |
| 466 |
\edef\tkz@auxctp{\thetkz@gr@e} |
| 467 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 468 |
\Edge[#1](#2#4)(#3\V@x)% |
| 469 |
}% |
| 470 |
\endgroup% |
| 471 |
} |
| 472 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 473 |
% EdgeFromOneToSeq vertex #1#3 through #2#4...#2#5 |
| 474 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 475 |
\newcommand*{\EdgeFromOneToSeq}[6][]{% #4 |
| 476 |
\begingroup% |
| 477 |
\setkeys[GR]{edge}{#1}% |
| 478 |
\foreach \V@x in {#5,...,#6}{% |
| 479 |
\Edge[#1](#2#4)(#3\V@x)% |
| 480 |
}% |
| 481 |
\endgroup% |
| 482 |
} %<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 483 |
% EdgeFromOneToSel vertex #1#3 through #2#4...#2#5 |
| 484 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 485 |
\newcommand*{\EdgeFromOneToSel}[5][]{% #4 |
| 486 |
\begingroup% |
| 487 |
\setkeys[GR]{edge}{#1}% |
| 488 |
\foreach \V@x in {#5}{% |
| 489 |
\Edge[#1](#2#4)(#3\V@x)% |
| 490 |
}% |
| 491 |
\endgroup% |
| 492 |
} |
| 493 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 494 |
% EdgeFromOneToComplement vertex #1#3 through #2#4...#2#5 |
| 495 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 496 |
\newcommand*{\EdgeFromOneToComp}[5][]{% |
| 497 |
\begingroup% |
| 498 |
\setkeys[GR]{edge}{#1}% |
| 499 |
\pgfmathsetcounter{tkz@gr@e}{#5-1} |
| 500 |
\edef\tkz@auxctp{\thetkz@gr@e} |
| 501 |
\foreach \cx in {0,...,\tkz@auxctp}{% |
| 502 |
\ifthenelse{\equal{\cx}{#4}}{}{\Edge[#1](#2#4)(#3\cx)}% |
| 503 |
}% |
| 504 |
\endgroup% |
| 505 |
} |
| 506 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 507 |
% new tool EdgeMod replace nextmod |
| 508 |
% identity with step like nextmod ??? |
| 509 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 510 |
\newcommand*{\EdgeMod}{\@ifstar% |
| 511 |
\EdgeModStar% |
| 512 |
\EdgeModNoStar} |
| 513 |
\newcommand*{\EdgeModNoStar}[5][]{%#3 order #4 step |
| 514 |
\begingroup% |
| 515 |
\setkeys[GR]{edge}{#1}% |
| 516 |
\pgfmathsetcounter{tkz@gr@e}{#4-1} |
| 517 |
\edef\tkz@auxctp{\thetkz@gr@e} |
| 518 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 519 |
\pgfmathsetcounter{tkz@gr@tb}{Mod(\V@x+#5,#4)} |
| 520 |
\Edge[#1](#2\V@x)(#3\thetkz@gr@tb)% |
| 521 |
}% |
| 522 |
\endgroup% |
| 523 |
} |
| 524 |
%#1 prefix #2 prefix #3 order #4 order inf #5 step |
| 525 |
\newcommand*{\EdgeModStar}[6][]{% |
| 526 |
\begingroup% |
| 527 |
\setkeys[GR]{edge}{#1}% |
| 528 |
\setcounter{tkz@gr@ta}{0} |
| 529 |
\whiledo{\value{tkz@gr@ta}<#4}{% |
| 530 |
\pgfmathsetcounter{tkz@gr@tb}{Mod(\thetkz@gr@ta+#5,#4)} |
| 531 |
\Edge[#1](#2\thetkz@gr@ta)(#3\thetkz@gr@tb)% |
| 532 |
\pgfmathaddtocounter{tkz@gr@ta}{#6}}% |
| 533 |
\endgroup% |
| 534 |
}% |
| 535 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 536 |
% new tool EdgeInGraphSeq sequence i--i+1--.....--j |
| 537 |
% or i--i+k--...--j |
| 538 |
% #1 options #2 graph #3 from #4 to |
| 539 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 540 |
\newcommand*{\EdgeInGraphSeq}[4][]{% #4 |
| 541 |
\begingroup% |
| 542 |
\setkeys[GR]{edge}{#1}% |
| 543 |
\foreach \V@x in {#3,...,#4}{% |
| 544 |
\pgfmathsetcounter{tkz@gr@n}{\V@x+1} |
| 545 |
\Edge[#1](#2\V@x)(#2\thetkz@gr@n)}% |
| 546 |
\endgroup% |
| 547 |
}% |
| 548 |
|
| 549 |
%%%%%%%%%%% NEW COMMANDS |
| 550 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 551 |
% new tool EdgeSeq sequence |
| 552 |
% #1 options #2 first graph #3 second graph #4 from #5 to |
| 553 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 554 |
\newcommand{\EdgeSequence}[5][]{% |
| 555 |
\begingroup% |
| 556 |
\setkeys[GR]{edge}{#1}% |
| 557 |
\foreach \V@x in {#4,...,#5}{% |
| 558 |
\pgfmathsetcounter{tkz@gr@n}{\V@x+1} |
| 559 |
\Edge[#1](#2\V@x)(#3\thetkz@gr@n)}% |
| 560 |
\endgroup% |
| 561 |
}% |
| 562 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 563 |
% EdgeDoubleMod by RV |
| 564 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 565 |
\newcommand*{\EdgeDoubleMod}[9]{% |
| 566 |
\begingroup% |
| 567 |
\foreach \V@x in {0,...,#9}{% |
| 568 |
\pgfmathsetcounter{tkz@gr@c}{Mod(#3+(#4*\V@x),#2)} |
| 569 |
\pgfmathsetcounter{tkz@gr@n}{Mod(#7+(#8*\V@x),#6)} |
| 570 |
\Edge(#1\thetkz@gr@c)(#5\thetkz@gr@n) |
| 571 |
}% |
| 572 |
\endgroup% |
| 573 |
} |
| 574 |
|
| 575 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 576 |
% grPath |
| 577 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 578 |
\newcommand*{\grPath}[2][]{% |
| 579 |
\begingroup% |
| 580 |
\setkeys[GR]{cl}{#1}% |
| 581 |
\grEmptyPath[#1]{#2} |
| 582 |
\ifthenelse{\equal{\cmdGR@cl@num}{}}{% |
| 583 |
\ifthenelse{\equal{#2}{1}}{}{% |
| 584 |
\EdgeInGraphLoop*{\cmdGR@cl@prefix}{#2}% |
| 585 |
}}{% |
| 586 |
\ifthenelse{\equal{#2}{1}}{}{% |
| 587 |
\ifcase\cmdGR@cl@form |
| 588 |
\or |
| 589 |
\pgfmathsetcounter{tkz@gr@ta}{#2-2} |
| 590 |
\setcounter{tkz@gr@n}{0} |
| 591 |
\edef\tkz@auxctp{\thetkz@gr@ta} |
| 592 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 593 |
\stepcounter{tkz@gr@n} |
| 594 |
\Edge(\cmdGR@cl@prefix\V@x\grLabelSep\cmdGR@cl@num)% |
| 595 |
(\cmdGR@cl@prefix\thetkz@gr@n\grLabelSep\cmdGR@cl@num)% |
| 596 |
}% |
| 597 |
\or |
| 598 |
\EdgeInGraphLoop*{\cmdGR@cl@prefix\cmdGR@cl@num\grLabelSep}{#2} |
| 599 |
\fi% |
| 600 |
}} |
| 601 |
\endgroup% |
| 602 |
} |
| 603 |
|
| 604 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 605 |
% grGrid |
| 606 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 607 |
\newcommand*{\grGrid}[3][]{% |
| 608 |
\begingroup% |
| 609 |
\setkeys[GR]{cl}{#1}% |
| 610 |
\grEmptyGrid[#1]{#2}{#3} |
| 611 |
\pgfmathsetcounter{tkz@gr@a}{#2-2} |
| 612 |
\edef\tkz@auxctpa{\thetkz@gr@a} |
| 613 |
\pgfmathsetcounter{tkz@gr@b}{#3-2} |
| 614 |
\edef\tkz@auxctpb{\thetkz@gr@b} |
| 615 |
\foreach \V@x in {0,...,\tkz@auxctpa}{% |
| 616 |
\foreach \V@y in {0,...,\tkz@auxctpb}{% |
| 617 |
\pgfmathsetcounter{tkz@gr@c}{\V@x+1} |
| 618 |
\pgfmathsetcounter{tkz@gr@d}{\V@y+1} |
| 619 |
\Edge(\cmdGR@cl@prefix\V@x\grLabelSep\V@y)% |
| 620 |
(\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@d) |
| 621 |
\Edge(\cmdGR@cl@prefix\V@x\grLabelSep\V@y)% |
| 622 |
(\cmdGR@cl@prefix\thetkz@gr@c\grLabelSep\V@y)% |
| 623 |
}% |
| 624 |
}% |
| 625 |
\pgfmathsetcounter{tkz@gr@a}{#2-2} |
| 626 |
\pgfmathsetcounter{tkz@gr@b}{#3-1} |
| 627 |
\edef\tkz@auxctpa{\thetkz@gr@a} |
| 628 |
\foreach \V@x in {0,...,\tkz@auxctpa}{% |
| 629 |
\pgfmathsetcounter{tkz@gr@c}{\V@x+1} |
| 630 |
\Edge(\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@b)% |
| 631 |
(\cmdGR@cl@prefix\thetkz@gr@c\grLabelSep\thetkz@gr@b)% |
| 632 |
}% |
| 633 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 634 |
\pgfmathsetcounter{tkz@gr@b}{#3-2} |
| 635 |
\edef\tkz@auxctpb{\thetkz@gr@b} |
| 636 |
\foreach \V@y in {0,...,\tkz@auxctpb}{% |
| 637 |
\pgfmathsetcounter{tkz@gr@d}{\V@y+1} |
| 638 |
\Edge(\cmdGR@cl@prefix\thetkz@gr@a\grLabelSep\V@y)% |
| 639 |
(\cmdGR@cl@prefix\thetkz@gr@a\grLabelSep\thetkz@gr@d)% |
| 640 |
}% |
| 641 |
\endgroup% |
| 642 |
} |
| 643 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 644 |
% grComplete |
| 645 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 646 |
\newcommand*{\grComplete}[2][]{% #1 options #2 ordre du graphe |
| 647 |
\begingroup% |
| 648 |
\setkeys[GR]{cl}{#1}% |
| 649 |
\grEmptyCycle[#1]{#2}% |
| 650 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 651 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 652 |
\foreach \ia in {0,...,\tkz@auxctp}% |
| 653 |
{\foreach \ib in {\ia,...,\tkz@auxctp} |
| 654 |
{\Edge(\cmdGR@cl@prefix\ia)(\cmdGR@cl@prefix\ib)}% |
| 655 |
}% |
| 656 |
\endgroup% |
| 657 |
} |
| 658 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 659 |
% grCycle |
| 660 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 661 |
\newcommand*{\grCycle}[2][]{% |
| 662 |
\begingroup% |
| 663 |
\setkeys[GR]{cl}{#1} |
| 664 |
\grEmptyCycle[#1]{#2} |
| 665 |
\EdgeInGraphLoop{\cmdGR@cl@prefix}{#2} |
| 666 |
\endgroup% |
| 667 |
} |
| 668 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 669 |
% grLCF |
| 670 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 671 |
\newcommand{\grLCF}[3][]{% |
| 672 |
\begingroup% |
| 673 |
\setkeys[GR]{cl}{#1}% |
| 674 |
\setcounter{tkz@gr@a}{#3} |
| 675 |
\setcounter{tkz@gr@b}{0} |
| 676 |
\foreach \V@x in {#2}{\stepcounter{tkz@gr@b}} |
| 677 |
\pgfmathsetcounter{tkz@gr@c}{\thetkz@gr@a * \thetkz@gr@b} |
| 678 |
\setcounter{tkz@gr@b}{\thetkz@gr@c} |
| 679 |
\grCycle[#1]{\thetkz@gr@c} |
| 680 |
%<––––––––––––––––––––––––– End Vertex ––––––––––––––––––––––––––––––––––––> |
| 681 |
\pgfmathsetcounter{tkz@gr@a}{#3-1} |
| 682 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 683 |
\setcounter{tkz@gr@e}{0} |
| 684 |
\foreach \V@k in {0,...,\tkz@auxctp}{% |
| 685 |
\foreach \n in {#2}{% |
| 686 |
\ifthenelse{\n < 0}{% |
| 687 |
\pgfmathsetcounter{tkz@gr@b}{\n+\thetkz@gr@c}}{% |
| 688 |
\pgfmathsetcounter{tkz@gr@b}{\n}} |
| 689 |
\pgfmathsetcounter{tkz@gr@n}% |
| 690 |
{Mod(\thetkz@gr@e+\thetkz@gr@b,\thetkz@gr@c)} |
| 691 |
\Edge(\cmdGR@cl@prefix\thetkz@gr@e)(\cmdGR@cl@prefix\thetkz@gr@n) |
| 692 |
\stepcounter{tkz@gr@e}% |
| 693 |
}% |
| 694 |
}% |
| 695 |
\endgroup% |
| 696 |
} |
| 697 |
|
| 698 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 699 |
% grStar |
| 700 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 701 |
\newcommand*{\grStar}[2][]{% |
| 702 |
\begingroup% |
| 703 |
\setkeys[GR]{cl}{#1}% |
| 704 |
\grEmptyStar[#1]{#2} |
| 705 |
\pgfmathsetcounter{tkz@gr@p}{#2-1} |
| 706 |
\EdgeInGraphFromOneToComp{\cmdGR@cl@prefix}{#2}{\thetkz@gr@p} |
| 707 |
\endgroup% |
| 708 |
} |
| 709 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 710 |
% grWheel |
| 711 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 712 |
\newcommand*{\grWheel}[2][]{ |
| 713 |
\begingroup% |
| 714 |
\setkeys[GR]{cl}{#1}% |
| 715 |
\grStar[#1]{#2} |
| 716 |
\pgfmathsetcounter{tkz@gr@e}{#2-1} |
| 717 |
\EdgeInGraphLoop{\cmdGR@cl@prefix}{\thetkz@gr@e} |
| 718 |
\endgroup% |
| 719 |
} |
| 720 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 721 |
% grSQCircle |
| 722 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 723 |
\newcommand*{\grSQCycle}[2][]{% |
| 724 |
\begingroup% |
| 725 |
\setkeys[GR]{cl}{#1}% |
| 726 |
\grCycle[#1]{#2}% |
| 727 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{#2}{2} |
| 728 |
\endgroup% |
| 729 |
} |
| 730 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 731 |
% grLadder |
| 732 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 733 |
\newcommand*{\grLadder}[2][]{% |
| 734 |
\begingroup% |
| 735 |
\setkeys[GR]{cl}{#1}% |
| 736 |
\grPath[#1,RS=0]{#2} |
| 737 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 738 |
\edef\tkzb@rtemp{\cmdGR@cl@RS} |
| 739 |
\grPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} |
| 740 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{#2} |
| 741 |
\endgroup% |
| 742 |
} |
| 743 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 744 |
% grPrism |
| 745 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 746 |
\newcommand*{\grPrism}[2][]{% |
| 747 |
\begingroup% |
| 748 |
\setkeys[GR]{cl}{#1}% |
| 749 |
\grCycle[#1]{#2} |
| 750 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 751 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 752 |
\grCycle[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{#2} |
| 753 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{#2} |
| 754 |
\endgroup% |
| 755 |
} |
| 756 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 757 |
% grCompleteBipartite |
| 758 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 759 |
\newcommand*{\grCompleteBipartite}[3][]{% |
| 760 |
\begingroup% |
| 761 |
\setkeys[GR]{cl}{#1}% |
| 762 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 763 |
\pgfmathparse{(\cmdGR@cl@RA * \thetkz@gr@a) /2} |
| 764 |
\let\tkzRAxpos\pgfmathresult% |
| 765 |
\pgfmathsetcounter{tkz@gr@a}{#3-1} |
| 766 |
\pgfmathparse{(\cmdGR@cl@RB * \thetkz@gr@a) /2} |
| 767 |
\let\tkzRBxpos\pgfmathresult% |
| 768 |
\ifdim\tkzRBxpos pt > \tkzRAxpos pt\relax% |
| 769 |
\pgfmathadd{\tkzRBxpos}{-\tkzRAxpos} |
| 770 |
\let\tkzaxpos\pgfmathresult% |
| 771 |
\def\tkzbxpos{0} |
| 772 |
\else% |
| 773 |
\pgfmathadd{\tkzRAxpos}{-\tkzRBxpos} |
| 774 |
\let\tkzbxpos\pgfmathresult% |
| 775 |
\def\tkzaxpos{0} |
| 776 |
\fi% |
| 777 |
\begin{scope}[xshift=\tkzaxpos cm] |
| 778 |
\grEmptyPath[#1,RS=0]{#2} |
| 779 |
\end{scope} |
| 780 |
\begin{scope}[xshift=\tkzbxpos cm] |
| 781 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 782 |
\edef\tkzb@rtemp{\cmdGR@cl@RS} |
| 783 |
\edef\tkzb@stemp{\cmdGR@cl@RB} |
| 784 |
\grEmptyPath[#1,RA=\tkzb@stemp,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#3} |
| 785 |
\end{scope} |
| 786 |
\pgfmathsetcounter{tkz@gr@p}{#2-1} |
| 787 |
\pgfmathsetcounter{tkz@gr@e}{#3-1} |
| 788 |
\edef\tkz@auxctp{\thetkz@gr@e} |
| 789 |
\foreach \cpx in {0,...,\tkz@auxctp}{% |
| 790 |
\EdgeFromOneToAll{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{\cpx}{#2} |
| 791 |
}% |
| 792 |
\endgroup% |
| 793 |
} |
| 794 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 795 |
% grTriangularGrid |
| 796 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 797 |
\newcommand*{\grTriangularGrid}[2][]{% |
| 798 |
\begingroup% |
| 799 |
\setkeys[GR]{cl}{#1} |
| 800 |
\ifcase\cmdGR@cl@form |
| 801 |
\or |
| 802 |
%<––––––––––––––––––––– form 1 equilateral triangle ––––––––––––––––––––––––> |
| 803 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 804 |
%\pgfmathsetcounter{tkz@gr@b}{#2} |
| 805 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 806 |
\foreach \lg in {0,...,\tkz@auxctp}{% |
| 807 |
\pgfmathsetcounter{tkz@gr@b}{#2-\lg} |
| 808 |
\setcounter{tkz@gr@b}{\thetkz@gr@b} |
| 809 |
\edef\tkzb@rtemp{\cmdGR@cl@RA} |
| 810 |
\edef\tkzb@ptemp{\cmdGR@cl@prefix} |
| 811 |
\pgfmathmultiply{\cmdGR@cl@RA}{\lg} |
| 812 |
\let\myresult\pgfmathresult |
| 813 |
\pgfmathparse{\cmdGR@cl@RA*\lg/2} |
| 814 |
\let\tkzaxpos\pgfmathresult |
| 815 |
\begin{scope}[xshift=\tkzaxpos cm] |
| 816 |
\grPath[#1,% |
| 817 |
RA = \tkzb@rtemp,% |
| 818 |
RS = \myresult,% |
| 819 |
prefix = \tkzb@ptemp,% |
| 820 |
num = \lg]{\thetkz@gr@b}% |
| 821 |
\end{scope}% |
| 822 |
} |
| 823 |
\or |
| 824 |
%<––––––––––––––––––––––––––– form 2 right triangle ––––––––––––––––––––––––> |
| 825 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 826 |
% \pgfmathsetcounter{tkz@gr@b}{#2} |
| 827 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 828 |
\foreach \lg in {0,...,\tkz@auxctp}{% |
| 829 |
\pgfmathsetcounter{tkz@gr@b}{#2-\lg} |
| 830 |
\setcounter{tkz@gr@b}{\thetkz@gr@b} |
| 831 |
\edef\tkzb@rtemp{\cmdGR@cl@RA} |
| 832 |
\edef\tkzb@ptemp{\cmdGR@cl@prefix} |
| 833 |
\pgfmathmultiply{\cmdGR@cl@RA}{\lg} |
| 834 |
\let\myresult\pgfmathresult |
| 835 |
\grPath[#1,% |
| 836 |
RA = \tkzb@rtemp,% |
| 837 |
RS = \myresult,% |
| 838 |
prefix = \tkzb@ptemp,% |
| 839 |
num = \lg,form=1]{\thetkz@gr@b}% |
| 840 |
} |
| 841 |
\or |
| 842 |
\pgfmathsetcounter{tkz@gr@a}{#2-1} |
| 843 |
\pgfmathsetcounter{tkz@gr@b}{#2} |
| 844 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 845 |
\foreach \lg in {0,...,\tkz@auxctp}{% |
| 846 |
\pgfmathsetcounter{tkz@gr@b}{#2-\lg} |
| 847 |
\setcounter{tkz@gr@b}{\thetkz@gr@b} |
| 848 |
\edef\tkzb@rtemp{\cmdGR@cl@RA} |
| 849 |
\edef\tkzb@ptemp{\cmdGR@cl@prefix} |
| 850 |
\pgfmathmultiply{\cmdGR@cl@RA}{\lg} |
| 851 |
\let\myresult\pgfmathresult |
| 852 |
\begin{scope}[xshift=\myresult cm] |
| 853 |
\grPath[#1,% |
| 854 |
RA = \tkzb@rtemp,% |
| 855 |
RS = \myresult,% |
| 856 |
prefix = \tkzb@ptemp,% |
| 857 |
num = \lg,form=1]{\thetkz@gr@b}% |
| 858 |
\end{scope}% |
| 859 |
} |
| 860 |
\fi% |
| 861 |
\pgfmathsetcounter{tkz@gr@a}{#2-2} |
| 862 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 863 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 864 |
\pgfmathsetcounter{tkz@gr@e}{\thetkz@gr@a-\V@x} |
| 865 |
\edef\tkz@auxctpb{\thetkz@gr@e} |
| 866 |
\foreach \V@y in {0,...,\tkz@auxctpb}{% |
| 867 |
\pgfmathsetcounter{tkz@gr@b}{\V@y+1} |
| 868 |
\Edge(\cmdGR@cl@prefix\V@x\grLabelSep\V@y)% |
| 869 |
(\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@b) |
| 870 |
\pgfmathsetcounter{tkz@gr@p}{\V@x+1} |
| 871 |
\Edge(\cmdGR@cl@prefix\V@x\grLabelSep\thetkz@gr@b)% |
| 872 |
(\cmdGR@cl@prefix\thetkz@gr@p\grLabelSep\V@y) |
| 873 |
}% |
| 874 |
} |
| 875 |
\endgroup% |
| 876 |
} |
| 877 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 878 |
% grHeawood |
| 879 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 880 |
\newcommand*{\grHeawood}[1][]{% #1 options #2 ordre du graphe |
| 881 |
\begingroup% |
| 882 |
\setkeys[GR]{cl}{#1}% |
| 883 |
\grCycle[#1]{14} |
| 884 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{14}{5}{0}{2} |
| 885 |
\endgroup% |
| 886 |
} |
| 887 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 888 |
% grCirculant #1 option #2 vertex #3 add k |
| 889 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 890 |
\newcommand*{\grCirculant}[3][]{% |
| 891 |
\begingroup% |
| 892 |
\setkeys[GR]{cl}{#1} |
| 893 |
\grEmptyCycle[#1]{#2}% |
| 894 |
\pgfmathisprime{#2}% |
| 895 |
\ifnum\pgfmathresult=1\relax |
| 896 |
\foreach \kci in {#3}{% |
| 897 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{#2}{\kci}}% |
| 898 |
\else |
| 899 |
\foreach \kci in {#3}{% |
| 900 |
\pgfmathisfactor{#2}{\kci}% |
| 901 |
\ifnum\pgfmathresult=1\relax |
| 902 |
\pgfmathsetcounter{tkz@gr@a}{\kci-1} |
| 903 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 904 |
\foreach \start in {0,...,\tkz@auxctp}{% |
| 905 |
\setcounter{tkz@gr@i}{\start}% |
| 906 |
\setcounter{tkz@gr@n}{#2}% |
| 907 |
\whiledo{\not\equal{\value{tkz@gr@n}}{\start}}{% |
| 908 |
\pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@i+\kci,#2)} |
| 909 |
\Edge(\cmdGR@cl@prefix\thetkz@gr@i)% |
| 910 |
(\cmdGR@cl@prefix\thetkz@gr@n)% |
| 911 |
\pgfmathsetcounter{tkz@gr@i}{\thetkz@gr@n}% |
| 912 |
}% |
| 913 |
}% |
| 914 |
\else |
| 915 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{#2}{\kci} |
| 916 |
\fi |
| 917 |
}% |
| 918 |
\fi |
| 919 |
\endgroup% |
| 920 |
} |
| 921 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 922 |
% grPetersenG |
| 923 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 924 |
\newcommand*{\grGeneralizedPetersen}[3][]{% |
| 925 |
\begingroup% |
| 926 |
\setkeys[GR]{cl}{#1}% |
| 927 |
\grCycle[#1]{#2} |
| 928 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 929 |
\edef\tkzb@pptemp{\cmdGR@cl@prefixx} |
| 930 |
\edef\tkzb@ptemp{\cmdGR@cl@prefix} |
| 931 |
\grCirculant[#1,RA=\tkzb@rtemp,prefix=\tkzb@pptemp]{#2}{#3} |
| 932 |
\EdgeIdentity{\tkzb@ptemp}{\cmdGR@cl@prefixx}{#2} |
| 933 |
\endgroup% |
| 934 |
} |
| 935 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 936 |
% grPetersen |
| 937 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 938 |
\newcommand*{\grStartwo}[2][]{% |
| 939 |
\begingroup% |
| 940 |
\setkeys[GR]{cl}{#1}% |
| 941 |
\pgfmathsetcounter{tkz@gr@e}{3*#2-2} |
| 942 |
\pgfmathsetcounter{tkz@gr@a}{3*#2-1} |
| 943 |
\grEmptyCycle[#1]{\thetkz@gr@a} |
| 944 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{\thetkz@gr@a}{#2}% |
| 945 |
\endgroup% |
| 946 |
} |
| 947 |
|
| 948 |
\newcommand*{\grPetersen}[1][]{% |
| 949 |
\begingroup% |
| 950 |
\setkeys[GR]{cl}{#1}% |
| 951 |
\ifcase\cmdGR@cl@form |
| 952 |
\or |
| 953 |
\grCycle[#1]{5}% |
| 954 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 955 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 956 |
\grStartwo[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{2} |
| 957 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{5} |
| 958 |
\or |
| 959 |
\grCycle[#1]{6} |
| 960 |
\begin{scope}[rotate=30] |
| 961 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 962 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 963 |
\grStar[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{4} |
| 964 |
\end{scope} |
| 965 |
\setcounter{tkz@gr@a}{2} |
| 966 |
\foreach \V@x in {0,...,5}{% |
| 967 |
\ifthenelse{\equal{\thetkz@gr@a}{-1}}{% |
| 968 |
\setcounter{tkz@gr@a}{2}}{% |
| 969 |
}% |
| 970 |
\Edge(\cmdGR@cl@prefix\V@x)(\cmdGR@cl@prefixx\thetkz@gr@a) |
| 971 |
\addtocounter{tkz@gr@a}{-1}% |
| 972 |
}% |
| 973 |
\or |
| 974 |
\grEmptyStar[#1]{10} |
| 975 |
\EdgeInGraphLoop{\cmdGR@cl@prefix}{9} |
| 976 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{9}{4}{0}{3} |
| 977 |
\foreach \V@x in {2,5,8}{% |
| 978 |
\Edge(\cmdGR@cl@prefix\V@x)(\cmdGR@cl@prefix 9)}% |
| 979 |
\fi |
| 980 |
\endgroup% |
| 981 |
} |
| 982 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 983 |
% grPlatonic |
| 984 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 985 |
\newcommand*{\grTetrahedral}[1][]{% |
| 986 |
\begingroup% |
| 987 |
\setkeys[GR]{cl}{#1}% |
| 988 |
\begin{scope}[rotate=90] |
| 989 |
\grWheel[#1]{4}% |
| 990 |
\end{scope} |
| 991 |
\endgroup% |
| 992 |
} |
| 993 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 994 |
% grOctahedral |
| 995 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 996 |
\newcommand*{\grOctahedral}[1][]{% |
| 997 |
\begingroup% |
| 998 |
\setkeys[GR]{cl}{#1}% |
| 999 |
\grComplete[#1]{3}% |
| 1000 |
\begin{scope}[rotate=-60] |
| 1001 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1002 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1003 |
\grComplete[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{3}% |
| 1004 |
\end{scope} |
| 1005 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{3} |
| 1006 |
\EdgeMod{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{3}{1} |
| 1007 |
\endgroup% |
| 1008 |
} |
| 1009 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1010 |
% grCubicalGraph |
| 1011 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1012 |
\newcommand*{\grCubicalGraph}[1][]{% |
| 1013 |
\begingroup% |
| 1014 |
\setkeys[GR]{cl}{#1}% |
| 1015 |
\grCycle[#1]{4} |
| 1016 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1017 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1018 |
\grCycle[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{4} |
| 1019 |
\ifcase\cmdGR@cl@form |
| 1020 |
\or |
| 1021 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{4} |
| 1022 |
\or |
| 1023 |
\EdgeMod*{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{4}{1}{2} |
| 1024 |
\EdgeMod*{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{4}{1}{2} |
| 1025 |
\fi |
| 1026 |
\endgroup% |
| 1027 |
} |
| 1028 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1029 |
% grIcosahedral |
| 1030 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1031 |
\newcommand*{\grIcosahedral}[1][]{% |
| 1032 |
\begingroup% |
| 1033 |
\setkeys[GR]{cl}{#1}% |
| 1034 |
\ifcase\cmdGR@cl@form |
| 1035 |
\or |
| 1036 |
\grCycle[#1]{6}% |
| 1037 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1038 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1039 |
\grCirculant[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{6}{2} |
| 1040 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{6} |
| 1041 |
\EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{6}{1} |
| 1042 |
\EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{6}{-1} |
| 1043 |
\or |
| 1044 |
\grCycle[#1]{3} |
| 1045 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1046 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1047 |
\grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{6}% |
| 1048 |
\begin{scope}[rotate=60] |
| 1049 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1050 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1051 |
\grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{3}% |
| 1052 |
\end{scope} |
| 1053 |
\setcounter{tkz@gr@a}{2} |
| 1054 |
\foreach \st in {5,0,1}{% |
| 1055 |
\foreach \v in {0,1,2}{% |
| 1056 |
\pgfmathsetcounter{tkz@gr@n}{Mod((\thetkz@gr@a*\v)+\st,6)}% |
| 1057 |
\Edge(\cmdGR@cl@prefix\v)(\cmdGR@cl@prefixx\thetkz@gr@n) |
| 1058 |
}% |
| 1059 |
}% |
| 1060 |
\setcounter{tkz@gr@a}{2} |
| 1061 |
\foreach \v in {0,1,2}{% |
| 1062 |
\foreach \st in {0,1,2}{% |
| 1063 |
\pgfmathsetcounter{tkz@gr@n}{Mod(\thetkz@gr@a*\v+\st,6)}% |
| 1064 |
\Edge(\cmdGR@cl@prefixxx\v)(\cmdGR@cl@prefixx\thetkz@gr@n) |
| 1065 |
}% |
| 1066 |
}% |
| 1067 |
\fi |
| 1068 |
\endgroup% |
| 1069 |
} |
| 1070 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1071 |
% grDodecahedral |
| 1072 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1073 |
\newcommand*{\grDodecahedral}[1][]{% |
| 1074 |
\begingroup% |
| 1075 |
\setkeys[GR]{cl}{#1}% |
| 1076 |
\ifcase\cmdGR@cl@form |
| 1077 |
\or |
| 1078 |
\grCycle[#1]{10} |
| 1079 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1080 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1081 |
\grCirculant[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{10}{2} |
| 1082 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{10} |
| 1083 |
\or |
| 1084 |
\grCycle[#1]{5} |
| 1085 |
\begin{scope}[rotate=36] |
| 1086 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1087 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1088 |
\grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5} |
| 1089 |
\end{scope} |
| 1090 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1091 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1092 |
\grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5} |
| 1093 |
\begin{scope}[rotate=36] |
| 1094 |
\edef\tkzb@rtemp{\cmdGR@cl@RD} |
| 1095 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxxx} |
| 1096 |
\grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5}% |
| 1097 |
\end{scope} |
| 1098 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{5} |
| 1099 |
\EdgeIdentity{\cmdGR@cl@prefixxx}{\cmdGR@cl@prefixxxx}{5} |
| 1100 |
\EdgeIdentity{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxx}{5} |
| 1101 |
\EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxx}{5}{-1} |
| 1102 |
\or |
| 1103 |
\grCycle[#1]{5} |
| 1104 |
\begin{scope}[rotate=36] |
| 1105 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1106 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1107 |
\grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{5} |
| 1108 |
\end{scope} |
| 1109 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1110 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1111 |
\grCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{10} |
| 1112 |
\EdgeInGraphLoop{\cmdGR@cl@prefixxx}{5} |
| 1113 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{5}{0}{1}% |
| 1114 |
{\cmdGR@cl@prefixx}{10}{0}{2}{5} |
| 1115 |
\EdgeDoubleMod{\cmdGR@cl@prefixxx}{5}{0}{1}% |
| 1116 |
{\cmdGR@cl@prefixx}{10}{1}{2}{5} |
| 1117 |
\or |
| 1118 |
\grLCF[#1]{10,7,4,-4,-7,10,-4,7,-7,4}{2} |
| 1119 |
\or |
| 1120 |
\grCycle[#1]{10} |
| 1121 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1122 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1123 |
\grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{6} |
| 1124 |
\begin{scope}[rotate=45] |
| 1125 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1126 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1127 |
\grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{4}% |
| 1128 |
\end{scope} |
| 1129 |
\setcounter{tkz@gr@a}{0} |
| 1130 |
\foreach \v in {1,4,6,9}{% |
| 1131 |
\Edge(\cmdGR@cl@prefix\v)(\cmdGR@cl@prefixxx\thetkz@gr@a) |
| 1132 |
\stepcounter{tkz@gr@a} |
| 1133 |
}% |
| 1134 |
\setcounter{tkz@gr@a}{0} |
| 1135 |
\foreach \v in {2,1,5,4}{% |
| 1136 |
\Edge(\cmdGR@cl@prefixx\v)(\cmdGR@cl@prefixxx\thetkz@gr@a) |
| 1137 |
\stepcounter{tkz@gr@a} |
| 1138 |
}% |
| 1139 |
\setcounter{tkz@gr@a}{0} |
| 1140 |
\foreach \v in {0,2,3,5,7,8}{% |
| 1141 |
\Edge(\cmdGR@cl@prefix\v)(\cmdGR@cl@prefixx\thetkz@gr@a) |
| 1142 |
\stepcounter{tkz@gr@a} |
| 1143 |
}% |
| 1144 |
\Edge(\cmdGR@cl@prefixxx0)(\cmdGR@cl@prefixxx3) |
| 1145 |
\Edge(\cmdGR@cl@prefixxx1)(\cmdGR@cl@prefixxx2) |
| 1146 |
\Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefixx1) |
| 1147 |
\Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefixx5) |
| 1148 |
\Edge(\cmdGR@cl@prefixx3)(\cmdGR@cl@prefixx2) |
| 1149 |
\Edge(\cmdGR@cl@prefixx3)(\cmdGR@cl@prefixx4) |
| 1150 |
\fi |
| 1151 |
\endgroup% |
| 1152 |
} |
| 1153 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1154 |
% grMobiusKantor |
| 1155 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1156 |
\newcommand*{\grMobiusKantor}[1][]{% #1 options #2 ordre du graphe |
| 1157 |
\begingroup% |
| 1158 |
\setkeys[GR]{cl}{#1} |
| 1159 |
\ifcase\cmdGR@cl@form |
| 1160 |
\or |
| 1161 |
\grCycle[#1]{16} |
| 1162 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{16}{5}{0}{2} |
| 1163 |
\or |
| 1164 |
\grCycle[#1]{8} |
| 1165 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1166 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1167 |
\grCirculant[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{8}{3} |
| 1168 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{8} |
| 1169 |
\or |
| 1170 |
\grCirculant[#1]{8}{3} |
| 1171 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1172 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1173 |
\grCycle[#1,RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{8} |
| 1174 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{8} |
| 1175 |
\fi |
| 1176 |
\endgroup% |
| 1177 |
} |
| 1178 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1179 |
% grMoebiusLadder |
| 1180 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1181 |
\newcommand*{\grMobiusLadder}[2][]{% |
| 1182 |
\begingroup% |
| 1183 |
\setkeys[GR]{cl}{#1} |
| 1184 |
\grEmptyCycle[#1]{#2} |
| 1185 |
\pgfmathsetcounter{tkz@gr@p}{#2-1} |
| 1186 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1187 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1188 |
\grEmptyCycle[RA=\tkzb@rtemp,prefix=\tkzb@ptemp]{#2}% |
| 1189 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{#2} |
| 1190 |
\EdgeInGraphLoop*{\cmdGR@cl@prefix}{#2} |
| 1191 |
\EdgeInGraphLoop*{\cmdGR@cl@prefixx}{#2} |
| 1192 |
\Edge(\cmdGR@cl@prefix0)(\cmdGR@cl@prefixx\thetkz@gr@p) |
| 1193 |
\Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefix\thetkz@gr@p) |
| 1194 |
\endgroup% |
| 1195 |
} |
| 1196 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1197 |
% grCocktailParty |
| 1198 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1199 |
\newcommand*{\grCocktailParty}[2][]{% |
| 1200 |
\begingroup% |
| 1201 |
\setkeys[GR]{cl}{#1}% |
| 1202 |
\pgfmathsetcounter{tkz@gr@p}{#2-1} |
| 1203 |
\grPath[#1,RS=0]{#2} |
| 1204 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1205 |
\edef\tkzb@rtemp{\cmdGR@cl@RS} |
| 1206 |
\grPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} |
| 1207 |
\edef\tkz@auxctp{\thetkz@gr@p} |
| 1208 |
\foreach \cpx in {0,...,\tkz@auxctp}{% |
| 1209 |
\EdgeFromOneToComp{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{\cpx}{#2} |
| 1210 |
} |
| 1211 |
\endgroup% |
| 1212 |
} |
| 1213 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1214 |
% grCrown |
| 1215 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1216 |
\newcommand*{\grCrown}[2][]{% |
| 1217 |
\begingroup% |
| 1218 |
\setkeys[GR]{cl}{#1}% |
| 1219 |
\pgfmathsetcounter{tkz@gr@p}{#2-1} |
| 1220 |
\grEmptyPath[#1,RS=0]{#2} |
| 1221 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1222 |
\edef\tkzb@rtemp{\cmdGR@cl@RS} |
| 1223 |
\grEmptyPath[#1,prefix=\tkzb@ptemp,RS=\tkzb@rtemp]{#2} |
| 1224 |
\edef\tkz@auxctp{\thetkz@gr@p} |
| 1225 |
\foreach \cpx in {0,...,\thetkz@gr@p}{% |
| 1226 |
\EdgeFromOneToComp{\cmdGR@cl@prefix}{\cmdGR@cl@prefixx}{\cpx}{#2} |
| 1227 |
} |
| 1228 |
\endgroup% |
| 1229 |
} |
| 1230 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1231 |
% grMcGee |
| 1232 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1233 |
\newcommand*{\grMcGee}[1][]{% |
| 1234 |
\begingroup% |
| 1235 |
\setkeys[GR]{cl}{#1}% |
| 1236 |
\grLCF[#1]{-12,7,-7}{8} |
| 1237 |
\endgroup% |
| 1238 |
} |
| 1239 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1240 |
% grRobertson |
| 1241 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1242 |
\newcommand*{\grRobertson}[1][]{% |
| 1243 |
\begingroup% |
| 1244 |
\setkeys[GR]{cl}{#1}% |
| 1245 |
\grLCF[#1]{8,4,7,4,8,5,7,4,7,8,4,5,7,8,4,8,4,8,4}{1} |
| 1246 |
\endgroup% |
| 1247 |
} |
| 1248 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1249 |
% grRobertsonWegner |
| 1250 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1251 |
\newcommand*{\grRobertsonWegner}[1][]{% |
| 1252 |
\begingroup% |
| 1253 |
\setkeys[GR]{cl}{#1}% |
| 1254 |
\grLCF[#1]{6,12}{15} |
| 1255 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{30}{9}{1}{6} |
| 1256 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{15}{2}{6} |
| 1257 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{9}{3}{6} |
| 1258 |
\endgroup% |
| 1259 |
} |
| 1260 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1261 |
% grDoyle |
| 1262 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1263 |
\newcommand*{\grDoyle}[1][]{% |
| 1264 |
\begingroup% |
| 1265 |
\setkeys[GR]{cl}{#1}% |
| 1266 |
\ifcase\cmdGR@cl@form |
| 1267 |
\or |
| 1268 |
\grCycle[#1]{9} |
| 1269 |
\begin{scope}[rotate=18] |
| 1270 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1271 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1272 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{9}{2} |
| 1273 |
\end{scope} |
| 1274 |
\EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{9}{1} |
| 1275 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1276 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1277 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{9}{4} |
| 1278 |
\EdgeIdentity{\cmdGR@cl@prefix}{\cmdGR@cl@prefixxx}{9} |
| 1279 |
\EdgeMod{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxx}{9}{1} |
| 1280 |
\or |
| 1281 |
\grCycle[#1]{27} |
| 1282 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{0}{3} |
| 1283 |
{\cmdGR@cl@prefix}{27}{13}{3}{9} |
| 1284 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{1}{3} |
| 1285 |
{\cmdGR@cl@prefix}{27}{5}{3}{9} |
| 1286 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{0}{3} |
| 1287 |
{\cmdGR@cl@prefix}{27}{20}{3}{9} |
| 1288 |
\or |
| 1289 |
\grCycle[#1]{27} |
| 1290 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{17}{1} |
| 1291 |
{\cmdGR@cl@prefix}{27}{10}{-2}{4} |
| 1292 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{26}{1} |
| 1293 |
{\cmdGR@cl@prefix}{27}{19}{-2}{4} |
| 1294 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{8}{1} |
| 1295 |
{\cmdGR@cl@prefix}{27}{1}{-2}{4} |
| 1296 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{4}{1} |
| 1297 |
{\cmdGR@cl@prefix}{27}{27}{-2}{3} |
| 1298 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{8}{1} |
| 1299 |
{\cmdGR@cl@prefix}{27}{1}{-2}{4} |
| 1300 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{14}{1} |
| 1301 |
{\cmdGR@cl@prefix}{27}{7}{-2}{2} |
| 1302 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{27}{23}{1} |
| 1303 |
{\cmdGR@cl@prefix}{27}{16}{-2}{2} |
| 1304 |
\Edge(\cmdGR@cl@prefix9)(\cmdGR@cl@prefix13)% |
| 1305 |
\Edge(\cmdGR@cl@prefix18)(\cmdGR@cl@prefix22)% |
| 1306 |
\fi |
| 1307 |
\endgroup% |
| 1308 |
} |
| 1309 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1310 |
% grDesargues |
| 1311 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1312 |
\newcommand*{\grDesargues}[1][]{% |
| 1313 |
\begingroup% |
| 1314 |
\setkeys[GR]{cl}{#1}% |
| 1315 |
\ifcase\cmdGR@cl@form |
| 1316 |
\or |
| 1317 |
\grLCF[#1]{5,-5,9,-9}{5} |
| 1318 |
\or |
| 1319 |
\grGeneralizedPetersen[#1]{10}{3} |
| 1320 |
\fi |
| 1321 |
\endgroup% |
| 1322 |
} |
| 1323 |
|
| 1324 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1325 |
% grKonisberg |
| 1326 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1327 |
% #1 prefix #2 indice #2 prefix #3 indice choisie entre #4 et #5 ... |
| 1328 |
\newcommand{\grKonisberg}[1][]{% |
| 1329 |
\begingroup% |
| 1330 |
\setkeys[GR]{cl}{#1}% |
| 1331 |
\grCycle[#1]{4} |
| 1332 |
\Edge[style={bend left}](\cmdGR@cl@prefix1)(\cmdGR@cl@prefix2) |
| 1333 |
\Edge[style={bend left}](\cmdGR@cl@prefix2)(\cmdGR@cl@prefix3) |
| 1334 |
\Edge(\cmdGR@cl@prefix0)(\cmdGR@cl@prefix2) |
| 1335 |
\endgroup% |
| 1336 |
} |
| 1337 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1338 |
% grWong |
| 1339 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1340 |
|
| 1341 |
\newcommand{\grWong}[1][]{% |
| 1342 |
\begingroup% |
| 1343 |
\setkeys[GR]{cl}{#1}% |
| 1344 |
\grLCF[#1]{8,4,12,4,8,4}{5} |
| 1345 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{15}{0}{3} |
| 1346 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{16}{1}{6} |
| 1347 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{30}{18}{4}{6} |
| 1348 |
\endgroup% |
| 1349 |
} |
| 1350 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1351 |
% grTutte |
| 1352 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1353 |
|
| 1354 |
\newcommand{\grTutteCoxeter}[1][]{% |
| 1355 |
\begingroup% |
| 1356 |
\setkeys[GR]{cl}{#1}% |
| 1357 |
\grLCF[#1]{-13,-9,7,-7,9,13}{5} |
| 1358 |
\endgroup% |
| 1359 |
} |
| 1360 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1361 |
% grFoster |
| 1362 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1363 |
|
| 1364 |
\newcommand{\grFoster}[1][]{% |
| 1365 |
\begingroup% |
| 1366 |
\setkeys[GR]{cl}{#1}% |
| 1367 |
\grLCF[#1]{17,-9,37,-37,9,-17}{15} |
| 1368 |
\endgroup% |
| 1369 |
} |
| 1370 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1371 |
% grFolkman |
| 1372 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1373 |
|
| 1374 |
\newcommand{\grFolkman}[1][]{% |
| 1375 |
\begingroup% |
| 1376 |
\setkeys[GR]{cl}{#1}% |
| 1377 |
\grLCF[#1]{5,-7,-7,5}{5} |
| 1378 |
\endgroup% |
| 1379 |
} |
| 1380 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1381 |
% grFranklin |
| 1382 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1383 |
|
| 1384 |
\newcommand{\grFranklin}[1][]{% |
| 1385 |
\begingroup% |
| 1386 |
\setkeys[GR]{cl}{#1}% |
| 1387 |
\grLCF[#1]{5,-5}{6} |
| 1388 |
\endgroup% |
| 1389 |
} |
| 1390 |
|
| 1391 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1392 |
% grNauru |
| 1393 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1394 |
|
| 1395 |
\newcommand{\grNauru}[1][]{% |
| 1396 |
\begingroup% |
| 1397 |
\setkeys[GR]{cl}{#1}% |
| 1398 |
\grLCF[#1]{5, −9, 7, −7, 9, −5}{4} |
| 1399 |
\endgroup% |
| 1400 |
} |
| 1401 |
|
| 1402 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1403 |
% grDick |
| 1404 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1405 |
|
| 1406 |
\newcommand{\grDick}[1][]{% |
| 1407 |
\begingroup% |
| 1408 |
\setkeys[GR]{cl}{#1}% |
| 1409 |
\grLCF[#1]{5,-5,13,-13}{8} |
| 1410 |
\endgroup% |
| 1411 |
} |
| 1412 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1413 |
% grHarries |
| 1414 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1415 |
|
| 1416 |
\newcommand{\grHarries}[1][]{% |
| 1417 |
\begingroup% |
| 1418 |
\setkeys[GR]{cl}{#1}% |
| 1419 |
\grLCF[#1]{-29,-19,-13,13,21,-27,27,33,-13,13,19,-21,-33,29}{5} |
| 1420 |
\endgroup% |
| 1421 |
} |
| 1422 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1423 |
% grAndrasfai |
| 1424 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1425 |
\newcounter{tkza@tmp} |
| 1426 |
\newcommand*{\grAndrasfai}[2][]{% |
| 1427 |
\begingroup |
| 1428 |
\setkeys[GR]{cl}{#1}% |
| 1429 |
\pgfmathsetcounter{tkz@bg@cnt}{3*#2-1} |
| 1430 |
\grEmptyCycle[#1]{\thetkz@bg@cnt} |
| 1431 |
\pgfmathsetcounter{tkza@tmp}{\thetkz@bg@cnt/2} |
| 1432 |
\pgfmathsetcounter{tkza@tmp}{\thetkz@bg@cnt+1} |
| 1433 |
\pgfmathsetcounter{tkz@gr@p}{1} |
| 1434 |
\whiledo{\value{tkz@gr@p} < \value{tkza@tmp}}{% |
| 1435 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{\thetkz@bg@cnt}{\thetkz@gr@p}{0}{1} |
| 1436 |
\pgfmathsetcounter{tkz@gr@p}{\thetkz@gr@p+3} |
| 1437 |
} |
| 1438 |
\endgroup |
| 1439 |
} |
| 1440 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1441 |
% grGrotzsch |
| 1442 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1443 |
\newcommand*{\grGrotzsch}[1][]{% |
| 1444 |
\begingroup% |
| 1445 |
\setkeys[GR]{cl}{#1}% |
| 1446 |
\ifcase\cmdGR@cl@form |
| 1447 |
\or |
| 1448 |
\begin{scope}[rotate=18]% |
| 1449 |
\grStar[#1]{6}% |
| 1450 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1451 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1452 |
\grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{5}% |
| 1453 |
\Edges(\cmdGR@cl@prefix0,\cmdGR@cl@prefixx1,% |
| 1454 |
\cmdGR@cl@prefix2,\cmdGR@cl@prefixx3,% |
| 1455 |
\cmdGR@cl@prefix4,\cmdGR@cl@prefixx0,% |
| 1456 |
\cmdGR@cl@prefix1,\cmdGR@cl@prefixx2,% |
| 1457 |
\cmdGR@cl@prefix3,\cmdGR@cl@prefixx4,\cmdGR@cl@prefix0) |
| 1458 |
\end{scope} |
| 1459 |
\or |
| 1460 |
\begin{scope}[rotate=18]% |
| 1461 |
\grStar[#1]{6}% |
| 1462 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1463 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1464 |
\begin{scope}[rotate=-36]% |
| 1465 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{5}{2}% |
| 1466 |
\end{scope} |
| 1467 |
\EdgeDoubleMod{a}{5}{0}{1}% |
| 1468 |
{b}{5}{1}{1}{4} |
| 1469 |
\EdgeIdentity{a}{b}{5} |
| 1470 |
\end{scope} |
| 1471 |
\fi |
| 1472 |
\endgroup% |
| 1473 |
} |
| 1474 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1475 |
% grLevi |
| 1476 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1477 |
\newcommand*{\grLevi}[1][]{% |
| 1478 |
\begingroup% |
| 1479 |
\setkeys[GR]{cl}{#1}% |
| 1480 |
\ifcase\cmdGR@cl@form |
| 1481 |
\or |
| 1482 |
\grLCF[#1]{-13,-9,7,-7,9,13}{5} |
| 1483 |
\or |
| 1484 |
\grCycle[#1]{10} |
| 1485 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{10}{5} |
| 1486 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1487 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1488 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} |
| 1489 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1490 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1491 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} |
| 1492 |
\EdgeInGraphMod{\cmdGR@cl@prefixxx}{10}{4} |
| 1493 |
\fi |
| 1494 |
\endgroup% |
| 1495 |
} |
| 1496 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1497 |
% grPappus |
| 1498 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1499 |
\newcommand*{\grPappus}[1][]{% |
| 1500 |
\begingroup% |
| 1501 |
\setkeys[GR]{cl}{#1}% |
| 1502 |
\ifcase\cmdGR@cl@form |
| 1503 |
\or |
| 1504 |
\grLCF[#1]{5,7,-7,7,-7,-5}{3} |
| 1505 |
\or |
| 1506 |
\begin{scope}[rotate=30]% |
| 1507 |
\grCycle[#1]{6} |
| 1508 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1509 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1510 |
\grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6} |
| 1511 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1512 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1513 |
\grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6} |
| 1514 |
\EdgeDoubleMod{\cmdGR@cl@prefixxx}{6}{0}{2}% |
| 1515 |
{\cmdGR@cl@prefixx}{6}{5}{2}{2} |
| 1516 |
\EdgeDoubleMod{\cmdGR@cl@prefixxx}{6}{5}{2}% |
| 1517 |
{\cmdGR@cl@prefix}{6}{1}{2}{2} |
| 1518 |
\EdgeDoubleMod{\cmdGR@cl@prefixx}{6}{0}{2}% |
| 1519 |
{\cmdGR@cl@prefix}{6}{0}{2}{2} |
| 1520 |
\end{scope} |
| 1521 |
\or |
| 1522 |
\begin{scope}[rotate=30] |
| 1523 |
\grCycle[#1]{6} |
| 1524 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1525 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1526 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6}{2} |
| 1527 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1528 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1529 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{6} |
| 1530 |
\EdgeIdentity{\cmdGR@cl@prefixx}{\cmdGR@cl@prefix}{6} |
| 1531 |
\EdgeInGraphMod{\cmdGR@cl@prefixxx}{6}{3} |
| 1532 |
\end{scope} |
| 1533 |
\fi |
| 1534 |
\endgroup% |
| 1535 |
} |
| 1536 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1537 |
% grChvatal |
| 1538 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1539 |
\newcommand*{\grChvatal}[1][]{% |
| 1540 |
\begingroup% |
| 1541 |
\setkeys[GR]{cl}{#1}% |
| 1542 |
\ifcase\cmdGR@cl@form |
| 1543 |
\or |
| 1544 |
\begin{scope}[rotate=45] |
| 1545 |
\grCycle[#1]{4} |
| 1546 |
\end{scope} |
| 1547 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1548 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1549 |
\begin{scope}[rotate=22.25] |
| 1550 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{8} |
| 1551 |
\end{scope} |
| 1552 |
\EdgeInGraphMod{\cmdGR@cl@prefixx}{8}{4} |
| 1553 |
\EdgeInGraphMod*{\cmdGR@cl@prefixx}{8}{1}{1}{2} |
| 1554 |
\EdgeInGraphMod*{\cmdGR@cl@prefixx}{8}{3}{1}{2} |
| 1555 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{4}{0}{1}% |
| 1556 |
{\cmdGR@cl@prefixx}{8}{1}{2}{3} |
| 1557 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{4}{0}{1}% |
| 1558 |
{\cmdGR@cl@prefixx}{8}{0}{2}{3} |
| 1559 |
\or |
| 1560 |
\begin{scope}[rotate=18] |
| 1561 |
\grCycle[#1]{5} |
| 1562 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1563 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1564 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{5} |
| 1565 |
\end{scope} |
| 1566 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1567 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1568 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{2} |
| 1569 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{5}{0}{1}% |
| 1570 |
{\cmdGR@cl@prefixx}{5}{1}{1}{4} |
| 1571 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{5}{0}{1}% |
| 1572 |
{\cmdGR@cl@prefixx}{5}{4}{1}{4} |
| 1573 |
\EdgeFromOneToSel{\cmdGR@cl@prefixxx}{\cmdGR@cl@prefixx}{0}{4,0,1} |
| 1574 |
\EdgeFromOneToSel{\cmdGR@cl@prefixxx}{\cmdGR@cl@prefixx}{1}{1,2,3} |
| 1575 |
\Edge(\cmdGR@cl@prefixx3)(\cmdGR@cl@prefixx4) |
| 1576 |
\Edge(\cmdGR@cl@prefixx0)(\cmdGR@cl@prefixxx1) |
| 1577 |
\Edge(\cmdGR@cl@prefixx2)(\cmdGR@cl@prefixxx0) |
| 1578 |
\or |
| 1579 |
\grCycle[#1]{12} |
| 1580 |
\Edges(\cmdGR@cl@prefix0,\cmdGR@cl@prefix6,\cmdGR@cl@prefix3,% |
| 1581 |
\cmdGR@cl@prefix8,\cmdGR@cl@prefix11,\cmdGR@cl@prefix5,% |
| 1582 |
\cmdGR@cl@prefix2,\cmdGR@cl@prefix9,\cmdGR@cl@prefix0) |
| 1583 |
\Edges(\cmdGR@cl@prefix1,\cmdGR@cl@prefix7,\cmdGR@cl@prefix10,% |
| 1584 |
\cmdGR@cl@prefix4,\cmdGR@cl@prefix1) |
| 1585 |
\fi |
| 1586 |
\endgroup% |
| 1587 |
} |
| 1588 |
|
| 1589 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1590 |
% grBalaban |
| 1591 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1592 |
\newcommand*{\grBalaban}[1][]{% |
| 1593 |
\begingroup% |
| 1594 |
\setkeys[GR]{cl}{#1}% |
| 1595 |
\ifcase\cmdGR@cl@form |
| 1596 |
\or |
| 1597 |
\grCycle[#1]{50} |
| 1598 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{50}{9}{3}{5} |
| 1599 |
\EdgeInGraphMod*{\cmdGR@cl@prefix}{50}{25}{0}{5} |
| 1600 |
\begin{scope}[rotate=12] |
| 1601 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1602 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1603 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10}{3} |
| 1604 |
\end{scope} |
| 1605 |
\begin{scope}[rotate=24] |
| 1606 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1607 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1608 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10}{3} |
| 1609 |
\end{scope} |
| 1610 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{50}{1}{5}% |
| 1611 |
{\cmdGR@cl@prefixx}{10}{0}{1}{10} |
| 1612 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{50}{4}{5}% |
| 1613 |
{\cmdGR@cl@prefixxx}{10}{0}{1}{10} |
| 1614 |
\or |
| 1615 |
\begin{scope}[rotate=9] |
| 1616 |
\grCycle[#1]{10} |
| 1617 |
\end{scope} |
| 1618 |
\begin{scope}[rotate=-9] |
| 1619 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1620 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1621 |
\grCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} |
| 1622 |
\end{scope} |
| 1623 |
\begin{scope}[rotate=6] |
| 1624 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1625 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1626 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{30} |
| 1627 |
\EdgeInGraphMod*{\cmdGR@cl@prefixxx}{30}{1}{0}{3} |
| 1628 |
\EdgeInGraphMod*{\cmdGR@cl@prefixxx}{30}{1}{1}{3} |
| 1629 |
\EdgeInGraphMod*{\cmdGR@cl@prefixxx}{30}{15}{1}{3} |
| 1630 |
\end{scope} |
| 1631 |
\begin{scope}[rotate=9] |
| 1632 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxxx} |
| 1633 |
\edef\tkzb@rtemp{\cmdGR@cl@RD} |
| 1634 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{20} |
| 1635 |
\EdgeInGraphMod*{\cmdGR@cl@prefixxxx}{20}{7}{0}{2} |
| 1636 |
\EdgeInGraphMod*{\cmdGR@cl@prefixxxx}{20}{5}{1}{2} |
| 1637 |
\end{scope} |
| 1638 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{10}{0}{1} |
| 1639 |
{\cmdGR@cl@prefixxx}{30}{0}{3}{9} |
| 1640 |
\EdgeDoubleMod{\cmdGR@cl@prefixx}{10}{0}{1}% |
| 1641 |
{\cmdGR@cl@prefixxx}{30}{29}{3}{9} |
| 1642 |
\EdgeDoubleMod{\cmdGR@cl@prefixxx}{30}{0}{3}% |
| 1643 |
{\cmdGR@cl@prefixxxx}{20}{0}{2}{9} |
| 1644 |
\EdgeDoubleMod{\cmdGR@cl@prefixxx}{30}{2}{3}% |
| 1645 |
{\cmdGR@cl@prefixxxx}{20}{1}{2}{9} |
| 1646 |
\or |
| 1647 |
\grEmptyCycle[#1]{10} |
| 1648 |
\begin{scope}[rotate=9] |
| 1649 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixx} |
| 1650 |
\edef\tkzb@rtemp{\cmdGR@cl@RB} |
| 1651 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{20} |
| 1652 |
\end{scope} |
| 1653 |
\begin{scope}[rotate=13] |
| 1654 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxx} |
| 1655 |
\edef\tkzb@rtemp{\cmdGR@cl@RC} |
| 1656 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} |
| 1657 |
\end{scope} |
| 1658 |
\begin{scope}[rotate=-13] |
| 1659 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxxx} |
| 1660 |
\edef\tkzb@rtemp{\cmdGR@cl@RD} |
| 1661 |
\grEmptyCycle[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{10} |
| 1662 |
\end{scope} |
| 1663 |
\begin{scope}[rotate=9] |
| 1664 |
\edef\tkzb@ptemp{\cmdGR@cl@prefixxxxx} |
| 1665 |
\edef\tkzb@rtemp{\cmdGR@cl@RE} |
| 1666 |
\grCirculant[#1,prefix=\tkzb@ptemp,RA=\tkzb@rtemp]{20}{6} |
| 1667 |
\end{scope} |
| 1668 |
\EdgeIdentity{\cmdGR@cl@prefixx}{\cmdGR@cl@prefixxxxx}{20} |
| 1669 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{10}{0}{1}% |
| 1670 |
{\cmdGR@cl@prefixx}{20}{0}{2}{10} |
| 1671 |
\EdgeDoubleMod{\cmdGR@cl@prefix}{10}{0}{1}% |
| 1672 |
{\cmdGR@cl@prefixx}{20}{19}{2}{10} |
| 1673 |
\EdgeInGraphMod{\cmdGR@cl@prefix}{10}{5} |
| 1674 |
\EdgeDoubleMod{\cmdGR@cl@prefixxx}{10}{0}{1}% |
| 1675 |
{\cmdGR@cl@prefixx}{20}{0}{2}{10} |
| 1676 |
\EdgeDoubleMod{\cmdGR@cl@prefixxxx}{10}{0}{1}% |
| 1677 |
{\cmdGR@cl@prefixx}{20}{19}{2}{10} |
| 1678 |
\EdgeDoubleMod{\cmdGR@cl@prefixxxx}{10}{0}{1}% |
| 1679 |
{\cmdGR@cl@prefixxx}{10}{1}{1}{10} |
| 1680 |
\EdgeDoubleMod{\cmdGR@cl@prefixxxx}{10}{1}{1}% |
| 1681 |
{\cmdGR@cl@prefixxx}{10}{0}{1}{10} |
| 1682 |
\fi |
| 1683 |
\endgroup% |
| 1684 |
} |
| 1685 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1686 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1687 |
% Labels |
| 1688 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1689 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1690 |
|
| 1691 |
% #2 label/prefix/num |
| 1692 |
\define@cmdkey [GR] {WL} {color}[black]{} |
| 1693 |
\define@cmdkey [GR] {WL} {labelstyle}{} |
| 1694 |
\define@cmdkey [GR] {WL} {size}{} |
| 1695 |
\define@cmdkey [GR] {WL} {style}{} |
| 1696 |
\presetkeys [GR] {WL} {color = black,% |
| 1697 |
labelstyle = {},% |
| 1698 |
size = {},% |
| 1699 |
style = {}}{} |
| 1700 |
\newcommand{\grWriteExplicitLabels}[2][]{% |
| 1701 |
\begingroup% |
| 1702 |
\setkeys[GR]{WL}{#1}% |
| 1703 |
\foreach \text/\where in {#2}{% |
| 1704 |
\node at (\where) {\text}; |
| 1705 |
}% |
| 1706 |
\endgroup% |
| 1707 |
} |
| 1708 |
\newcommand{\grWriteExplicitLabel}[2][]{% |
| 1709 |
\begingroup% |
| 1710 |
\setkeys[GR]{cl}{#1}% |
| 1711 |
\node at (\where) {\text}; |
| 1712 |
\endgroup% |
| 1713 |
}% |
| 1714 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1715 |
% AssignVertexLabel |
| 1716 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1717 |
\tikzset{AssignStyle/.style={}} |
| 1718 |
\define@cmdkey [GR] {AVL} {color}{} |
| 1719 |
\define@cmdkey [GR] {AVL} {size}{} |
| 1720 |
\define@cmdkey [GR] {AVL} {mathsize}{} |
| 1721 |
\define@boolkey[GR] {AVL} {Math}[true]{} |
| 1722 |
\presetkeys [GR] {AVL} {size = \normalsize,% |
| 1723 |
mathsize = \displaystyle,% |
| 1724 |
color = black,% |
| 1725 |
Math = false}{} \newcommand*{\AssignVertexLabel}[3][]{% |
| 1726 |
\begingroup% |
| 1727 |
\setkeys[GR]{AVL}{#1} |
| 1728 |
\foreach \name [count=\xi from 0] in {#3}{% |
| 1729 |
\ifGR@AVL@Math% |
| 1730 |
\node at (#2\xi) |
| 1731 |
{$\textcolor{\cmdGR@AVL@color}{\cmdGR@AVL@mathsize\name}$}; |
| 1732 |
\else |
| 1733 |
\node[AssignStyle] at (#2\xi) |
| 1734 |
{\textcolor{\cmdGR@AVL@color}{\cmdGR@AVL@size\name}}; |
| 1735 |
\fi} |
| 1736 |
|
| 1737 |
\endgroup% |
| 1738 |
} |
| 1739 |
|
| 1740 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1741 |
% grEdgeForTree |
| 1742 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1743 |
% #1 prefix #2 indice #2 prefix #3 indice choisie entre #4 et #5 ... |
| 1744 |
\newcommand{\grEdgeForTree}[5]{% |
| 1745 |
\begingroup% |
| 1746 |
\foreach \V@x in {#4,...,#5}{% |
| 1747 |
\Edge(#1#2)(#3\V@x)% |
| 1748 |
}% |
| 1749 |
\endgroup% |
| 1750 |
} |
| 1751 |
|
| 1752 |
\newcommand{\grSubtreeOfCage}[3][]{% |
| 1753 |
\begingroup |
| 1754 |
\setkeys[GR]{cl}{#1}% |
| 1755 |
\edef\tkzb@rtemp{\cmdGR@cl@RA} |
| 1756 |
\edef\tkzb@rtempx{\cmdGR@cl@RB} |
| 1757 |
\edef\tkzb@ptemp{\cmdGR@cl@prefix} |
| 1758 |
\ifthenelse{\isodd{#3}}% |
| 1759 |
% odd girth |
| 1760 |
{% |
| 1761 |
\pgfmathsetcounter{tkz@gr@a}{(#3-3)/2} |
| 1762 |
\Vertex{\cmdGR@cl@prefix 0\grLabelSep 0} |
| 1763 |
\edef\tkz@auxctp{\thetkz@gr@a} |
| 1764 |
\foreach \V@x in {0,...,\tkz@auxctp}{% |
| 1765 |
\pgfmathsetcounter{tkz@gr@b}{#2*((#2-1)^\V@x)}% |
| 1766 |
\pgfmathsetmacro{\sep@path}{\tkzb@rtemp/((#2-1)^\V@x)}% |
| 1767 |
\pgfmathsetmacro{\y@h}{\tkzb@rtempx*(\V@x+1)}% |
| 1768 |
\pgfmathsetcounter{tkz@gr@c}{\V@x+1}% |
| 1769 |
\grEmptyPath[% |
| 1770 |
prefix=\tkzb@ptemp\thetkz@gr@c\grLabelSep, |
| 1771 |
form=2, |
| 1772 |
RA=\sep@path, |
| 1773 |
x=0, |
| 1774 |
y=\y@h]{\thetkz@gr@b}% |
| 1775 |
}% |
| 1776 |
% edges from the root of the tree |
| 1777 |
\EdgeFromOneToAll{\tkzb@ptemp0\grLabelSep}% |
| 1778 |
{\tkzb@ptemp1\grLabelSep}{0}{#2} |
| 1779 |
% ca = levels from where extra edges emerge |
| 1780 |
% cb = edges per vertex |
| 1781 |
\pgfmathsetcounter{tkz@gr@a}{\thetkz@gr@a-1} |
| 1782 |
\edef\tkz@auxctpa{\thetkz@gr@a} |
| 1783 |
\foreach \V@y in {0,...,\tkz@auxctpa}{% |
| 1784 |
\pgfmathsetcounter{tkz@gr@b}{#2*(#2-1)^\V@y-1} |
| 1785 |
\edef\tkz@auxctpb{\thetkz@gr@b} |
| 1786 |
\foreach \a in {0,...,\tkz@auxctpb}{% |
| 1787 |
\pgfmathsetcounter{tkz@gr@c}{\a*(#2-1)}% |
| 1788 |
\pgfmathsetcounter{tkz@gr@d}{\a*(#2-1)+(#2-2)}% |
| 1789 |
\pgfmathsetcounter{tkz@gr@ta}{\V@y+1} |
| 1790 |
\pgfmathsetcounter{tkz@gr@tb}{\V@y+2} |
| 1791 |
\EdgeFromOneToSeq{\tkzb@ptemp\thetkz@gr@ta\grLabelSep}% |
| 1792 |
{\tkzb@ptemp\thetkz@gr@tb\grLabelSep}{\a}% |
| 1793 |
{\thetkz@gr@c}{\thetkz@gr@d} |
| 1794 |
}% |
| 1795 |
}% |
| 1796 |
}% |
| 1797 |
% even girth |
| 1798 |
{% |
| 1799 |
\pgfmathsetcounter{tkz@gr@a}{(#3-2)/2} |
| 1800 |
\foreach \V@x in {0,...,\thetkz@gr@a}{% |
| 1801 |
\pgfmathsetcounter{tkz@gr@b}{2*((#2-1)^\V@x)}% |
| 1802 |
\pgfmathsetmacro{\sep@path}{\tkzb@rtemp/((#2-1)^\V@x)}% |
| 1803 |
\pgfmathsetmacro{\y@h}{\tkzb@rtempx*\V@x}% |
| 1804 |
\pgfmathsetcounter{tkz@gr@c}{\V@x}% |
| 1805 |
\grEmptyPath[% |
| 1806 |
prefix=\tkzb@ptemp\thetkz@gr@c\grLabelSep, |
| 1807 |
form=2, |
| 1808 |
RA=\sep@path, |
| 1809 |
x=0, |
| 1810 |
y=\y@h]{\thetkz@gr@b}% |
| 1811 |
}% |
| 1812 |
%%%%% |
| 1813 |
\Edge% |
| 1814 |
(\tkzb@ptemp0\grLabelSep0)% |
| 1815 |
(\tkzb@ptemp0\grLabelSep1) |
| 1816 |
%%%% |
| 1817 |
\pgfmathsetcounter{tkz@gr@a}{\thetkz@gr@a-1} |
| 1818 |
\foreach \V@y in {0,...,\thetkz@gr@a}{% |
| 1819 |
\pgfmathsetcounter{tkz@gr@b}{2*(#2-1)^\V@y-1} |
| 1820 |
\foreach \a in {0,...,\thetkz@gr@b}{% |
| 1821 |
\pgfmathsetcounter{tkz@gr@c}{\a*(#2-1)}% |
| 1822 |
\pgfmathsetcounter{tkz@gr@d}{\a*(#2-1)+(#2-2)}% |
| 1823 |
\pgfmathsetcounter{tkz@gr@ta}{\V@y} |
| 1824 |
\pgfmathsetcounter{tkz@gr@tb}{\V@y+1} |
| 1825 |
\EdgeFromOneToSeq{\tkzb@ptemp\thetkz@gr@ta\grLabelSep}% |
| 1826 |
{\tkzb@ptemp\thetkz@gr@tb\grLabelSep}{\a}% |
| 1827 |
{\thetkz@gr@c}{\thetkz@gr@d} |
| 1828 |
}% |
| 1829 |
}% |
| 1830 |
}% |
| 1831 |
\endgroup |
| 1832 |
} |
| 1833 |
|
| 1834 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1835 |
% The End |
| 1836 |
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> |
| 1837 |
\catcode`\@=\tkzAtCode\relax |
| 1838 |
\endinput |