summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
committerNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
commitf325bd88d1d4db13f51277bc59c8ff8814e937bc (patch)
treee39af6619c91d812dd93cb57d25149da5a84d801 /graphics
parente7a321bba289c40f39563c19bbeac355f7c0eeeb (diff)
CTAN sync 202402240301
Diffstat (limited to 'graphics')
-rw-r--r--graphics/metapost/contrib/macros/mptrees/README.md5
-rw-r--r--graphics/metapost/contrib/macros/mptrees/mptrees-doc.pdfbin146573 -> 203314 bytes
-rw-r--r--graphics/metapost/contrib/macros/mptrees/mptrees-doc.tex461
-rw-r--r--graphics/metapost/contrib/macros/mptrees/mptrees.mp844
-rw-r--r--graphics/pgf/contrib/twoxtwogame/LICENSE202
-rw-r--r--graphics/pgf/contrib/twoxtwogame/README.md52
-rw-r--r--graphics/pgf/contrib/twoxtwogame/twoxtwogame.pdfbin0 -> 465201 bytes
-rw-r--r--graphics/pgf/contrib/twoxtwogame/twoxtwogame.sty3118
8 files changed, 4633 insertions, 49 deletions
diff --git a/graphics/metapost/contrib/macros/mptrees/README.md b/graphics/metapost/contrib/macros/mptrees/README.md
index b982e778ca..f74fa1c30c 100644
--- a/graphics/metapost/contrib/macros/mptrees/README.md
+++ b/graphics/metapost/contrib/macros/mptrees/README.md
@@ -1,9 +1,8 @@
-Package mptrees - Version 23.04 - April 27, 2023
+Package mptrees - Version 24.02 - February 22, 2024
---
-This package provides MetaPost tools for drawing simple probability trees.
-One main command, some variants and several parameters to control the output are provided.
+This package provides MetaPost tools for drawing simple probability trees and graphs (in discrete geometry).
---
diff --git a/graphics/metapost/contrib/macros/mptrees/mptrees-doc.pdf b/graphics/metapost/contrib/macros/mptrees/mptrees-doc.pdf
index 300937fc61..5a62a3b517 100644
--- a/graphics/metapost/contrib/macros/mptrees/mptrees-doc.pdf
+++ b/graphics/metapost/contrib/macros/mptrees/mptrees-doc.pdf
Binary files differ
diff --git a/graphics/metapost/contrib/macros/mptrees/mptrees-doc.tex b/graphics/metapost/contrib/macros/mptrees/mptrees-doc.tex
index 907e2eca9f..1cc7339d01 100644
--- a/graphics/metapost/contrib/macros/mptrees/mptrees-doc.tex
+++ b/graphics/metapost/contrib/macros/mptrees/mptrees-doc.tex
@@ -17,7 +17,7 @@
\usepackage[bottom]{footmisc}
\usepackage{mflogo}
-
+
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage{esvect}
\usepackage{nicefrac}
@@ -25,12 +25,11 @@
\usepackage{multicol}
\setlength{\multicolsep}{3pt}
\setlength{\columnsep}{0pt}
-
+
\usepackage[toc]{multitoc}
-
+
\usepackage{enumitem}
-% \setlist[description]{font=\ttfamily\bfseries\color{blue}}
-
+
\usepackage[svgnames]{xcolor}
\usepackage{graphicx}
@@ -38,7 +37,7 @@
\usepackage{url}
\usepackage{verbatim}
\usepackage{fancyvrb}
-
+
\usepackage{array}
\usepackage{colortbl}
\usepackage{tabularx}
@@ -53,7 +52,7 @@
beginfig(1);}
\everyendmplib{endfig;}
\mplibnumbersystem{decimal}
-
+
\usepackage{tcolorbox}
\tcbuselibrary{listings,skins}%,documentation}
@@ -263,15 +262,14 @@ colback=red!10!white,colframe=red!50!black]
-
+\part{Trees}
\section{Overview}
-This package is intended to simplify the drawing of probability trees with \MP. It provides one main command and several parameters to control the output.
+The first aim of this package is to simplify the drawing of probability trees (or other kind of "tree") with \MP. It provides one main command and several parameters to control the output.
It can be used in standalone files with two compilations (\verb|latexmp| package is loaded) but also with Lua\LaTeX{} and \verb|luamplib| package.
-%Some of the following constructions need to be enclosed between \verb|begintree| and \verb|endtree|.
\begin{rpobjet}{tree[<i>][<j>](<dim1>,<dim2>,...)(<ev1>,<prob1>,<ev2>,<prob2>,...)}{picture}
Probability tree located in column \verb|i| and row \verb|j| (see figure below). \verb|dim1|, \verb|dim2|,... can be numerics or pairs and control the dimension of the tree. \verb|ev1|, \verb|prob1|... can be strings or pictures and will be printed (using \verb|latexmp| if strings) at the end of the edge (the event) and above the edge (the probability).
@@ -514,7 +512,7 @@ draw tree[2][1](3cm,2cm)(...);
In the fisrt case, \verb|scaleev| is changed globally while in the second case, the change only applies to the first tree.
-
+
\subsection{Event}
\begin{mptparam}{scaleev}{numeric}{1}
@@ -789,7 +787,7 @@ Note that double quotes have to be replaced by single quotes when this parameter
\begin{mptparam}{brokenlineratio}{numeric}{0.2}
If string \verb|branchtype| is set to \verb|broken|, \verb|brokenlineratio| indicates the ratio between the length of the first segment of the broken line and the total length of the horizontal space.
\end{mptparam}
-
+
\begin{exemple}[lefthand ratio=0.6]
branchtype:="broken";
draw stree[1][1](3cm,3cm)("$A$","$B$");
@@ -1049,6 +1047,445 @@ draw stree[5][9]()("'u'|1","'o'|1");
endtree;
\end{exemple}
+\part{Graphs}
+\section{Overview}
+This package can also be used to draw graphs. In this case, you need to define the nodes by their coordinates and indicate the edges to be drawn. Various commands allow you to draw graphs quickly, but it is also possible to finely control the drawing of each node and edge.
+
+\section{Nodes}
+\subsection{Definition}
+
+\begin{rpdeclaration}{defnodes(<pair1>,<pair2>,...)}
+The easiest way to define the nodes : just put a list of pairs. This command does not draw anything, it just defines an array of pairs corresponding to the coordinates. By default the array name is \verb|A[]|.
+\end{rpdeclaration}
+
+\begin{mptparam}{defnodename}{string}{"A"}
+Default node array name.
+\end{mptparam}
+
+\begin{mptparam}{nodename}{string}{"array"}
+String indicating how the nodes are stored and labels are drawns:
+\begin{itemize}[nosep]
+\item with \verb|nodename="array"|, nodes are stored in \verb|A[]| and labelled \verb|A1|, \verb|A2|,...
+\item with \verb|nodename="Alph"|, nodes are stored and labelled \verb|A|, \verb|B|,...
+\item with \verb|nodename="alph"|, nodes are stored and labelled \verb|a|, \verb|b|,...
+\item with \verb|nodename="arabic"|, nodes are stored in \verb|A[]|,... but are labelled $1$, $2$,...
+\end{itemize}
+\end{mptparam}
+
+\begin{rpdeclaration}{defnode(<token>,<pair>)}
+Nodes can be defined one by one. \verb|<token>| is the node's name and \verb|<pair>| its coordinates.
+\end{rpdeclaration}
+
+\subsection{Drawing}
+
+\begin{rplabel}{drawnodes.<pos>(<nodei>,<nodej>,...)}
+Draw all the indicated nodes. These nodes can be designated either by name or by rank. If the list is empty, all the nodes are drawn. \verb|pos| can be empty or \verb|lft|, \verb|rt|, etc. or an angle.
+\end{rplabel}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes(1,3);
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes(A1,A3);
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodename:="N";
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodename:="Alph";
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodename:="alph";
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodename:="arabic";
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+\begin{mptparam}{printnodename}{boolean}{true}
+When set to false, node names are not printed.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+printnodename:=false;
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+
+\begin{mptparam}{nodeformat}{string}{""}
+String that indicates how the nodes are printed (the shape of path around the node). Possible values are (for now) \verb|"bbox"|, \verb|"circle"|, \verb|"superellipse"| and \verb|"square"|.
+\end{mptparam}
+
+
+\begin{mptparam}{nodewidth}{numeric}{0.6cm}
+Node width...
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodeformat:="square";
+nodewidth:=1cm;
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodewidth:=0.2cm;
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes.bot();
+\end{exemple}
+
+\begin{mptparam}{naturalwidth}{boolean}{false}
+When set to true, the width of the node adapts to the content.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodename:="AA";
+naturalwidth:=true;
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+\begin{mptparam}{nodelinewidth}{numeric}{1}
+Line width of the path around the node.
+\end{mptparam}
+
+\begin{mptparam}{nodelinecolor}{color}{black}
+Color of the path around the node.
+\end{mptparam}
+
+\begin{mptparam}{nodebgcolor}{color}{white}
+Color of the background of the region delimited by the previous path.
+\end{mptparam}
+
+\begin{mptparam}{nodefgcolor}{color}{black}
+Color of the text.
+\end{mptparam}
+
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodelinecolor:=(0.8,0,0);
+nodebgcolor:=(1,0.5,0.5);
+nodefgcolor:=white;
+nodeformat:="superellipse";
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes();
+\end{exemple}
+
+
+\begin{rpdeclaration}{drawnodes(<nodes>) withbgcolor <color>}
+While \verb|withcolor| applies to lines and labels, \verb|withbgcolor| applies to the filling of nodes.
+\end{rpdeclaration}
+
+\begin{exemple}[lefthand ratio = 0.63]
+nodelinecolor:=(0.8,0,0);
+nodebgcolor:=(1,0.5,0.5);
+nodefgcolor:=white;
+nodeformat:="superellipse";
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnodes() withcolor black withbgcolor (0.6,0.6,1);
+\end{exemple}
+
+
+\begin{rplabel}{drawnode.<pos>(<node>,<label>)}
+The nodes can be drawn one by one, specifying the text to be displayed if necessary.
+\end{rplabel}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,0),(4cm,0));
+drawnode[60](1);
+drawnode(2,"$\sqrt{2}$") withbgcolor 0.7white;
+drawnode.bot(A3,"Node");
+\end{exemple}
+
+\section{Edges}
+\subsection{Undirected edges}
+
+\begin{rplabel}{drawedges.<pos>(<(Na,Nb)>,<string1>,<(Nc,Nd)>,<string2>,...)(<angle1>,<angle2>)}
+Draw undirected edges between Node Na and node Nb, between node Nc and node Nd,... Na, Nb, Nc, Nd... must be integers. You can't refer to the nodes with their name.
+
+If present, the string is printed at the position indicated in relation to the middle of the edge (by default).
+
+By default, the edge is a segment. If an angle is specified, it is added to the angle at the start of the edge and subtracted from the angle at the end of the edge. If two angles are specified, they are added to the start and end angles respectively.
+\end{rplabel}
+
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1))();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1),"$p$")();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges.bot((1,2),(3,1),"$p$")();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1))(30);
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1))(40,10);
+\end{exemple}
+
+
+
+\begin{rplabel}{drawedge.<pos>(<Na>,<Nb>)(<angle1>,<angle2>,<string>)}
+The edges can be drawn one by one.In this case, Na, Nb can be the node name. The label or weight must be indicated in the second set of parameters.
+\end{rplabel}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedge(1,2)();
+drawedge.bot(1,3)("$p$");
+drawedge(2,3)(30,"2");
+\end{exemple}
+
+\subsection{Directed edges}
+
+\begin{rplabel}{drawdiredges.<pos>(<(Na,Nb)>,<string1>,<(Nc,Nd)>,<string2>,...)(<angle1>,<angle2>)}
+Draw directed edges from Node Na to node Nb, from node Nc to node Nd,... Na, Nb, Nc, Nd... must be integers. You can't refer to the nodes with their name.
+
+If present, the string is printed at the position indicated in relation to the middle of the edge (by default).
+
+By default, the edge is a segment. If an angle is specified, it is added to the angle at the start of the edge and subtracted from the angle at the end of the edge. If two angles are specified, they are added to the start and end angles respectively.
+\end{rplabel}
+
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawdiredges((1,2),"35",(3,1),"$p$")();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawdiredges.bot((1,2),(3,1),"$p$")(30);
+\end{exemple}
+
+\begin{rplabel}{drawdiredge.<pos>(<Na>,<Nb>)(<angle1>,<angle2>,<string>)}
+The directed edges can be drawn one by one. In this case, Na, Nb can be the node name. The label or weight must be indicated in the second set of parameters.
+\end{rplabel}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawdiredge(1,2)();
+drawdiredge.bot(1,3)("$p$");
+drawdiredge(2,3)(30,"2");
+\end{exemple}
+
+\subsection{Loops}
+\begin{rplabel}{draw(dir)edge.<pos>(<Na>,<Na>)(<angle1>,<angle2>,<string>)}
+Previous commands can be used to draw loops. If present, \verb|angle1| indicates the angle of the loop with horizontal direction. Default value is 90.
+\end{rplabel}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawdiredge(1,1)();
+drawedge(3,3)(-150);
+drawdiredge.bot(2,2)(-90,"a");
+\end{exemple}
+
+
+\subsection{Parameters}
+\begin{mptparam}{edgelinewidth}{numeric}{1}
+Width of the edge.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+edgelinewidth:=2;
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1),"$p$")();
+\end{exemple}
+
+\begin{mptparam}{nodeedgeoffset}{numeric}{0}
+Space between the node and the edge.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+nodeedgeoffset:=0.3cm;
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1),"$p$")();
+\end{exemple}
+
+
+\begin{mptparam}{probformat}{string}{""}
+String that indicates how the weights are printed (the shape of the path). Possible values are (for now) \verb|"bbox"|, \verb|"circle"|, \verb|"superellipse"| and \verb|"square"|.
+
+\end{mptparam}
+
+
+\begin{mptparam}{problinecolor}{color}{black}
+Color of the path around the weight.
+\end{mptparam}
+
+\begin{mptparam}{probgcolor}{color}{white}
+Color of the background of the region delimited by the previous path.
+\end{mptparam}
+
+\begin{mptparam}{probfgcolor}{color}{black}
+Color of the text.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+problinecolor:=(0.8,0,0);
+probbgcolor:=(1,0.5,0.5);
+probfgcolor:=white;
+probformat:="square";
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),"35",(3,1),"$p$")();
+\end{exemple}
+
+\begin{mptparam}{posprob}{numeric}{0.5}
+Position of the weight on the edge.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+posprob:=0.75;
+drawnodes();
+drawedges((1,2),"35",(3,1),"$p$")();
+\end{exemple}
+
+\begin{mptparam}{edgearrowpos}{numeric}{1}
+Position of arrowhead on the edge.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+edgearrowpos:=0.5;
+drawnodes();
+drawdiredges.bot((1,2),(3,1),"$p$")();
+\end{exemple}
+
+\begin{mptparam}{loopangle}{numeric}{90}
+Loop direction. It can be specified in the command parameters.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+loopangle:=-90;
+drawnodes();
+drawdiredges((1,1),(2,2),(3,3))();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawdiredges((1,1),(2,2),(3,3))(-90);
+\end{exemple}
+
+\begin{mptparam}{loopstartangle}{numeric}{30}
+Angle between the path direction at node center and loop direction.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+loopstartangle:=90;
+drawnodes();
+drawdiredges((1,1),(2,2),(3,3))(-90);
+\end{exemple}
+
+
+\begin{mptparam}{loopsize}{numeric}{1.5nodesize}
+Loop size.
+\end{mptparam}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,0cm),(4cm,0));
+loopsize:=1.5cm;
+drawnodes();
+drawdiredges((1,1),(2,2),(3,3))();
+\end{exemple}
+
+\section{Complete graphs}
+
+\begin{rplabel}{draw(dir)graph.<pos>(<(Na,Nb)>,<string1>,<(Nc,Nd)>,<string2>,...)(<angle1>,<angle2>)}
+These commands are shortcuts for drawing both nodes and edges.
+\end{rplabel}
+
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawgraph((1,2),"35",(3,1),"$p$")();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+nodewidth:=0.2cm;
+drawdirgraph.bot((1,2),(3,1),(2,2))(30);
+\end{exemple}
+
+
+\section{Grids}
+To facilitate node placement, use the following command to draw a grid.
+
+\begin{rplabel}{drawgrid(<xmin>,<ymin>,<xmax>,<ymax>)(<unit>,<step>)}
+Command for drawing a grid. Minimum values are optional and equal to 0 by default. The unit and step values are also optional and default to 1 cm and 1 respectively.
+\end{rplabel}
+
+\begin{exemple}[lefthand ratio = 0.6]
+drawgrid(4,4)();
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1))();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+drawgrid(-1,-1,5,3)(1cm,0.5);
+defnodes((0cm,0cm),(2cm,2cm),(4cm,0));
+drawnodes();
+drawedges((1,2),(3,1))();
+\end{exemple}
+
+\begin{exemple}[lefthand ratio = 0.6]
+u:=0.75cm;
+drawgrid(-1,-1,5,3)(u);
+defnodes((0,0),(2u,2u),(4u,0));
+drawnodes();
+drawedges((1,2),(3,1))();
+\end{exemple}
+
\end{document}
diff --git a/graphics/metapost/contrib/macros/mptrees/mptrees.mp b/graphics/metapost/contrib/macros/mptrees/mptrees.mp
index b832d0f94a..f31080b61c 100644
--- a/graphics/metapost/contrib/macros/mptrees/mptrees.mp
+++ b/graphics/metapost/contrib/macros/mptrees/mptrees.mp
@@ -2,10 +2,10 @@
%% mptrees.mp %%
%% Probability trees with MetaPost %%
%% o.peault@posteo.net %%
-%% Version 23.04 (April 2023) %%
+%% Version 24.02 (February 2024) %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
string mptreesversion;
-mptreesversion:="23.04";
+mptreesversion:="24.02";
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -23,7 +23,7 @@ arbres_latexmp:=true;
boolean mpt_begtr; % is begintree used ?
mpt_begtr:=false;
-numeric mpt_passe;
+numeric mpt_passe;
mpt_passe:=1;
@@ -31,7 +31,7 @@ mpt_passe:=1;
def begintree=
mpt_begtr:=true;
- scantokens "def mpt_tree="
+ scantokens "def mpt_tree="
enddef;
let endtree = enddef;
@@ -45,7 +45,7 @@ extra_endfig:="if mpt_begtr: mpt_tree currentpicture:=nullpicture; mpt_passe:=2;
numeric posprob; % position de l'étiquette sur la branche
-posprob:=0.6;
+posprob:=-1;
numeric scaleprob;
scaleprob:=0.85; % échelle de l'étiquette sur la branche
@@ -72,6 +72,9 @@ linewidth:=0.5bp;
color linecolor;
linecolor:=black;
+numeric nodelinewidth; % épaisseur de la ligne autour des noeuds
+nodelinewidth:=0.5bp;
+
pair Orig_arbre[][]; % sommet de l'arbre i,j
Orig_arbre[1][1]:=origin;
@@ -91,7 +94,7 @@ numeric mptLargeur[][],mptHauteur[][]; % diff largeur au rang i, diff hauteur r
numeric countligne[]; % nombre de ligne pour le niveau i
for i=0 upto 128: countligne[i]:=0; endfor
-
+
%numeric typedec; % 0 origine dépend de la taille de l'évènement, 1 taille fixée
numeric shiftev; % taille du décalage dans le cas où typedec=1
shiftev:=-1; % dans ce cas, typedec =0
@@ -163,6 +166,7 @@ vardef labelarbres(expr s)=
save p; picture p;
if picture s: p=s
elseif path s: p=image(draw s)
+% elseif string s: p=scantokens("btex" & s & "etex");
else: p=textext(s)
fi;
p
@@ -170,7 +174,7 @@ enddef;
% longueur du segment qui traverse la figure p selon l'angle inc
-vardef longdir(expr p,inc)=
+vardef longdir(expr p,inc)=
if urcorner p = llcorner p:
0
elseif (abs inc <= abs angle (urcorner p -llcorner p)) or (abs inc > 180 - abs angle (urcorner p -llcorner p)):
@@ -214,15 +218,23 @@ vardef superellipsebox(expr p)=
b=0.5[urcorner l,ulcorner l];
c=0.5[ulcorner l,llcorner l];
d=0.5[llcorner l,lrcorner l];
- l:=superellipse(a,b,c,d,superellipseparam);
+ if (mpt_isgraph and (not naturalwidth) and (not mpt_isprob)):
+ l:=superellipse(1/2 right, 1/2 up, 1/2 left, 1/2 down, .8);
+ l:=l scaled nodewidth
+ elseif naturalwidth:
+ l:=superellipse(a,b,c,d,superellipseparam);
+ l:=l shifted -center l
+ else:
+ l:=superellipse(a,b,c,d,superellipseparam)
+ fi;
l
enddef;
vardef supellformat(expr p,cl,cb,cf)=
image(%
- fill superellipsebox(p) withcolor cb;
- draw superellipsebox(p) withcolor cl;
- draw p withcolor cf;
+ if (cb<>white) or (mpt_bgc): fill superellipsebox(p) withcolor cb mpt_opbg_ fi;
+ draw superellipsebox(p) withcolor cl withpen pencircle scaled nodelinewidth mpt_po_ ;
+ if arbrebool or mpt_isprob: draw p withcolor cf mpt_po_ fi;
)
enddef;
@@ -233,23 +245,60 @@ vardef circlebox(expr p)=
a:=urcorner bbox p;
b:=llcorner bbox p;
c:=0.5[a,b];
- fullcircle scaled (abs(b-a)-2) shifted c
+ if (mpt_isgraph and (not naturalwidth) and (not mpt_isprob)):
+ fullcircle scaled nodewidth
+ elseif naturalwidth:
+ fullcircle scaled (abs(b-a)-2)
+ else:
+ fullcircle scaled (abs(b-a)-2) shifted c
+ fi
enddef;
vardef circleformat(expr p,cl,cb,cf)=
image(%
- fill circlebox(p) withcolor cb;
- draw circlebox(p) withcolor cl;
- draw p withcolor cf;
+ if (cb<>white) or (mpt_isprobover) or (mpt_bgc): fill circlebox(p) withcolor cb mpt_opbg_ fi;
+ draw circlebox(p) withcolor cl withpen pencircle scaled nodelinewidth mpt_po_;
+ if arbrebool or mpt_isprob: draw p withcolor cf mpt_po_ fi;
+)
+enddef;
+
+vardef circleprobformat(expr p,cf)=
+image(%
+ fill circlebox(p) withcolor background;
+ draw p withcolor cf mpt_po_;
+)
+enddef;
+
+% square
+vardef squarebox(expr p)=
+ save H,L;
+ numeric H,L;
+ L=abs((urcorner bbox p) - (ulcorner bbox p));
+ H=abs((urcorner bbox p) - (lrcorner bbox p));
+ if H>L: L:= H fi;
+ if (mpt_isgraph and (not naturalwidth) and (not mpt_isprob)):
+ unitsquare shifted (-0.5,-0.5) scaled nodewidth
+ elseif naturalwidth:
+ unitsquare shifted (-0.5,-0.5) scaled L
+ else:
+ unitsquare shifted (-0.5,-0.5) scaled L shifted center bbox p
+ fi
+enddef;
+
+vardef squareformat(expr p,cl,cb,cf)=
+image(%
+ if (cb<>white) or (mpt_bgc): fill squarebox(p) withcolor cb mpt_opbg_ fi;
+ draw squarebox(p) withcolor cl withpen pencircle scaled nodelinewidth mpt_po_;
+ if arbrebool or mpt_isprob: draw p withcolor cf mpt_po_ fi;
)
enddef;
% bbox
vardef bboxformat(expr p,cl,cb,cf)=
image(%
- fill bbox p withcolor cb;
- draw bbox p withcolor cl;
- draw p withcolor cf;
+ if (cb<>white) or (mpt_bgc): fill bbox p withcolor cb mpt_opbg_ fi;
+ draw bbox p withcolor cl withpen pencircle scaled nodelinewidth mpt_po_;
+ if arbrebool or mpt_isprob: draw p withcolor cf mpt_po_ fi;
)
enddef;
@@ -274,10 +323,14 @@ vardef formatprob(expr p)=
supellformat(p,cl,cb,cf)
elseif probformat="circle":
circleformat(p,cl,cb,cf)
+ elseif probformat="square":
+ squareformat(p,cl,cb,cf)
elseif probformat="bbox":
bboxformat(p,cl,cb,cf)
+ elseif mpt_isprobover and (probformat=""):
+ circleprobformat(p,cf)
else:
- image (draw p withcolor cf)
+ image (draw p withcolor cf mpt_po_)
fi
enddef;
@@ -291,10 +344,14 @@ vardef formatnodeev(expr p)=
supellformat(p,cl,cb,cf)
elseif nodeformat="circle":
circleformat(p,cl,cb,cf)
+ elseif (mpt_isgraph) and (nodeformat=""):
+ circleformat(p,cl,cb,cf)
+ elseif nodeformat="square":
+ squareformat(p,cl,cb,cf)
elseif nodeformat="bbox":
bboxformat(p,cl,cb,cf)
else:
- image (draw p withcolor cf)
+ image (draw p withcolor cf mpt_po_)
fi
enddef;
@@ -435,7 +492,9 @@ enddef;
%%%%%%%% Dessin de la branche
vardef dessinbranche(expr Ori,Fin)=
- if branchtype="segment":
+ if mpt_isgraph:
+ mpt_tmp_branche
+ elseif branchtype="segment":
Ori--Fin
elseif branchtype="curve":
curveline(Ori,Fin)
@@ -463,7 +522,7 @@ vardef branche_abs(expr Ori,Fin,Eve,Pro)=
figtmp=image(%
if branchtype<>"none":
if edgearrow:
- drawarrow
+ drawarrow
else:
draw
fi
@@ -508,6 +567,7 @@ vardef _arbre_(expr Ori)(text t)(text r)= % (pt)(pt1,pt2...)(ev,proba,ev,proba..
picture figtmp,labeltmp[];
numeric counttmp,countlab,tmpcountligne;
pair Fintmp[];
+ mpt_isgraph:=false;
if dirtree<>0: dirlabel:=dirtree fi;
if colonne_cour=1:
countligne[1]:=1;countligne[0]:=1;
@@ -537,7 +597,7 @@ vardef _arbre_(expr Ori)(text t)(text r)= % (pt)(pt1,pt2...)(ev,proba,ev,proba..
labeltmp[1]:=formatnode(labeltmp[1]);
labeltmp[2]:=formatprob(labeltmp[2]);
draw branche_abs(Ori,mptFinBranche[colonne_cour+1][counttmp],labeltmp[1] scaled scaleev,labeltmp[2]);
- Orig_arbre[colonne_cour+1][counttmp]:=mptFinBranche[colonne_cour+1][counttmp] shifted
+ Orig_arbre[colonne_cour+1][counttmp]:=mptFinBranche[colonne_cour+1][counttmp] shifted
if shiftev<0: ((longdir(labeltmp[1] scaled scaleev,dirlabel) + 2labeloffset)*(1,0))
else: (shiftev,0)
fi
@@ -556,7 +616,7 @@ enddef;
-vardef arbre_decv(expr Ori,horiz,Ymax)(text t)(text r)=
+vardef arbre_decv(expr Ori,horiz,Ymax)(text t)(text r)=
% (pt,dec horiz)(dy1,dy2...)(ev,proba,ev,proba...)
save Fin,compt,Ytmp;
numeric compt,Ytmp;
@@ -643,7 +703,7 @@ vardef reg.arbre[][](text t)(text r)=
ligne_cour:=@;
compt:=0;
for i=t:
- if numeric i:
+ if numeric i:
compt:=compt+1;
decal[compt]:=i
fi;
@@ -671,7 +731,7 @@ vardef comp.arbre[][](text t)(text r)=
hide(tmp_compt:=tmp_compt+1;)
if (tmp_compt>1) and (not string i):
,Orig_arbre[colonne_cour][ligne_cour]+i
- elseif not string i:
+ elseif not string i:
Orig_arbre[colonne_cour][ligne_cour]+i
fi
endfor
@@ -680,7 +740,7 @@ vardef comp.arbre[][](text t)(text r)=
_arbre_(Orig_arbre[colonne_cour][ligne_cour])(tmp_text)(r)
enddef;
-
+
%%%%%%%%%%%%%%%%%%%%%%%%% Modif 10/16 - Décalage par rapport à l'origine
vardef dec.arbre[][](text t)(text r)=
save decal;
@@ -781,15 +841,21 @@ enddef;
pair current_tree;
+boolean arbrebool; % est-on à l'intérieur d'un arbre ?
+arbrebool:=false;
+
vardef arbre[][](text t)(text r)=
+ arbrebool:=true;
+ naturalwidth:=false;
init_loc_var;
+ if posprob=-1: posprob:=0.6 fi;
save tmp_type,tmp_compt,tmp_chdb;
numeric tmp_type,tmp_compt,tmp_comptii;
string tmp_chdb;
tmp_compt:=0;tmp_comptii:=0;
for i=t:
tmp_comptii:=tmp_comptii+1;
- if numeric i:
+ if numeric i:
tmp_compt:=tmp_compt+1
elseif string i:
tmp_chdb:=singletodoublequote(i);
@@ -830,7 +896,7 @@ vardef stree[][](text t)(text r)=
numeric cc,ll;
cc:=colonne.#@;
ll:=@;
- def tmptxt=
+ def tmptxt=
for i=r:
i,"",
endfor
@@ -844,7 +910,7 @@ enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vardef ymean(expr i,j)=
- (0
+ (0
for k=1 upto mptNbBranches[i][j]:
+ ypart (mptFinBrancheRel[i][j][k] rotated -dirtree)
endfor)/mptNbBranches[i][j]
@@ -900,7 +966,7 @@ numeric mpt_decbranche[][][];
-def AdjustNodes=
+def AdjustNodes=
tmplig:=0;
for i=1 upto countligne[colonne_cour]:
for j= 1 upto mptNbBranches[colonne_cour][i]:
@@ -914,7 +980,7 @@ def AdjustNodes=
for i=1 upto countligne[col]:
if known mptNbBranches[col][i]:
for j= 1 upto mptNbBranches[col][i]:
- if known exist.arbre[col][i]:
+ if known exist.arbre[col][i]:
tmplig:=tmplig+1;
if known exist.arbre[col+1][tmplig]:
mptFinBrancheRel[col][i][j]:=
@@ -1016,7 +1082,7 @@ vardef bernoulliprocess(expr n)(text t)(text r)=
tmp_ct:=0;
for i=r:
tmp_ct:=tmp_ct+1;
- if string i:
+ if string i:
tmp_ch[tmp_ct]:=i
fi;
endfor
@@ -1045,7 +1111,7 @@ vardef bernoulliprocessL(expr n)(text t)(text r)=
tmp_ct:=0;
for i=r:
tmp_ct:=tmp_ct+1;
- if string i:
+ if string i:
tmp_chi[tmp_ct]:=i
fi;
endfor
@@ -1100,4 +1166,714 @@ vardef binomialtreeL(expr n)(expr L,H)=
enddef;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% GRAPHES
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%% Outils
+vardef isdigit primary d =
+ ("0"<=d)and(d<="9")
+enddef ;
+
+% Convertit un suffixe en chaine avec les chiffres en indice
+vardef _chaine(suffix s)=
+ save c,d;
+ string c,d;
+ d:= str s;
+ if length(d)=1:
+ c:=d
+ elseif isdigit (substring (1,2) of d):
+ c:= (substring (0,1) of d) & "_{" & substring (1,infinity) of d & "}"
+ else: c:=str s
+ fi;
+ c
+enddef;
+
+vardef _chainec(expr d)=
+ save c;
+ string c;
+ if length(d)=1:
+ c:=d
+ elseif isdigit (substring (1,2) of d):
+ c:= (substring (0,1) of d) & "_{" & substring (1,infinity) of d & "}"
+ elseif isdigit (substring (2,3) of d):
+ c:= (substring (0,2) of d) & "_{" & substring (2,infinity) of d & "}"
+ else:
+ c:=d
+ fi;
+ c
+enddef;
+
+% longueur d'un paramètre text
+vardef long_texte(text t)=
+ save i;
+ numeric i;
+ i:=0;
+ for n=t: i:=i+1; endfor
+ i
+enddef;
+
+
+% Placement fin des étiquettes
+vardef thelabelang@#(expr s,z)=
+ save tmpang,tmpfig,tmppt,tmppath,tmpstr;
+ string tmpstr;
+ numeric tmpang;
+ pair tmppt;
+ path tmppath;
+ save p; picture p;
+ tmpstr := str @#;
+ if picture s: p=s
+ else: p = textext(s)
+ fi;
+ tmppath := llcorner p -- lrcorner p -- urcorner p -- ulcorner p -- cycle;
+ if ASCII tmpstr = 91:
+ tmpang := scantokens substring(1,length(tmpstr)-1) of tmpstr
+ else:
+ tmpang := scantokens tmpstr
+ fi;
+ tmppt := tmppath intersectionpoint ((0.5urcorner p+0.5llcorner p)-- (0.5urcorner p +0.5llcorner p+ 100 * (dir (180+tmpang))));
+ p shifted (-tmppt + z + labeloffset*(cosd(tmpang),sind(tmpang)) )
+enddef;
+
+def labelang = draw thelabelang enddef;
+
+
+%%%%%%
+%% Paramètres
+%%%%%
+
+
+numeric nodewidth,edgelinewidth,edgearrowpos;
+nodewidth:=0.6cm;
+edgelinewidth:=1;
+nodelinewidth:=1;
+edgearrowpos:=1;
+
+boolean naturalwidth;
+naturalwidth:=false;
+
+numeric nodelabeloffset, nodeedgeoffset; % pour la position des étiquettes
+nodelabeloffset:=2;
+%nodeedgeoffset:=nodelinewidth/2+edgelinewidth/2;
+nodeedgeoffset:=-101;
+
+
+
+numeric edgeangle,loopangle,loopsize,loopstartangle;
+edgeangle:=0;
+loopangle:=90;
+loopsize:=-1;
+loopstartangle:=30;
+
+
+%%% Format du nom des sommets
+string defnodename;
+defnodename:="A";
+string nodename;
+nodename:="array";
+numeric startnodename;
+startnodename=1;
+
+
+boolean printnodename;
+printnodename:=true;
+
+
+
+numeric mpt_numtotal; % nombre total de sommets
+mpt_numtotal:=0;
+
+pair mpt_nodecoord[]; % coordonnées du noeud i
+string mpt_nodename[]; % nom du noeud i
+path mpt_nodepath[]; % chemin autour du noeud i
+string mpt_nodelpart[],mpt_nodenumpart[]; % parties alphanumérique et numérique du nom du noeud
+
+color gridcolor;
+gridcolor:=0.7white;
+
+numeric gridlinewidth;
+gridlinewidth:=0.5;
+
+
+
+%%%% Variables privées
+boolean mpt_dir; %arête orientée ou non
+mpt_dir:=false;
+
+boolean mpt_isgraph;
+mpt_isgraph:=false;
+
+picture mpt_tmp_fig_cbg;
+path mpt_tmp_branche;
+string mpt_tmp_prob;
+
+path mpt_tmp_path;
+
+boolean mpt_isprob,mpt_isprobover;
+mpt_isprob:=false;
+mpt_isprobover:=false;
+
+
+boolean mpt_bgc;
+mpt_bgc:=false;
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%% Noeuds
+
+vardef mptlpart(expr tt)=
+ save tmp;
+ string tmp;
+ tmp:="";
+ for i =1 upto length tt:
+ if not isdigit substring(i-1,i) of tt:
+ tmp:=tmp & substring(i-1,i) of tt
+ fi;
+ endfor
+ tmp
+enddef;
+
+vardef mptnumpart(expr tt)=
+ save tmp;
+ string tmp;
+ tmp:="";
+ for i =1 upto length tt:
+ if isdigit substring(i-1,i) of tt:
+ tmp:=tmp & substring(i-1,i) of tt
+ fi;
+ endfor
+ tmp
+enddef;
+
+% définit le noeud et certains attributs
+def defnode(suffix ptA)(expr A)=
+ save tmpchcomp,tmpchlet,tmpchnum;
+ string tmpchcomp,tmpchlet,tmpchnum;
+ mpt_isgraph:=true;
+ tmpchcomp:= str ptA;
+ tmpchlet:=mptlpart(str ptA);
+ tmpchnum:=mptnumpart(str ptA);
+ if tmpchnum="":
+ pair ptA;
+ ptA:=A;
+ else:
+ scantokens("if not known " & tmpchlet & ": pair " & tmpchlet & "[] fi;" & tmpchlet & tmpchnum & ":=("& decimal(xpart A)&","& decimal(ypart A) & ");")
+ fi;
+ mpt_numtotal:=mpt_numtotal+1;
+ mpt_nodecoord[mpt_numtotal]:=A;
+ mpt_nodename[mpt_numtotal]:= tmpchcomp;
+ mpt_nodelpart[mpt_numtotal]:= tmpchlet;
+ mpt_nodenumpart[mpt_numtotal]:= tmpchnum;
+ mpt_nodepath[mpt_numtotal]:= formatnodepath(labelarbres(str ptA) scaled scaleev) shifted A;
+enddef;
+
+
+def defnodestr(expr ptA)(expr A)= % Quand le premier paramètre est une chaine simple
+ save tmpchcomp,tmpchlet,tmpchnum;
+ string tmpchcomp,tmpchlet,tmpchnum;
+ mpt_isgraph:=true;
+ tmpchcomp:= ptA;
+ tmpchlet:=ptA;
+ tmpchnum:="";
+ scantokens("pair " & tmpchcomp & ";" & tmpchcomp & ":=("& decimal(xpart A)&","& decimal(ypart A) & ");")
+ mpt_numtotal:=mpt_numtotal+1;
+ mpt_nodecoord[mpt_numtotal]:=A;
+ mpt_nodename[mpt_numtotal]:= tmpchcomp;
+ mpt_nodelpart[mpt_numtotal]:= tmpchlet;
+ mpt_nodenumpart[mpt_numtotal]:= tmpchnum;
+ mpt_nodepath[mpt_numtotal]:= formatnodepath(labelarbres(tmpchcomp) scaled scaleev) shifted A;
+enddef;
+
+
+def defnodes(text t)= % Pour définir plusieurs noeuds à la fois
+ if (nodename="array") or (nodename="arabic"):
+ for i=t:
+ mpt_numtotal:=mpt_numtotal+1;
+ if mpt_numtotal=1:
+ scantokens("pair " & defnodename & "[];")
+ fi;
+ scantokens(defnodename & decimal(mpt_numtotal) & ":=("& decimal(xpart i)&","& decimal(ypart i) & ");");
+ mpt_nodecoord[mpt_numtotal]:=i;
+ mpt_nodename[mpt_numtotal]:= defnodename & decimal(mpt_numtotal);
+ mpt_nodelpart[mpt_numtotal]:= defnodename;
+ mpt_nodenumpart[mpt_numtotal]:= decimal(mpt_numtotal);
+ mpt_nodepath[mpt_numtotal]:= formatnodepath(labelarbres(mpt_nodename[mpt_numtotal]) scaled scaleev) shifted mpt_nodecoord[mpt_numtotal];
+ endfor
+ elseif (nodename="Alph") or (nodename="alph"):
+ save tmp_str,tmp_nn;
+ string tmp_str;
+ numeric tmp_nn;
+ tmp_nn:= if nodename="Alph": 64 else: 96 fi;
+ for i=t:
+ tmp_str:=char(mpt_numtotal+startnodename+tmp_nn);
+ defnodestr(tmp_str)(i);
+ endfor
+ fi
+enddef;
+
+
+% Renvoie le rang d'un noeud par suffixe
+vardef searchnode(suffix ptA)=
+ save val,st;
+ numeric val;
+ string st;
+ st= str ptA;
+ for i=1 upto mpt_numtotal:
+ if mpt_nodename[i]=st:
+ val=i
+ fi;
+ exitif known val;
+ endfor
+ val
+enddef;
+
+% Renvoie le rang d'un noeud suivi d'une chaine
+vardef searchnodech(suffix s)(expr c)=
+ searchnode(s)
+enddef;
+
+% Renvoie le path d'un noeud
+vardef nodepath(suffix ptA)=
+ save nn;
+ numeric nn;
+ nn:=searchnode(ptA);
+ mpt_nodepath[nn]
+enddef;
+
+% Forme du chemin autour du noeud
+vardef formatnodepath(expr p)=
+ if nodeformat="superellipse":
+ superellipsebox(p)
+ elseif (nodeformat="circle") or (nodeformat=""):
+ circlebox(p)
+ elseif nodeformat="square":
+ squarebox(p)
+ else:
+ bbox p shifted -center bbox p
+ fi
+enddef;
+
+
+% Dessin du noeud
+vardef thenode@#(text t)=
+ save tmp_fig,tmpstr;
+ picture tmp_fig;
+ string tmp_str;
+ if long_texte(t)=1:
+ tmp_fig:=thenodenum@#(searchnode(t))
+ else:
+ for i=t:
+ if string i: tmp_fig:=thenodenum@#(searchnodech(t),i) fi;
+ endfor
+ fi;
+ tmp_fig
+enddef;
+
+vardef thenodenum@#(text t)=
+ save tmp_pt,ch,dess,latch,num;
+ numeric num;
+ pair tmp_pt;
+ string ch,latch;
+ picture dess;
+ mpt_isgraph:=true;
+ interim labeloffset:=nodelabeloffset+nodewidth/2;
+ if ((ASCII str @# < 58) or (ASCII str @# = 91)) and (str @#<>""):
+ def mylabel = labelang enddef
+ else:
+ def mylabel = label enddef
+ fi;
+ if long_texte(t)=1:
+ num:=t;
+ dess:=image(
+ ch:="$" & _chainec(mpt_nodename[num]) & "$";
+ if nodename="arabic": ch := "$" & decimal(num) & "$" fi;
+ mpt_nodepath[num]:=formatnodepath(labelarbres(ch) scaled scaleev) shifted mpt_nodecoord[num];
+ label(formatnodeev(labelarbres(ch) scaled scaleev),mpt_nodecoord[num]);
+ if printnodename:
+ mylabel@#(textext(ch) scaled scaleev,mpt_nodecoord[num]) withcolor nodefgcolor mpt_po_
+ fi)
+ else:
+ dess:=image(%
+ for PP=t:
+ if numeric PP:
+ num:=PP;
+ tmp_pt:=mpt_nodecoord[num];
+ else:
+ mpt_nodepath[num]:=formatnodepath(labelarbres(PP) scaled scaleev) shifted mpt_nodecoord[num];
+ label(formatnodeev(labelarbres(PP) scaled scaleev),tmp_pt);
+ if printnodename:
+ if string PP:
+ mylabel@#(textext(PP),tmp_pt) withcolor nodefgcolor mpt_po_;
+ else:
+ mylabel@#(PP scaled defaultscale,tmp_pt) withcolor nodefgcolor mpt_po_;
+ fi
+ fi
+ fi;
+ endfor)
+ fi;
+ dess
+enddef;
+
+vardef node@#(text s)=
+ save mpt_boolnum;
+ boolean mpt_boolnum;
+ mpt_boolnum:=false;
+ for i=s:
+ if numeric i:
+ mpt_boolnum:=true
+ fi;
+ endfor
+ if mpt_boolnum:
+ thenodenum@#(s)
+ else:
+ thenode@#(s)
+ fi
+enddef;
+
+
+vardef firstnode@#(suffix s)(text t) text r=
+ drawnode@#(s) r;
+ def tmp_text= t enddef;
+enddef;
+
+
+vardef nodes@#(text t) text s= % Dessin des noeuds à partir de leur rang
+ save tmp_pt;
+ pair tmp_pt;
+ save mpt_boolnum;
+ boolean mpt_boolnum;
+ mpt_boolnum:=false;
+ for i=t:
+ if numeric i:
+ mpt_boolnum:=true
+ fi;
+ endfor
+ image(
+ if long_texte(t)=0:
+ for i=1 upto mpt_numtotal:
+ drawnode@#(i) s;
+ endfor
+ elseif mpt_boolnum:
+ for i=t:
+ drawnode@#(i) s;
+ endfor
+ else:
+ save n;numeric n;
+ n=long_texte(t);
+ def tmp_text= t enddef;
+ for i=1 upto n-1:
+ firstnode@#(tmp_text) s;
+ endfor
+ drawnode@#(tmp_text) s;
+ fi
+ )
+enddef;
+
+
+
+vardef drawnode@#(text p) text t =
+ mpt_drop(t);
+ mpt_tmp_fig_cbg:=image(draw (0,0) mpt_po_);
+ draw node@#(p);
+ mpt_bgc:=false;
+ mpt_drop();
+enddef;
+
+def drawnodes = draw nodes enddef;
+
+
+%%%%%%%%%%%%%
+%% Arêtes
+%%%%%%%%%%%%%
+% chemin entre les noeuds de rangs n et m, angles en param
+vardef theedgeAB(expr m,n)=
+ save an,ta,pb,pathab,A,B,C,tmpoffset;
+ numeric an,tmpoffset;
+ numeric ta,tb;
+ pair A,B,C;
+ if nodeedgeoffset=-101: tmpoffset:=0
+ else: tmpoffset:=nodeedgeoffset
+ fi;
+ tmpoffset:=tmpoffset+nodelinewidth/2+edgelinewidth/2;
+ A:=mpt_nodecoord[m];
+ B:=mpt_nodecoord[n];
+ path pathab;
+ if m<>n:
+ an:=angle(B-A);
+ pathab:=A{dir (an+edgeangleaa[0])}..{dir (an-edgeangleaa[1])}B;
+ ta=xpart(pathab intersectiontimes mpt_nodepath[m]);
+ tb=xpart(pathab intersectiontimes mpt_nodepath[n]);
+ pathab:= subpath(ta,tb) of pathab;
+ ta:= arctime tmpoffset of pathab;
+ tb:= arctime ((arclength pathab)-tmpoffset) of pathab;
+ pathab:= subpath (ta, tb) of pathab;
+ else:
+ pathab:=theloopA(n)
+ fi;
+ pathab
+enddef;
+
+
+
+% boucle sur le noeud n
+vardef theloopA(expr n)=
+ save pathaa,aapath,A,B,C,tmpoffset,ta,tb;
+ pair A,B,C;
+ numeric tmpoffset,ta,tb;
+ path pathaa,aapath;
+ if nodeedgeoffset=-101: tmpoffset:=0
+ else: tmpoffset:=nodeedgeoffset
+ fi;
+ tmpoffset:=tmpoffset+nodelinewidth/2+edgelinewidth/2;
+ C:=mpt_nodecoord[n];
+ pathaa:=C{dir (-tmp_loopangle[1]+tmp_loopangle[0])}..
+ (C+((0.5loopsize,0.77loopsize) rotated (tmp_loopangle[0]-90))){dir (tmp_loopangle[0])}..
+ (C+((loopsize,0) rotated (tmp_loopangle[0]))){dir (tmp_loopangle[0]+90)}..
+ (C+((-0.5loopsize,0.7loopsize) rotated (tmp_loopangle[0]-90))){dir (tmp_loopangle[0]+180)}..
+ {dir (tmp_loopangle[1]+tmp_loopangle[0]+180)}C;
+ aapath:= reverse pathaa;
+ ta=xpart(subpath(0,0.5*length pathaa) of pathaa intersectiontimes mpt_nodepath[n]);
+ tb=xpart(subpath(0,0.5*length aapath) of aapath intersectiontimes mpt_nodepath[n]);
+ pathaa:= subpath (ta,(length pathaa) - tb) of pathaa;
+ ta:= arctime tmpoffset of pathaa;
+ tb:= arctime ((arclength pathaa)-tmpoffset) of pathaa;
+ pathaa:= subpath (ta, tb) of pathaa;
+ pathaa
+enddef;
+
+% Chemin entre les noeuds A et B, angles dans p
+vardef theedge(suffix A,B)(text p)=
+ save nA,nB,tmp_fig;
+ numeric nA,nB;
+ picture tmp_fig;
+ nA:=searchnode(A);
+ nB:=searchnode(B);
+ theedgenum(nA,nB)(p)
+enddef;
+
+% Chemin entre les noeuds nA et nB, angles dans p
+vardef theedgenum(expr nA,nB)(text p)=
+ save tmp_fig;
+ picture tmp_fig;
+ numeric edgeangleaa[],tmp_loopangle[];
+ edgeangleaa[0]=edgeangleaa[1]=edgeangle;
+ tmp_loopangle[0]:=loopangle;tmp_loopangle[1]:=loopstartangle;
+ mpt_isgraph:=true;
+ nn:=0;
+ for i=p:
+ if numeric i:
+ if nn=0: edgeangleaa[0]:=i;edgeangleaa[1]:=i;tmp_loopangle[0]:=i
+ else: edgeangleaa[1]:=-i;tmp_loopangle[1]:=i
+ fi;
+ nn:=nn+1;
+ elseif string i:
+ mpt_tmp_prob:=i;
+ fi
+ endfor
+ theedgeAB(nA,nB)
+enddef;
+
+% Figure représentant le chemin avec (ou non) la flèche
+vardef theedgenumfig(expr nA,nB)(text p)=
+ save tmppath;
+ path tmppath;
+ tmppath:=theedgenum(nA,nB)(p);
+ image(draw tmppath withpen pencircle scaled edgelinewidth mpt_po_;
+ if mpt_dir:
+ filldraw arrowhead subpath(0, edgearrowpos*length mpt_tmp_path) of mpt_tmp_path mpt_po_
+ fi;
+ )
+enddef;
+
+vardef edges@#(text s)(text p) text t= % dessine plusieurs arêtes simultanément
+ save a,b,isp;
+ numeric a,b;
+ boolean isp;
+ isp:=false;
+ image(
+ for i=s:
+ if pair i:
+ if isp: drawedge@#(a,b)(p) t; fi;
+ a:= xpart i;b:= ypart i;
+ isp:=true;
+ else:
+ drawedge@#(a,b)(i,p) t;
+ isp:=false
+ fi;
+ endfor
+ if isp: drawedge(a,b)(p) t; fi
+ )
+enddef;
+
+
+
+
+
+
+vardef theedgepond@#(suffix A,B)(text p)=
+ save nA,nB;
+ numeric nA,nB;
+ nA:=searchnode(A);
+ nB:=searchnode(B);
+ theedgepondnum@#(nA,nB)(p)
+enddef;
+
+vardef theedgepondnum@#(expr nA,nB)(text p)=
+ save tmpfig,tmppath,tmppt,mpt_isprob,mpt_isprobover;
+ boolean mpt_isprob,mpt_isprobover;
+ mpt_isprob:=true;
+ path tmppath;
+ picture tmpfig;
+ pair tmppt;
+ if str @#="": mpt_isprobover:=true else: mpt_isprobover:=false fi;
+ if ((ASCII str @# < 58) or (ASCII str @# = 91)) and (str @#<>""):
+ def mylabel = labelang enddef
+ else:
+ def mylabel = label enddef
+ fi;
+ tmppath:=theedgenum(nA,nB)(p);
+ tmppt:=point (arctime posprob*(arclength tmppath) of tmppath) of tmppath;
+ image(draw theedgenum(nA,nB)(p) withpen pencircle scaled edgelinewidth mpt_po_;
+ if mpt_dir:
+ filldraw arrowhead subpath(0, edgearrowpos*length mpt_tmp_path) of mpt_tmp_path mpt_po_
+ fi;
+ mylabel@#(formatprob(labelarbres(mpt_tmp_prob) scaled scaleprob),tmppt))
+enddef;
+
+vardef edge@#(text s)(text p)=
+ save mpt_boolprob,mpt_boolnum;
+ boolean mpt_boolprob,mpt_boolnum;
+ mpt_boolprob:=false;
+ mpt_boolnum:=false;
+ if posprob=-1: posprob:=0.5 fi;
+ if loopsize=-1:
+ loopsize:=1.5nodewidth;
+ if loopsize<0.6cm: loopsize:=0.6cm fi;
+ fi;
+ for i=p:
+ if string i:
+ mpt_boolprob:=true
+ fi;
+ endfor
+ for i=s:
+ if numeric i:
+ mpt_boolnum:=true
+ fi;
+ endfor
+ if mpt_boolnum:
+ mpt_tmp_path:=theedgenum(s)(p);
+ if mpt_boolprob:
+ theedgepondnum@#(s)(p)
+ else:
+ theedgenumfig(s)(p)
+ fi
+ else:
+ mpt_tmp_path:=theedge(s)(p);
+ if mpt_boolprob:
+ theedgepond@#(s)(p)
+ else:
+ theedge(s)(p)
+ fi
+ fi
+enddef;
+
+%%%%%%%%%% Drawing edges
+
+vardef drawedge@#(text s)(text p) text t=
+ mpt_drop(t);
+ draw edge@#(s)(p) withpen pencircle scaled edgelinewidth;
+ mpt_drop();
+enddef;
+
+vardef drawedges@#(text s)(text p) text t=
+ draw edges@#(s)(p) t
+enddef;
+
+
+vardef drawdiredge@#(text s)(text p) text t=
+ save mpt_dir;
+ boolean mpt_dir;
+ mpt_dir:=true;
+ drawedge@#(s)(p) t;
+enddef;
+
+vardef drawdiredges@#(text s)(text p) text t=
+ save mpt_dir;
+ boolean mpt_dir;
+ mpt_dir:=true;
+ drawedges@#(s)(p) t;
+enddef;
+
+
+vardef drawgraph@#(text s)(text p) text t= % dessine les noeuds et les arêtes
+ drawnodes@#() t;
+ drawedges@#(s)(p) t;
+enddef;
+
+vardef drawdirgraph@#(text s)(text p) text t= % dessine les noeuds et les arêtes
+ drawnodes@#() t;
+ drawdiredges@#(s)(p) t;
+enddef;
+
+
+%%%%%%%%%%%%%% Managing colors
+
+def mpt_drop(text t) =
+ def mpt_po_ = t enddef;
+enddef;
+
+mpt_drop();
+def withbgcolor expr c=
+ hide(mpt_bgc:=true; def mpt_opbg_ = withcolor c enddef)
+enddef;
+
+def mpt_opbg_ = enddef;
+
+%%%%%%%%%%%%%% Grids
+
+vardef thegridcomp(expr xmin,ymin,xmax,ymax,pas,u)=
+ image(
+ for i=xmin step pas until xmax:
+ draw (i*u,ymin*u)--(i*u,ymax*u) withcolor gridcolor withpen pencircle scaled gridlinewidth;
+ label.bot(textext("$" & decimal(i)& "$") scaled 0.6,(i*u,ymin*u)) withcolor gridcolor;
+ endfor
+ for i=ymin step pas until ymax:
+ draw (xmin*u,i*u)--(xmax*u,i*u) withcolor gridcolor withpen pencircle scaled gridlinewidth;
+ label.lft(textext("$" & decimal(i)& "$") scaled 0.6,(xmin*u,i*u)) withcolor gridcolor;
+ endfor
+ )
+enddef;
+
+
+vardef grid(text t)(text s)=
+ save minmax,pasun,c;
+ numeric minmax[],pasun[],c;
+ c:=0;
+ pasun[1]:=1cm;
+ pasun[2]:=1;
+ for i=s:
+ c:=c+1;
+ pasun[c]:=i;
+ endfor
+ c:=0;
+ for i=t:
+ c:=c+1;
+ minmax[c]:=i;
+ endfor
+ if c=4:
+ thegridcomp(minmax[1],minmax[2],minmax[3],minmax[4],pasun[2],pasun[1])
+ else:
+ thegridcomp(0,0,minmax[1],minmax[2],pasun[2],pasun[1])
+ fi
+enddef;
+
+def drawgrid= draw grid enddef;
diff --git a/graphics/pgf/contrib/twoxtwogame/LICENSE b/graphics/pgf/contrib/twoxtwogame/LICENSE
new file mode 100644
index 0000000000..d645695673
--- /dev/null
+++ b/graphics/pgf/contrib/twoxtwogame/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/graphics/pgf/contrib/twoxtwogame/README.md b/graphics/pgf/contrib/twoxtwogame/README.md
new file mode 100644
index 0000000000..3856e3f087
--- /dev/null
+++ b/graphics/pgf/contrib/twoxtwogame/README.md
@@ -0,0 +1,52 @@
+# twoxtwogame
+
+A LaTeX package for visualizing 2x2 normal-form games. The package builds upon
+PGF/TikZ to produce beautiful vector graphic visualizations indented for use in
+scientific publications. Commands include producing graphical representations
+of 2x2 games, plotting the equilibria in 2x2 games, and game embeddings for 2x2
+games.
+
+## Installation
+
+Simply include the `twoxtwogame.sty` file in your working directory.
+
+## Usage
+
+Include in the preamble the `twoxtwogame` package.
+
+```tex
+\usepackage{twoxtwogame}
+```
+
+In the main document, utilize the commands that the package provides.
+
+```tex
+\cyclebrgraph~Matching Pennies has a single mixed Nash equilibrium, while
+\coordinationbrgraph~two pure Nash equilibria and a single mixed Nash
+equilibrium.
+```
+
+For further information, please refer to the included package documentation:
+`twoxtwogame_doc.pdf` which can be built from `twoxtwogame_doc.tex`.
+
+## License and disclaimer
+
+Copyright 2024 DeepMind Technologies Limited
+
+All software is licensed under the Apache License, Version 2.0 (Apache 2.0);
+you may not use this file except in compliance with the Apache 2.0 license.
+You may obtain a copy of the Apache 2.0 license at:
+https://www.apache.org/licenses/LICENSE-2.0
+
+All other materials are licensed under the Creative Commons Attribution 4.0
+International License (CC-BY). You may obtain a copy of the CC-BY license at:
+https://creativecommons.org/licenses/by/4.0/legalcode
+
+Unless required by applicable law or agreed to in writing, all software and
+materials distributed here under the Apache 2.0 or CC-BY licenses are
+distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the licenses for the specific language governing
+permissions and limitations under those licenses.
+
+This is not an official Google product.
+
diff --git a/graphics/pgf/contrib/twoxtwogame/twoxtwogame.pdf b/graphics/pgf/contrib/twoxtwogame/twoxtwogame.pdf
new file mode 100644
index 0000000000..bc3b5bcd45
--- /dev/null
+++ b/graphics/pgf/contrib/twoxtwogame/twoxtwogame.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/twoxtwogame/twoxtwogame.sty b/graphics/pgf/contrib/twoxtwogame/twoxtwogame.sty
new file mode 100644
index 0000000000..a42e6606fc
--- /dev/null
+++ b/graphics/pgf/contrib/twoxtwogame/twoxtwogame.sty
@@ -0,0 +1,3118 @@
+% Copyright 2024 DeepMind Technologies Limited
+%
+% Licensed under the Apache License, Version 2.0 (the "License");
+% you may not use this file except in compliance with the License.
+% You may obtain a copy of the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS,
+% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+% See the License for the specific language governing permissions and
+% limitations under the License.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{twoxtwogame}[2024/02/23 v0.1 Tools for 2x2 Games]
+
+\RequirePackage{tikz}
+\RequirePackage{tikz-3dplot}
+\RequirePackage{pgfplots}
+\pgfplotsset{compat=1.18}
+\RequirePackage{tikzscale}
+\RequirePackage{pgfmath-xfp}
+\RequirePackage{ifthen}
+\usetikzlibrary{arrows.meta,patterns,shapes,calc,positioning,external}
+\RequirePackage{amsthm, amsmath, amsfonts, amssymb, mathtools}
+\RequirePackage{etoolbox}
+\RequirePackage{bubblesort}
+
+\makeatletter
+
+\newcommand{\@setdefaultgraphkey}{%
+ \tikzset{
+ graph/.is family,
+ graph,
+ point offset/.initial=-0.38em,
+ point color/.initial=.,
+ point radius/.initial=0.04em,
+ row player x offset/.initial=-0.1em,
+ row player y offset/.initial=-0.05em,
+ column player x offset/.initial=0.1em,
+ column player y offset/.initial=0.05em,
+ player x offset/.initial=0em,
+ player y offset/.initial=0em,
+ row player color/.initial=.,
+ column player color/.initial=.,
+ player color/.initial=.,
+ row player first strategy color/.initial=\empty,
+ row player second strategy color/.initial=\empty,
+ column player first strategy color/.initial=\empty,
+ column player second strategy color/.initial=\empty,
+ border color/.initial=.,
+ color/.initial=.,
+ arrow width/.initial=0.25em,
+ arrow length/.initial=0.35em,
+ line width/.initial=0.04em,
+ row player first strategy label/.initial=A,
+ row player second strategy label/.initial=B,
+ column player first strategy label/.initial=A,
+ column player second strategy label/.initial=B,
+ label/.initial=,
+ }%
+}
+\@setdefaultgraphkey
+\newcommand{\@graphkey}[1]{\pgfkeysvalueof{/tikz/graph/#1}}
+
+\DeclareRobustCommand{\ordgraph}[9][]{%
+ \@setdefaultgraphkey%
+ \tikzset{%
+ graph,%
+ point offset=0.38em,%
+ point color=.,%
+ point radius=0.04em,%
+ row player x offset=-0.1em,%
+ row player y offset=-0.05em,%
+ column player x offset=0.1em,%
+ column player y offset=0.05em,%
+ row player color=.,%
+ column player color=gray,%
+ arrow width=0.25em,%
+ arrow length=0.35em,%
+ line width=0.04em,%
+ #1}%
+ \raisebox{-0.2em}{%
+ \begin{tikzpicture}%
+ \path (-\@graphkey{point offset}-\@graphkey{arrow width}-\@graphkey{row player x offset},-\@graphkey{point offset}-\@graphkey{arrow width}-\@graphkey{row player y offset}) -- (\@graphkey{point offset}+\@graphkey{arrow width}+\@graphkey{row player x offset},\@graphkey{point offset}+\@graphkey{arrow width}+\@graphkey{row player y offset});
+ % Column player.
+ \tikzset{graph,player color=\@graphkey{column player color},player x offset=\@graphkey{column player x offset},player y offset=\@graphkey{column player y offset}}%
+ \@playerordgraph[#1]{#6}{#7}{#8}{#9}
+ % Row player.
+ \tikzset{graph,player color=\@graphkey{row player color},player x offset=\@graphkey{row player x offset},player y offset=\@graphkey{row player y offset}}%
+ \@playerordgraph[#1]{#2}{#3}{#4}{#5}
+
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt = #5 pt} \AND \lengthtest{#6 pt = #7 pt} \AND \lengthtest{#7 pt = #8 pt} \AND \lengthtest{#8 pt = #9 pt}}{
+ \fill[\@graphkey{point color}] (-\@graphkey{point offset},-\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ \fill[\@graphkey{point color}] (-\@graphkey{point offset},+\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ \fill[\@graphkey{point color}] (+\@graphkey{point offset},-\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ \fill[\@graphkey{point color}] (+\@graphkey{point offset},+\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ }{}
+ \end{tikzpicture}%
+ }%
+}
+
+\newcommand{\@pone}[2]{(-\@graphkey{point offset}+#1, \@graphkey{point offset}+#2)}
+\newcommand{\@ptwo}[2]{(\@graphkey{point offset}+#1, \@graphkey{point offset}+#2)}
+\newcommand{\@pthree}[2]{(-\@graphkey{point offset}+#1, -\@graphkey{point offset}+#2)}
+\newcommand{\@pfour}[2]{(\@graphkey{point offset}+#1, -\@graphkey{point offset}+#2)}
+
+\DeclareRobustCommand{\@playerordgraph}[5][]{%
+ % Ordinal rankings.
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \OR \lengthtest{#2 pt = #4 pt} \OR \lengthtest{#2 pt = #5 pt} \OR \lengthtest{#3 pt = #4 pt} \OR \lengthtest{#3 pt = #5 pt} \OR \lengthtest{#4 pt = #5 pt}}{
+ % DO NOTHING.
+ }{
+ \doublebubblesort{{#2}{#3}{#4}{#5}}{\order}{{-- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}}}{-- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}}}{-- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}}}{-- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}}}}{\nodes}
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \nodes;
+ }
+
+ % Triple Ties.
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#2 pt = #4 pt} \AND \lengthtest{#2 pt < #5 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#2 pt = #5 pt} \AND \lengthtest{#2 pt < #4 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#2 pt = #5 pt} \AND \lengthtest{#2 pt < #3 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt = #4 pt} \AND \lengthtest{#3 pt = #5 pt} \AND \lengthtest{#3 pt < #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ % Low Ties.
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#2 pt = #4 pt} \AND \lengthtest{#2 pt > #5 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#2 pt = #5 pt} \AND \lengthtest{#2 pt > #4 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#2 pt = #5 pt} \AND \lengthtest{#2 pt > #3 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt = #4 pt} \AND \lengthtest{#3 pt = #5 pt} \AND \lengthtest{#3 pt > #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ % Double Ties.
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#4 pt = #5 pt} \AND \lengthtest{#4 pt > #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#3 pt = #5 pt} \AND \lengthtest{#3 pt > #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #5 pt} \AND \lengthtest{#3 pt = #4 pt} \AND \lengthtest{#3 pt > #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#4 pt = #5 pt} \AND \lengthtest{#4 pt < #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#3 pt = #5 pt} \AND \lengthtest{#3 pt < #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #5 pt} \AND \lengthtest{#3 pt = #4 pt} \AND \lengthtest{#3 pt < #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ % High Ties
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt > #4 pt} \AND \lengthtest{#4 pt > #5 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt > #5 pt} \AND \lengthtest{#5 pt > #4 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#4 pt > #3 pt} \AND \lengthtest{#3 pt > #5 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#4 pt > #5 pt} \AND \lengthtest{#5 pt > #3 pt}}{
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#2 pt = #5 pt} \AND \lengthtest{#5 pt > #3 pt} \AND \lengthtest{#3 pt > #4 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #5 pt} \AND \lengthtest{#5 pt > #4 pt} \AND \lengthtest{#4 pt > #3 pt}}{
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt > #2 pt} \AND \lengthtest{#2 pt > #5 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt > #5 pt} \AND \lengthtest{#5 pt > #2 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#3 pt = #5 pt} \AND \lengthtest{#5 pt > #2 pt} \AND \lengthtest{#2 pt > #4 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt = #5 pt} \AND \lengthtest{#5 pt > #4 pt} \AND \lengthtest{#4 pt > #2 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#4 pt = #5 pt} \AND \lengthtest{#5 pt > #2 pt} \AND \lengthtest{#2 pt > #3 pt}}{
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#4 pt = #5 pt} \AND \lengthtest{#5 pt > #3 pt} \AND \lengthtest{#3 pt > #2 pt}}{
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ % Low Ties
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt < #4 pt} \AND \lengthtest{#4 pt < #5 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt < #5 pt} \AND \lengthtest{#5 pt < #4 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#4 pt < #3 pt} \AND \lengthtest{#3 pt < #5 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #4 pt} \AND \lengthtest{#4 pt < #5 pt} \AND \lengthtest{#5 pt < #3 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#2 pt = #5 pt} \AND \lengthtest{#5 pt < #3 pt} \AND \lengthtest{#3 pt < #4 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt = #5 pt} \AND \lengthtest{#5 pt < #4 pt} \AND \lengthtest{#4 pt < #3 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt < #2 pt} \AND \lengthtest{#2 pt < #5 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt < #5 pt} \AND \lengthtest{#5 pt < #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#3 pt = #5 pt} \AND \lengthtest{#5 pt < #2 pt} \AND \lengthtest{#2 pt < #4 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt = #5 pt} \AND \lengthtest{#5 pt < #4 pt} \AND \lengthtest{#4 pt < #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#4 pt = #5 pt} \AND \lengthtest{#5 pt < #2 pt} \AND \lengthtest{#2 pt < #3 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#4 pt = #5 pt} \AND \lengthtest{#5 pt < #3 pt} \AND \lengthtest{#3 pt < #2 pt}}{
+ \draw[{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[line width=\@graphkey{line width}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ % Mid Ties:
+ \ifthenelse{\lengthtest{#5 pt < #2 pt} \AND \lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt < #4 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#4 pt < #2 pt} \AND \lengthtest{#2 pt = #3 pt} \AND \lengthtest{#3 pt < #5 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#5 pt < #2 pt} \AND \lengthtest{#2 pt = #4 pt} \AND \lengthtest{#4 pt < #3 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt < #2 pt} \AND \lengthtest{#2 pt = #4 pt} \AND \lengthtest{#4 pt < #5 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#4 pt < #2 pt} \AND \lengthtest{#2 pt = #5 pt} \AND \lengthtest{#5 pt < #3 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#3 pt < #2 pt} \AND \lengthtest{#2 pt = #5 pt} \AND \lengthtest{#5 pt < #4 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#5 pt < #3 pt} \AND \lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt < #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt < #3 pt} \AND \lengthtest{#3 pt = #4 pt} \AND \lengthtest{#4 pt < #5 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#4 pt < #3 pt} \AND \lengthtest{#3 pt = #5 pt} \AND \lengthtest{#5 pt < #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt < #3 pt} \AND \lengthtest{#3 pt = #5 pt} \AND \lengthtest{#5 pt < #4 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+
+ \ifthenelse{\lengthtest{#3 pt < #4 pt} \AND \lengthtest{#4 pt = #5 pt} \AND \lengthtest{#5 pt < #2 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+ \ifthenelse{\lengthtest{#2 pt < #4 pt} \AND \lengthtest{#4 pt = #5 pt} \AND \lengthtest{#5 pt < #3 pt}}{
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pthree{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ \draw[-{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}, line width=\@graphkey{line width}, \@graphkey{player color}] \@pone{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@pfour{\@graphkey{player x offset}}{\@graphkey{player y offset}} -- \@ptwo{\@graphkey{player x offset}}{\@graphkey{player y offset}};
+ }{}
+}
+
+
+% Switch to tikzset
+\DeclareRobustCommand{\brgraph}[9][]{%
+\@setdefaultgraphkey%
+\tikzset{%
+ graph,%
+ point offset=0.38em,%
+ point color=.,%
+ point radius=0.06em,%
+ row player color=.,%
+ column player color=.,%
+ arrow width=0.25em,%
+ arrow length=0.35em,%
+ line width=0.05em,%
+ #1}%
+\raisebox{-0.34em}{%
+\begin{tikzpicture}
+ \path (-\@graphkey{point offset}-\@graphkey{arrow width},-\@graphkey{point offset}-\@graphkey{arrow width}) -- (\@graphkey{point offset}+\@graphkey{arrow width},\@graphkey{point offset}+\@graphkey{arrow width});
+
+ % Player 1.
+ % Player 2's Action 1.
+ \ifthenelse{\lengthtest{#2 pt > #4 pt}}{
+ \draw[
+ -{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]},
+ line width=\@graphkey{line width},
+ \@graphkey{row player color},
+ ] (-\@graphkey{point offset},-\@graphkey{point offset}) -- (-\@graphkey{point offset},+\@graphkey{point offset});
+ }{}
+ \ifthenelse{\lengthtest{#2 pt < #4 pt}}{
+ \draw[
+ {Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-,
+ line width=\@graphkey{line width},
+ \@graphkey{row player color},
+ ] (-\@graphkey{point offset},-\@graphkey{point offset}) -- (-\@graphkey{point offset},+\@graphkey{point offset});
+ }{}
+ % Player 2's Action 2.
+ \ifthenelse{\lengthtest{#3 pt > #5 pt}}{
+ \draw[
+ -{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]},
+ line width=\@graphkey{line width},
+ \@graphkey{row player color},
+ ] (+\@graphkey{point offset},-\@graphkey{point offset}) -- (+\@graphkey{point offset},+\@graphkey{point offset});
+ }{}
+ \ifthenelse{\lengthtest{#3 pt < #5 pt}}{
+ \draw[
+ {Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-,
+ line width=\@graphkey{line width},
+ \@graphkey{row player color},
+ ] (+\@graphkey{point offset},-\@graphkey{point offset}) -- (+\@graphkey{point offset},+\@graphkey{point offset});
+ }{}
+
+ % Player 2.
+ % Player 1's Action 1.
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{
+ \draw[
+ {Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-,
+ line width=\@graphkey{line width},
+ \@graphkey{column player color},
+ ] (-\@graphkey{point offset},+\@graphkey{point offset}) -- (+\@graphkey{point offset},+\@graphkey{point offset});
+ }{}
+ \ifthenelse{\lengthtest{#6 pt < #7 pt}}{
+ \draw[
+ -{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]},
+ line width=\@graphkey{line width},
+ \@graphkey{column player color},
+ ] (-\@graphkey{point offset},+\@graphkey{point offset}) -- (+\@graphkey{point offset},+\@graphkey{point offset});
+ }{}
+ % Player 1's Action 2.
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{
+ \draw[
+ {Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]}-,
+ line width=\@graphkey{line width},
+ \@graphkey{column player color},
+ ] (-\@graphkey{point offset},-\@graphkey{point offset}) -- (+\@graphkey{point offset},-\@graphkey{point offset});
+ }{}
+ \ifthenelse{\lengthtest{#8 pt < #9 pt}}{
+ \draw[
+ -{Latex[length=\@graphkey{arrow length},width=\@graphkey{arrow width}]},
+ line width=\@graphkey{line width},
+ \@graphkey{column player color},
+ ] (-\@graphkey{point offset},-\@graphkey{point offset}) -- (+\@graphkey{point offset},-\@graphkey{point offset});
+ }{}
+
+ \fill[\@graphkey{point color}] (-\@graphkey{point offset},-\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ \fill[\@graphkey{point color}] (-\@graphkey{point offset},+\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ \fill[\@graphkey{point color}] (+\@graphkey{point offset},-\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+ \fill[\@graphkey{point color}] (+\@graphkey{point offset},+\@graphkey{point offset}) circle[radius=\@graphkey{point radius}];
+\end{tikzpicture}%
+}%
+}
+
+\DeclareRobustCommand{\dominantbrgraph}[1][]{%
+ \brgraph[#1]{1}{1}{0}{0}{1}{0}{1}{0}}
+\DeclareRobustCommand{\coordinationbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{1}{1}{0}{0}{1}}
+\DeclareRobustCommand{\cyclebrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{1}{0}{1}{1}{0}}
+\DeclareRobustCommand{\samaritanbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{1}{1}{0}{1}{0}}
+\DeclareRobustCommand{\hazardbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{1}{0}{0}{1}{0}}
+\DeclareRobustCommand{\safetybrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{1}{1}{0}{0}{0}}
+\DeclareRobustCommand{\aidosbrgraph}[1][]{%
+ \brgraph[#1]{1}{1}{0}{0}{0}{0}{1}{0}}
+\DeclareRobustCommand{\picnicbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{0}{1}{0}{1}{0}}
+\DeclareRobustCommand{\daredevilbrgraph}[1][]{%
+ \brgraph[#1]{0}{1}{0}{0}{0}{0}{1}{0}}
+\DeclareRobustCommand{\fossickbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{0}{1}{0}{0}{0}}
+\DeclareRobustCommand{\heistbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{0}{0}{0}{1}{0}}
+\DeclareRobustCommand{\ignorancebrgraph}[1][]{%
+ \brgraph[#1]{1}{1}{0}{0}{0}{0}{0}{0}}
+\DeclareRobustCommand{\horseplaybrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{1}{0}{0}{0}{0}}
+\DeclareRobustCommand{\dressbrgraph}[1][]{%
+ \brgraph[#1]{1}{0}{0}{0}{0}{0}{0}{0}}
+\DeclareRobustCommand{\nullbrgraph}[1][]{%
+ \brgraph[#1]{0}{0}{0}{0}{0}{0}{0}{0}}
+
+
+\DeclareRobustCommand{\brname}[8]{%
+ \ifthenelse{\lengthtest{#3 pt > #1 pt}}{%
+ \def\rowa{01}%
+ }{%
+ \ifthenelse{\lengthtest{#3 pt < #1 pt}}{%
+ \def\rowa{10}%
+ }{%
+ \def\rowa{00}%
+ }%
+ }%
+ \ifthenelse{\lengthtest{#4 pt > #2 pt}}{%
+ \def\rowb{01}%
+ }{%
+ \ifthenelse{\lengthtest{#4 pt < #2 pt}}{%
+ \def\rowb{10}%
+ }{%
+ \def\rowb{00}%
+ }%
+ }%
+ \ifthenelse{\lengthtest{#6 pt > #5 pt}}{%
+ \def\cola{01}%
+ }{%
+ \ifthenelse{\lengthtest{#6 pt < #5 pt}}{%
+ \def\cola{10}%
+ }{%
+ \def\cola{00}%
+ }%
+ }%
+ \ifthenelse{\lengthtest{#8 pt > #7 pt}}{%
+ \def\colb{01}%
+ }{%
+ \ifthenelse{\lengthtest{#8 pt < #7 pt}}{%
+ \def\colb{10}%
+ }{%
+ \def\colb{00}%
+ }%
+ }%
+ \ifthenelse{%
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) %
+ }{Null}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) %
+ }{Dress}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) %
+ }{Horseplay}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{00}\) %
+ }{Ignorance}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) %
+ }{Dominant}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) %
+ }{Coordination}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) %
+ }{Cycle}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) %
+ }{Samaritan}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) %
+ }{Hazard}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{01}\) %
+ }{Safety}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) %
+ }{Aidos}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{10}\) %
+ }{Picnic}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) %
+ }{Daredevil}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) %
+ }{Fossick}{}%
+ \ifthenelse{%
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{01} \AND \equal{\rowb}{00} \AND \equal{\cola}{10} \AND \equal{\colb}{00}\) \OR %
+ \(\equal{\rowa}{10} \AND \equal{\rowb}{00} \AND \equal{\cola}{00} \AND \equal{\colb}{10}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{10} \AND \equal{\cola}{00} \AND \equal{\colb}{01}\) \OR %
+ \(\equal{\rowa}{00} \AND \equal{\rowb}{01} \AND \equal{\cola}{01} \AND \equal{\colb}{00}\) %
+ }{Heist}{}%
+}
+
+\DeclareRobustCommand{\jointgraph}[5][%
+ border color=.,%
+ color=.,%
+]{%
+ \tikzset{graph,#1}%
+ \raisebox{-0.15em}{%
+ \begin{tikzpicture}[anchor=center]
+ % Border.
+ \draw[draw=\@graphkey{border color},line width=0.02em] (-0.35em,-0.35em) rectangle (0.35em,0.35em);
+
+ % Joint.
+ \fill[fill=\@graphkey{color},opacity=#2] (-0.05em,0.05em) rectangle (-0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity=#3] (0.05em,0.05em) rectangle (0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity=#4] (-0.05em,-0.05em) rectangle (-0.3em, -0.3em);
+ \fill[fill=\@graphkey{color},opacity=#5] (0.05em,-0.05em) rectangle (0.3em, -0.3em);
+ \end{tikzpicture}%
+}}
+
+\DeclareRobustCommand{\rowcondgraph}[5][%
+ border color=.,%
+ color=.,%
+ row player color=.,%
+ column player color=.,%
+]{%
+ \@setdefaultgraphkey%
+ \tikzset{graph,#1}%
+ \raisebox{-0.15em}{%
+ \begin{tikzpicture}[anchor=center]
+ % Border.
+ \draw[draw=\@graphkey{border color},line width=0.02em] (-0.35em,-0.35em) rectangle (0.35em,0.35em);
+ \draw[draw=\@graphkey{column player color},line width=0.02em] (-0.35em,0.4em) -- (0.35em,0.4em);
+
+ % Joint.
+ \fill[fill=\@graphkey{color},opacity={#2 /(#2 + #3)}] (-0.05em,0.05em) rectangle (-0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity={#3 /(#2 + #3)}] (0.05em,0.05em) rectangle (0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity={#4 /(#4 + #5)}] (-0.05em,-0.05em) rectangle (-0.3em, -0.3em);
+ \fill[fill=\@graphkey{color},opacity={#5 /(#4 + #5)}] (0.05em,-0.05em) rectangle (0.3em, -0.3em);
+
+ % Marginal.
+ \fill[fill=\@graphkey{row player color},opacity={#2 + #3}] (-0.4em,0.05em) rectangle (-0.65em, 0.3em);
+ \fill[fill=\@graphkey{row player color},opacity={#3 + #5}] (-0.4em,-0.05em) rectangle (-0.65em, -0.3em);
+ \end{tikzpicture}%
+}}
+
+\DeclareRobustCommand{\colcondgraph}[5][%
+ border color=.,%
+ color=.,%
+ row player color=.,%
+ column player color=.,%
+]{%
+ \@setdefaultgraphkey%
+ \tikzset{graph,#1}%
+ \raisebox{-0.15em}{%
+ \begin{tikzpicture}[anchor=center]
+ % Border.
+ \draw[draw=\@graphkey{border color},line width=0.02em] (-0.35em,-0.35em) rectangle (0.35em,0.35em);
+ \draw[draw=\@graphkey{row player color},line width=0.02em] (-0.4em,-0.35em) -- (-0.4em,0.35em);
+
+ % Joint.
+ \fill[fill=\@graphkey{color},opacity={#2 /(#2 + #4)}] (-0.05em,0.05em) rectangle (-0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity={#3 /(#3 + #5)}] (0.05em,0.05em) rectangle (0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity={#4 /(#2 + #4)}] (-0.05em,-0.05em) rectangle (-0.3em, -0.3em);
+ \fill[fill=\@graphkey{color},opacity={#5 /(#3 + #5)}] (0.05em,-0.05em) rectangle (0.3em, -0.3em);
+
+ % Marginal.
+ \fill[fill=\@graphkey{column player color},opacity={#2 + #4}] (-0.05em,0.4em) rectangle (-0.3em, 0.65em);
+ \fill[fill=\@graphkey{column player color},opacity={#3 + #5}] (0.05em,0.4em) rectangle (0.3em, 0.65em);
+ \end{tikzpicture}%
+}}
+
+\DeclareRobustCommand{\marginalgraph}[5][]{%
+ \@setdefaultgraphkey%
+ \tikzset{%
+ graph,%
+ border color=.,%
+ color=.,%
+ row player color=.,%
+ column player color=.,%
+ #1}%
+ \raisebox{-0.15em}{%
+ \begin{tikzpicture}[anchor=center]
+ \draw[draw=\@graphkey{border color},line width=0.02em] (-0.35em,-0.35em) rectangle (0.35em,0.35em);
+
+ % Marginal.
+ \fill[fill=\@graphkey{row player color},opacity={#2 + #3}] (-0.4em,0.05em) rectangle (-0.65em, 0.3em);
+ \fill[fill=\@graphkey{row player color},opacity={#3 + #5}] (-0.4em,-0.05em) rectangle (-0.65em, -0.3em);
+
+ \fill[fill=\@graphkey{column player color},opacity={#2 + #4}] (-0.05em,0.4em) rectangle (-0.3em, 0.65em);
+ \fill[fill=\@graphkey{column player color},opacity={#3 + #5}] (0.05em,0.4em) rectangle (0.3em, 0.65em);
+ \end{tikzpicture}%
+}}
+
+\DeclareRobustCommand{\jmgraph}[5][]{%
+ \@setdefaultgraphkey%
+ \tikzset{
+ graph,%
+ border color=.,%
+ color=.,%
+ row player color=.,%
+ column player color=.,%
+ #1}%
+ \raisebox{-0.15em}{%
+ \begin{tikzpicture}[anchor=center]
+ % Border.
+ \draw[draw=\@graphkey{border color},line width=0.02em] (-0.35em,-0.35em) rectangle (0.35em,0.35em);
+
+ % Joint.
+ \fill[fill=\@graphkey{color},opacity=#2] (-0.05em,0.05em) rectangle (-0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity=#3] (0.05em,0.05em) rectangle (0.3em, 0.3em);
+ \fill[fill=\@graphkey{color},opacity=#4] (-0.05em,-0.05em) rectangle (-0.3em, -0.3em);
+ \fill[fill=\@graphkey{color},opacity=#5] (0.05em,-0.05em) rectangle (0.3em, -0.3em);
+
+ % Marginal.
+ \fill[fill=\@graphkey{column player color},opacity=#2+#4] (-0.05em,0.4em) rectangle (-0.3em, 0.65em);
+ \fill[fill=\@graphkey{column player color},opacity=#3+#5] (0.05em,0.4em) rectangle (0.3em, 0.65em);
+
+ \fill[fill=\@graphkey{row player color},opacity=#2+#3] (-0.4em,0.05em) rectangle (-0.65em, 0.3em);
+ \fill[fill=\@graphkey{row player color},opacity=#4+#5] (-0.4em,-0.05em) rectangle (-0.65em, -0.3em);
+ \end{tikzpicture}%
+}}
+
+
+% Switch to tikzset
+\DeclareRobustCommand{\payoffstable}[9][]{%
+ \@setdefaultgraphkey%
+ \tikzset{
+ graph,%
+ row player color=.,%
+ column player color=.,%
+ row player first strategy label=A,%
+ row player second strategy label=B,%
+ column player first strategy label=A,%
+ column player second strategy label=B,%
+ label=,%
+ #1}%
+ \begin{tabular}{c|cc}
+ \@graphkey{label} & {\color{\@graphkey{column player color}} \@graphkey{column player first strategy label}} & {\color{\@graphkey{column player color}} \@graphkey{column player second strategy label}} \\ \hline
+ {\color{\@graphkey{row player color}} \@graphkey{row player first strategy label}} & {\color{\@graphkey{row player color}}$#2$}, {\color{\@graphkey{column player color}}$#6$} & {\color{\@graphkey{row player color}}$#3$}, {\color{\@graphkey{column player color}}$#7$} \\
+ {\color{\@graphkey{row player color}} \@graphkey{row player second strategy label}} & {\color{\@graphkey{row player color}}$#4$}, {\color{\@graphkey{column player color}}$#8$} & {\color{\@graphkey{row player color}}$#5$}, {\color{\@graphkey{column player color}}$#9$} \\
+ \end{tabular}%
+}
+
+\DeclareRobustCommand{\brpayoffstable}[9][]{%
+ \payoffstable[#1,label={\brgraph[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}]{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
+}
+
+\DeclareRobustCommand{\ordpayoffstable}[9][]{%
+ \payoffstable[#1,label={\ordgraph[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}]{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
+}
+
+\DeclareRobustCommand{\smallpayoffstable}[9][]{%
+ \@setdefaultgraphkey%
+ \tikzset{%
+ graph,%
+ row player color=.,%
+ column player color=.,%
+ #1}%
+ \ifthenelse{\equal{\@graphkey{row player first strategy color}}{\empty}}{%
+ \def\rowacolor{\@graphkey{row player color}}%
+ }{%
+ \def\rowacolor{\@graphkey{row player first strategy color}}%
+ }%
+ \ifthenelse{\equal{\@graphkey{row player second strategy color}}{\empty}}{%
+ \def\rowbcolor{\@graphkey{row player color}}%
+ }{%
+ \def\rowbcolor{\@graphkey{row player second strategy color}}%
+ }%
+ \ifthenelse{\equal{\@graphkey{column player first strategy color}}{\empty}}{%
+ \def\columnacolor{\@graphkey{column player color}}%
+ }{%
+ \def\columnacolor{\@graphkey{column player first strategy color}}%
+ }%
+ \ifthenelse{\equal{\@graphkey{column player second strategy color}}{\empty}}{%
+ \def\columnbcolor{\@graphkey{column player color}}%
+ }{%
+ \def\columnbcolor{\@graphkey{column player second strategy color}}%
+ }%
+ $\begin{bsmallmatrix}{\color{\rowacolor}#2}, {\color{\columnacolor}#6}&{\color{\rowacolor}#3}, {\color{\columnbcolor}#7}\\{\color{\rowbcolor}#4}, {\color{\columnacolor}#8}&{\color{\rowbcolor}#5}, {\color{\columnbcolor}#9}\end{bsmallmatrix}$%
+}
+
+\DeclareRobustCommand{\jointtable}[5][]{%
+ \@setdefaultgraphkey%
+ \tikzset{%
+ graph,%
+ row player color=.,%
+ column player color=.,%
+ row player first strategy label=A,%
+ row player second strategy label=B,%
+ column player first strategy label=A,%
+ column player second strategy label=B,%
+ label=,%
+ #1}%
+ \begin{tabular}{c|cc}
+ \@graphkey{label} & {\color{\@graphkey{column player color}} \@graphkey{column player first strategy label}} & {\color{\@graphkey{column player color}} \@graphkey{column player second strategy label}} \\ \hline
+ {\color{\@graphkey{row player color}} \@graphkey{row player first strategy label}} & $#2$ & $#3$ \\
+ {\color{\@graphkey{row player color}} \@graphkey{row player second strategy label}} & $#4$ & $#5$ \\
+ \end{tabular}%
+}
+
+\DeclareRobustCommand{\jgjointtable}[5][%
+ row player color=.,%
+ column player color=.,%
+ row player first strategy label=A,%
+ row player second strategy label=B,%
+ column player first strategy label=A,%
+ column player second strategy label=B,%
+ label=,%
+]{%
+ \jointtable[#1,label={\jointgraph[#1]{#2}{#3}{#4}{#5}}]{#2}{#3}{#4}{#5}%
+}
+
+\DeclareRobustCommand{\rcgjointtable}[5][]{%
+ \jointtable[#1,label={\rowcondgraph[#1]{#2}{#3}{#4}{#5}}]{#2}{#3}{#4}{#5}%
+}
+
+\DeclareRobustCommand{\ccgjointtable}[5][]{%
+ \jointtable[#1,label={\colcondgraph[#1]{#2}{#3}{#4}{#5}}]{#2}{#3}{#4}{#5}%
+}
+
+\DeclareRobustCommand{\mgjointtable}[5][]{%
+ \jointtable[#1,label={\marginalgraph[#1]{#2}{#3}{#4}{#5}}]{#2}{#3}{#4}{#5}%
+}
+
+\DeclareRobustCommand{\jmgjointtable}[5][]{%
+ \jointtable[#1,label={\jmgraph[#1]{#2}{#3}{#4}{#5}}]{#2}{#3}{#4}{#5}%
+}
+
+\newcommand{\@classboundaries}{
+ % Main boundaries.
+ \addplot[color=black,opacity=0.1] coordinates {(-1.0,-0.75) (1,-0.75)};
+ \addplot[color=black,opacity=0.1] coordinates {(-1.0,-0.25) (1,-0.25)};
+ \addplot[color=black,opacity=0.1] coordinates {(-1.0,0.25) (1,0.25)};
+ \addplot[color=black,opacity=0.1] coordinates {(-1.0,0.75) (1,0.75)};
+
+ \addplot[color=black,opacity=0.1] coordinates {(-0.75,-1.0) (-0.75,1)};
+ \addplot[color=black,opacity=0.1] coordinates {(-0.25,-1.0) (-0.25,1)};
+ \addplot[color=black,opacity=0.1] coordinates {(0.25,-1.0) (0.25,1)};
+ \addplot[color=black,opacity=0.1] coordinates {(0.75,-1.0) (0.75,1)};
+
+ % Faint boundaries.
+ \addplot[color=black,opacity=0.1] coordinates {(-1.1,-0.75) (-1,-0.75)};
+ \addplot[color=black,opacity=0.1] coordinates {(1,-0.75) (1.1,-0.75)};
+ \addplot[color=black,opacity=0.1] coordinates {(-1.1,-0.25) (-1,-0.25)};
+ \addplot[color=black,opacity=0.1] coordinates {(1,-0.25) (1.1,-0.25)};
+ \addplot[color=black,opacity=0.1] coordinates {(-1.1,0.25) (-1,0.25)};
+ \addplot[color=black,opacity=0.1] coordinates {(1,0.25) (1.1,0.25)};
+ \addplot[color=black,opacity=0.1] coordinates {(-1.1,0.75) (-1,0.75)};
+ \addplot[color=black,opacity=0.1] coordinates {(1,0.75) (1.1,0.75)};
+
+ \addplot[color=black,opacity=0.1] coordinates {(-0.75,-1.1) (-0.75,-1)};
+ \addplot[color=black,opacity=0.1] coordinates {(-0.75,1.0) (-0.75,1.1)};
+ \addplot[color=black,opacity=0.1] coordinates {(-0.25,-1.1) (-0.25,-1)};
+ \addplot[color=black,opacity=0.1] coordinates {(-0.25,1.0) (-0.25,1.1)};
+ \addplot[color=black,opacity=0.1] coordinates {(0.25,-1.1) (0.25,-1)};
+ \addplot[color=black,opacity=0.1] coordinates {(0.25,1.0) (0.25,1.1)};
+ \addplot[color=black,opacity=0.1] coordinates {(0.75,-1.1) (0.75,-1)};
+ \addplot[color=black,opacity=0.1] coordinates {(0.75,1.0) (0.75,1.1)};
+}
+
+\newcommand{\@eqboundaries}{
+ % Fossick Equilibrium.
+ \addplot+[
+ only marks,
+ mark=*,
+ mark options={solid},
+ mark size=0.75pt,
+ color=black,
+ fill opacity=0.5,
+ draw opacity=0.0,
+ ]
+ coordinates {(0.25,0.25) (0.75,0.75) (-0.25,-0.75) (-0.75,-0.25)};
+
+ % Left equilibrium.
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.25,0.73) (-0.25,-0.23)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.75,0.23) (0.75,-0.73)};
+
+ % Top equilibrium.
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.73,0.75) (0.23,0.75)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.23,-0.25) (0.73,-0.25)};
+
+ % Right equilibrium.
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.25,1.0) (0.25,0.77)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.25,-0.27) (0.25,-1.0)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.75,1.0) (-0.75,0.27)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.75,-0.77) (-0.75,-1.0)};
+
+ % Bottom equilibrium.
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-1.0,0.25) (-0.27,0.25)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.77,0.25) (1.0,0.25)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-1.0,-0.75) (-0.77,-0.75)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.27,-0.75) (1.0,-0.75)};
+
+ % Three-equilibrium.
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.25,0.27) (0.25,0.75) (0.73,0.75)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.27,0.25) (0.75,0.25) (0.75,0.73)};
+
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.75,-0.27) (-0.75,-0.75) (-0.27,-0.75)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.73,-0.25) (-0.25,-0.25) (-0.25,-0.73)};
+
+ % Faint stuff.
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-1.1,-0.75) (-1,-0.75)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(1,-0.75) (1.1,-0.75)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-1.1,0.25) (-1,0.25)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(1,0.25) (1.1,0.25)};
+
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.75,-1.1) (-0.75,-1)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(-0.75,1.0) (-0.75,1.1)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.25,-1.1) (0.25,-1)};
+ \addplot[color=black,style=semithick,opacity=0.5] coordinates {(0.25,1.0) (0.25,1.1)};
+}
+
+\newcommand{\@brgraphs}{
+ \begin{pgfinterruptboundingbox}
+ \foreach \x / \xtl / \xtr / \xbl / \xbr in {
+ -1.0 / -1 / -1 / 1 / 1,
+ -0.75 / -1 / 0 / 1 / 0,
+ -0.5 / -1 / 1 / 1 / -1,
+ -0.25 / 0 / 1 / 0 / -1,
+ 0.0 / 1 / 1 / -1 / -1,
+ 0.25 / 1 / 0 / -1 / 0,
+ 0.5 / 1 / -1 / -1 / 1,
+ 0.75 / 0 / -1 / 0 / 1,
+ 1.0 / -1 / -1 / 1 / 1
+ }
+ {
+ \foreach \y / \ytl / \ytr / \ybl / \ybr in {
+ -1.0 / -1 / 1 / -1 / 1,
+ -0.75 / -1 / 1 / 0 / 0,
+ -0.5 / -1 / 1 / 1 / -1,
+ -0.25 / 0 / 0 / 1 / -1,
+ 0.0 / 1 / -1 / 1 / -1,
+ 0.25 / 1 / -1 / 0 / 0,
+ 0.5 / 1 / -1 / -1 / 1,
+ 0.75 / 0 / 0 / -1 / 1,
+ 1.0 / -1 / 1 / -1 / 1
+ }
+ {
+ \node[text=\embeddingkey{best-response graph color}] at (\x * \halfaxislength,\y * \halfaxislength) [] {\embeddingkey{best-response graph font size}\brgraph{\xtl}{\xtr}{\xbl}{\xbr}{\ytl}{\ytr}{\ybl}{\ybr}};
+ }
+ }
+ \end{pgfinterruptboundingbox}
+}
+
+\newcommand{\@brnames}{
+ \begin{pgfinterruptboundingbox}
+ \foreach \x / \xtl / \xtr / \xbl / \xbr in {
+ -1.0 / -1 / -1 / 1 / 1,
+ -0.75 / -1 / 0 / 1 / 0,
+ -0.5 / -1 / 1 / 1 / -1,
+ -0.25 / 0 / 1 / 0 / -1,
+ 0.0 / 1 / 1 / -1 / -1,
+ 0.25 / 1 / 0 / -1 / 0,
+ 0.5 / 1 / -1 / -1 / 1,
+ 0.75 / 0 / -1 / 0 / 1,
+ 1.0 / -1 / -1 / 1 / 1
+ }
+ {
+ \foreach \y / \ytl / \ytr / \ybl / \ybr in {
+ -1.0 / -1 / 1 / -1 / 1,
+ -0.75 / -1 / 1 / 0 / 0,
+ -0.5 / -1 / 1 / 1 / -1,
+ -0.25 / 0 / 0 / 1 / -1,
+ 0.0 / 1 / -1 / 1 / -1,
+ 0.25 / 1 / -1 / 0 / 0,
+ 0.5 / 1 / -1 / -1 / 1,
+ 0.75 / 0 / 0 / -1 / 1,
+ 1.0 / -1 / 1 / -1 / 1
+ }
+ {
+ \node[label={[label distance=\embeddingkey{best-response name distance}, text=\embeddingkey{best-response name color}]\embeddingkey{best-response name orientation}:{\embeddingkey{best-response name font size}\brname{\xtl}{\xtr}{\xbl}{\xbr}{\ytl}{\ytr}{\ybl}{\ybr}}}] at (\x * \halfaxislength,\y * \halfaxislength) {};
+ }
+ }
+ \end{pgfinterruptboundingbox}
+}
+
+\newif\ifpartialtrivial
+\newif\ifsymmetricstrategies
+\newif\ifsymmetricplayers
+\newif\ifnoclassboundaries
+\newif\ifnoeqboundaries
+\newif\ifnobrgraphs
+\newif\ifnobrnames
+\newif\ifnoaxeslabels
+\newif\ifnoticklabels
+\newcommand{\@setdefaultembeddingkey}{%
+ \tikzset{
+ embedding/.is family,
+ embedding,
+ width/.initial=\linewidth,
+ image/.initial=,
+ matrix/.initial=,
+ points/.initial=,
+ axis color/.initial=black,
+ partial trivial/.is if=partialtrivial,
+ symmetric strategies/.is if=symmetricstrategies,
+ symmetric players/.is if=symmetricplayers,
+ no class boundaries/.is if=noclassboundaries,
+ no equilibrium boundaries/.is if=noeqboundaries,
+ no best-response graphs/.is if=nobrgraphs,
+ best-response graph color/.initial=black,
+ best-response graph font size/.initial=\scriptsize,
+ no best-response names/.is if=nobrnames,
+ best-response name orientation/.initial=-90,
+ best-response name distance/.initial=-0.1em,
+ best-response name color/.initial=black!70,
+ best-response name font size/.initial=\tiny,
+ no axes labels/.is if=noaxeslabels,
+ no tick labels/.is if=noticklabels,
+ }%
+}
+\@setdefaultembeddingkey
+\newcommand{\embeddingkey}[1]{\pgfkeysvalueof{/tikz/embedding/#1}}
+
+\DeclareRobustCommand{\nontrivialembedding}[1][]{%
+ \@setdefaultembeddingkey%
+ \tikzset{embedding,#1}%
+ \ifpartialtrivial%
+ \pgfmathsetlengthmacro{\axislength}{\embeddingkey{width}*0.792}% 0.9*0.88
+ \else
+ \pgfmathsetlengthmacro{\axislength}{\embeddingkey{width}*0.9}%
+ \fi
+ \pgfmathsetlengthmacro{\halfaxislength}{\axislength*0.5}%
+ \ifsymmetricplayers \else \ifsymmetricstrategies \else
+ \begin{tikzpicture}[
+ /pgfplots/y=\halfaxislength,
+ /pgfplots/x=\halfaxislength
+ ]%
+ \begin{axis}[
+ anchor=origin,
+ axis lines = middle,
+ xmin=-1.1, xmax=+1.1,
+ ymin=-1.1, ymax=+1.1,
+ xticklabels=\ifnoticklabels\empty\else{$-\pi$,$+\pi$}\fi,
+ xtick={-1.0,+1.0},
+ yticklabels=\ifnoticklabels\empty\else{$-\pi$,$+\pi$}\fi,
+ ytick={-1.0,+1.0},
+ x tick label style={yshift={-0.5em}},
+ xlabel =\ifnoaxeslabels\empty\else{$\theta_r$}\fi,
+ ylabel = \ifnoaxeslabels\empty\else{$\theta_c$}\fi,
+ xmajorgrids=true,
+ ymajorgrids=true,
+ axis line style={%
+ \embeddingkey{axis color},%
+ opacity=0.2,%
+ },
+ grid style={%
+ dashed,%
+ black,%
+ opacity=0.2,%
+ },
+ axis on top,
+ ]
+ \ifthenelse{\equal{\embeddingkey{image}}{}}{}{%
+ \node[inner sep=0pt] (mxm) at (axis cs:0,0) {%
+ \includegraphics[width=\axislength]{\embeddingkey{image}}};
+ }
+ \ifthenelse{\equal{\embeddingkey{matrix}}{}}{}{%
+ \addplot[
+ matrix plot*,%
+ point meta=explicit,%
+ ] file[]{\embeddingkey{matrix}};
+ }
+ \ifthenelse{\equal{\embeddingkey{points}}{}}{}{%
+ \addplot[%
+ scatter,%
+ only marks,%
+ mark size=0.1em,%
+ scatter src=explicit,%
+ scatter/use mapped color={draw opacity=0,fill=mapped color},%
+ ] table[x=pitheta1,y=pitheta2,meta=color]{\embeddingkey{points}};
+ }
+ \ifnoclassboundaries \else \@classboundaries \fi
+ \ifnoeqboundaries \else \@eqboundaries \fi
+ \end{axis}%
+ \ifnobrgraphs \else \@brgraphs \fi
+ \ifnobrnames \else \@brnames \fi
+ \end{tikzpicture}%
+ \fi \fi%
+}
+
+
+% Assume that the final width of a plot has an additional bias.
+% measuredWidth = candidateWidth + bias
+%
+% Try an initial guess using the targetWidth.
+% measuredWidth = targetWidth + bias
+%
+% What candidateWidth will result in the targetWidth?
+% targetWidth = candidateWidth + bias
+% candidateWidth = targetWidth - bias
+% = targetWidth - (targetWidth + measuredWidth)
+% = 2*targetWidth - measuredWidth
+\newsavebox{\@candidateBox}
+\newcommand{\@reWidthToTargetWidth}[2]{%
+ \pgfmathsetmacro{\@targetWidth}{#2}%
+ \pgfmathsetmacro{\@setWidth}{#2}%
+ \begin{lrbox}{\@candidateBox}{\tikzset{external/export=false}#1}\end{lrbox}%
+ \pgfmathsetmacro{\@setWidth}{2*\@targetWidth-\wd\@candidateBox}%
+ #1%
+}
+\newcommand{\@reScaleToTargetWidth}[2]{%
+ \pgfmathsetmacro{\@targetWidth}{#2}%
+ \pgfmathsetmacro{\@setWidth}{#2}%
+ \pgfmathsetmacro{\@setScale}{4}%
+ \begin{lrbox}{\@candidateBox}{\tikzset{external/export=false}#1}\end{lrbox}%
+ \pgfmathsetmacro{\@setScale}{\@setScale*\@targetWidth/\wd\@candidateBox}%
+ #1%
+}
+
+\newcommand{\@setdefaultmarginalsimplexkey}{%
+ \tikzset{
+ marginalsimplex/.is family,
+ marginalsimplex,
+ width/.initial=\linewidth,
+ scale/.initial=1.0,
+ row player label/.initial={\footnotesize Row Player},%
+ column player label/.initial={\footnotesize Column Player},%
+ row player first strategy label/.initial={\footnotesize A},%
+ row player second strategy label/.initial={\footnotesize B},%
+ column player first strategy label/.initial={\footnotesize A},%
+ column player second strategy label/.initial={\footnotesize B},%
+ points/.initial=,
+ regions/.initial=,
+ contour/.initial=,
+ heatmap/.initial=,
+ quiver/.initial=,
+ quiver scale arrows/.initial=0.1,
+ streams/.initial=,
+ }%
+}
+\@setdefaultmarginalsimplexkey
+\newcommand{\marginalsimplexkey}[1]{\pgfkeysvalueof{/tikz/marginalsimplex/#1}}
+
+\DeclareRobustCommand{\marginalsimplex}[1][]{%
+ \tikzset{marginalsimplex,#1} % Process Keys passed to command
+ \@reWidthToTargetWidth{\marginalsimplexIMPL[#1]}{\marginalsimplexkey{width}}%
+ \@setdefaultmarginalsimplexkey%
+}
+
+\DeclareRobustCommand{\marginalsimplexIMPL}[1][]{%
+ \begin{tikzpicture}[
+ /pgfplots/y=\@setWidth,
+ /pgfplots/x=\@setWidth
+ ]%
+ \begin{axis}[
+ anchor=origin,
+ axis y line=middle,
+ axis x line=middle,
+ axis line style={-},
+ xmin=-0.0, xmax=+1.0,
+ ymin=-0.0, ymax=+1.0,
+ xmajorticks=false,
+ ymajorticks=false,
+ xtick={0.0,+1.0},
+ ytick={0.0,+1.0},
+ xlabel = {\marginalsimplexkey{column player label}},
+ ylabel = {\marginalsimplexkey{row player label}},
+ x label style={at={(axis description cs:0.5,-0.0)},anchor=north},
+ y label style={at={(axis description cs:-0.0,.5)},rotate=90,anchor=south},
+ xmajorgrids=true,
+ ymajorgrids=true,
+ scaled ticks=false,
+ xtick style={black},
+ ytick style={black},
+ grid style={%
+ solid,%
+ black,%
+ },
+ axis on top,
+ after end axis/.code={
+ \path (axis cs:0,0)
+ node [anchor=east] {\marginalsimplexkey{row player second strategy label}}
+ node [anchor=north] {\marginalsimplexkey{column player second strategy label}};
+ \path (axis cs:0,1)
+ node [anchor=east] {\marginalsimplexkey{row player first strategy label}};
+ \path (axis cs:1,0)
+ node [anchor=north] {\marginalsimplexkey{column player first strategy label}};
+ },
+ view={0}{90},
+ ]
+ \tikzset{marginalsimplex,#1}
+ \ifthenelse{\equal{\marginalsimplexkey{quiver}}{}}{}{%
+ % First (Row) player is y[j], v[j,:]
+ % Second (Column) player is x[j], u[:,i]
+ % u and v are indexed [y,x]
+ \addplot[
+ quiver={
+ u=\thisrow{u},
+ v=\thisrow{v},
+ w=1,% 3 looked strange...
+ scale arrows=\marginalsimplexkey{quiver scale arrows},
+ },
+ -stealth,
+ black,
+ ] table {\marginalsimplexkey{quiver}};
+ }
+ \ifthenelse{\equal{\marginalsimplexkey{heatmap}}{}}{}{%
+ \addplot[
+ matrix plot*,%
+ point meta=explicit,%
+ ] file[]{\marginalsimplexkey{heatmap}};
+ }
+ \ifthenelse{\equal{\marginalsimplexkey{points}}{}}{}{%
+ \addplot[%
+ scatter,%
+ only marks,%
+ mark size=0.1em,%
+ scatter src=explicit,%
+ scatter/use mapped color={draw opacity=0,fill=mapped color},%
+ ] table[x=x,y=y,meta=c]{\marginalsimplexkey{points}};
+ }
+ \end{axis}%
+ \end{tikzpicture}%
+}
+
+
+\newif\ifdebugname
+\newif\ifdebugaxes
+\newif\ifdebugcamera
+\newcommand{\@setdefaultpolytopekey}{%
+ \tikzset{
+ polytope/.is family,
+ polytope,
+ width/.initial=\linewidth,
+ ne color/.initial=blue,
+ ce color/.initial=purple,
+ row player first strategy label/.initial={\scriptsize A},%
+ row player second strategy label/.initial={\scriptsize B},%
+ column player first strategy label/.initial={\scriptsize A},%
+ column player second strategy label/.initial={\scriptsize B},%
+ rotate x/.initial=60,%
+ rotate z/.initial=35,%
+ debug name/.is if=debugname,%
+ debug axes/.is if=debugaxes,%
+ debug camera/.is if=debugcamera,%
+ }%
+}
+\@setdefaultpolytopekey
+\newcommand{\@polytopekey}[1]{\pgfkeysvalueof{/tikz/polytope/#1}}
+
+
+\pgfmxfpdeclarefunction{barytocartx}{4}{
+ {(#1 * -0.5) + (#2 * 0.5) + (#3 * 0) + (#4 * 0)}
+}
+\pgfmxfpdeclarefunction{barytocarty}{4}{
+ {(#1 * -sqrt(3)/6) + (#2 * -sqrt(3)/6) + (#3 * sqrt(3)/3) + (#4 * 0)}
+}
+\pgfmxfpdeclarefunction{barytocartz}{4}{
+ {(#1 * -sqrt(6)/12) + (#2 * -sqrt(6)/12) + (#3 * -sqrt(6)/12) + (#4 * sqrt(6)/4)}
+}
+
+\DeclareRobustCommand{\polytope}[9][]{%
+ \tikzset{polytope,#1}%
+ \@reScaleToTargetWidth{\polytopeIMPL[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}{\@polytopekey{width}}%
+ \@setdefaultpolytopekey%
+}
+
+\DeclareRobustCommand{\polytopeIMPL}[9][]{%
+ \tdplotsetmaincoords{\@polytopekey{rotate x}}{\@polytopekey{rotate z}}%
+ \begin{tikzpicture}[
+ scale=\@setScale,%
+ tdplot_main_coords,%
+ ]%
+ % Process keys here to allow caching to update.
+ \tikzset{polytope,#1}
+
+ % Simplex points.
+ \pgfmathsetlengthmacro{\ox}{{0.0}}
+ \pgfmathsetlengthmacro{\oy}{{0.0}}
+ \pgfmathsetlengthmacro{\oz}{{0.0}}
+
+ \pgfmathsetlengthmacro{\aax}{{ -0.5}}
+ \pgfmathsetlengthmacro{\aay}{{-sqrt(3)/6}}
+ \pgfmathsetlengthmacro{\aaz}{{-sqrt(6)/12}}
+
+ \pgfmathsetlengthmacro{\abx}{{0.5}}
+ \pgfmathsetlengthmacro{\aby}{{-sqrt(3)/6}}
+ \pgfmathsetlengthmacro{\abz}{{-sqrt(6)/12}}
+
+ \pgfmathsetlengthmacro{\bax}{{0.0}}
+ \pgfmathsetlengthmacro{\bay}{{sqrt(3)/3}}
+ \pgfmathsetlengthmacro{\baz}{{-sqrt(6)/12}}
+
+ \pgfmathsetlengthmacro{\bbx}{{0.0}}
+ \pgfmathsetlengthmacro{\bby}{{0.0}}
+ \pgfmathsetlengthmacro{\bbz}{{sqrt(6)/4}}
+
+ \@perspectiveline[line width scale=0.4, layer scale=1.1]{\aax}{\aay}{\aaz}{\abx}{\aby}{\abz}
+ \@perspectiveline[line width scale=0.4, layer scale=1.1]{\aax}{\aay}{\aaz}{\bax}{\bay}{\baz}
+ \@perspectiveline[line width scale=0.4, layer scale=1.1]{\aax}{\aay}{\aaz}{\bbx}{\bby}{\bbz}
+ \@perspectiveline[line width scale=0.4, layer scale=1.1]{\abx}{\aby}{\abz}{\bax}{\bay}{\baz}
+ \@perspectiveline[line width scale=0.4, layer scale=1.1]{\abx}{\aby}{\abz}{\bbx}{\bby}{\bbz}
+ \@perspectiveline[line width scale=0.4, layer scale=1.1]{\bax}{\bay}{\abz}{\bbx}{\bby}{\bbz}
+
+ \ifdebugaxes
+ \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
+ \draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
+ \draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
+ \else \fi
+
+ \point[%
+ color=black,size=0pt,%
+ label=\@polytopekey{row player first strategy label}\@polytopekey{column player first strategy label},%
+ label position=below,%
+ ]{1}{0}{0}{0}
+ \point[%
+ color=black,size=0pt,%
+ label=\@polytopekey{row player first strategy label}\@polytopekey{column player second strategy label},%
+ ]{0}{1}{0}{0}
+ \point[%
+ color=black,size=0pt,%
+ label=\@polytopekey{row player second strategy label}\@polytopekey{column player first strategy label},%
+ ]{0}{0}{1}{0}
+ \point[%
+ color=black,size=0pt,%
+ label=\@polytopekey{row player second strategy label}\@polytopekey{column player second strategy label},%
+ ]{0}{0}{0}{1}
+
+ \ifdebugcamera
+ \@cameraline{}
+ \else \fi
+
+ \eqpolytope[]{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}
+ \end{tikzpicture}%
+}
+
+% REMOVE ME?
+\newcommand{\@setdefaulteqpolytopekey}{%
+ \tikzset{
+ eqpolytope/.is family,
+ eqpolytope,
+ }%
+}
+\@setdefaulteqpolytopekey
+\newcommand{\@eqpolytopekey}[1]{\pgfkeysvalueof{/tikz/eqpolytope/#1}}
+\DeclareRobustCommand{\eqpolytope}[9][]{%
+ \tikzset{eqpolytope,#1}
+
+ % Scale macros.
+ \pgfmathsetmacro{\scola}{{abs(#2 - #4)}} % scale col first, |g_1^{A-B,A}|
+ \pgfmathsetmacro{\scolb}{{abs(#3 - #5)}} % scale col second, |g_1^{A-B,B}|
+ \pgfmathsetmacro{\srowa}{{abs(#6 - #7)}} % scale col first, |g_2^{A,A-B}|
+ \pgfmathsetmacro{\srowb}{{abs(#8 - #9)}} % scale col second, |g_2^{B,A-B}|
+
+ \pgfmathsetmacro{\saa}{\srowa * \scola}
+ \pgfmathsetmacro{\sab}{\srowa * \scolb}
+ \pgfmathsetmacro{\sba}{\srowb * \scola}
+ \pgfmathsetmacro{\sbb}{\srowb * \scolb}
+
+ % \@setScaling{1.0}{1.0}{1.0}{1.0} % Default scaling.
+
+ \ifthenelse{\lengthtest{#2 pt = #4 pt}}{%#2 = #4
+ \ifthenelse{\lengthtest{#3 pt = #5 pt}}{%#3 = #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % eeee
+ % Zero,Null
+ \ifdebugname
+ \point[label=eeee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{0}{1}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{0}{0}{1}
+
+ % NE
+ \def\n{6}
+ \foreach \i in {0,...,\n} {
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1*\i/\n}{0}{1 - 1*\i/\n}{0}{0}{1*\i/\n}{0}{1 - 1*\i/\n}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1*\i/\n}{1-1*\i/\n}{0}{0}{0}{0}{1*\i/\n}{1-1*\i/\n}
+ }
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % eeeg
+ \ifdebugname
+ \point[label=eeeg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{1}{0}{0}{0}
+ }{%#8 < #9
+ % eeel
+ \ifdebugname
+ \point[label=eeel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{1}{0}{0}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % eege
+ \ifdebugname
+ \point[label=eege]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{0}{1}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % eegg
+ \ifdebugname
+ \point[label=eegg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ }{%#8 < #9
+ % eegl
+ \ifdebugname
+ \point[label={eegl}]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0}{0.5}{0}
+ \@setBaryPointsB{0.0}{0.5}{0.0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.0}{0.5}{0.0}{0.5}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{0.5}{0.0}{0.5}{0.0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0.5}{0}{0.5}{0}
+ \@setBaryPointsB{0.0}{0.5}{0.0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0.0}{0.5}{0.0}{0.5}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % eele
+ \ifdebugname
+ \point[label=eele]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{1}{0}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % eelg
+ % Horseplay
+ \ifdebugname
+ \point[label=eelg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ %
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0.5}{0}{0.5}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0}{0.5}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0.5}{0}{0.5}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0}{0.5}{0}{0.5}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0.5}{0}{0.5}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{%#8 < #9
+ % eell
+ % Ignorance.
+ \ifdebugname
+ \point[label=eell]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{0}{0}{0}{1}
+ }
+ }
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#3 pt > #5 pt}}{%#3 > #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % egee
+ \ifdebugname
+ \point[label=egee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{1}{0}{0}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % egeg
+ \ifdebugname
+ \point[label=egeg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{1}{0}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{1}{0}{0}{0}
+ }{%#8 < #9
+ % egel
+ % Heist
+ \ifdebugname
+ \point[label=egel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % egge
+ \ifdebugname
+ \point[label=egge]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % eggg
+ \ifdebugname
+ \point[label=eggg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ }{%#8 < #9
+ % eggl
+ \ifdebugname
+ \point[label=eggl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % egle
+ \ifdebugname
+ \point[label=egle]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{1}{0}
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % eglg
+ \ifdebugname
+ \point[label=eglg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0}{0.5}{0}
+ \@setBaryPointsB{0}{1}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}
+ }{%#8 < #9
+ % egll
+ \ifdebugname
+ \point[label=egll]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{1}{0}{0}%(C)CE
+ }
+ }
+ }
+ }
+ }{%#3 < #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % elee
+ \ifdebugname
+ \point[label=elee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{0}{1}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % eleg
+ \ifdebugname
+ \point[label=eleg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ }{%#8 < #9
+ % elel
+ \ifdebugname
+ \point[label=elel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % elge
+ \ifdebugname
+ \point[label=elge]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{0}{1}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % elgg
+ \ifdebugname
+ \point[label=llgg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{0}{1}{0}
+ }{%#8 < #9
+ % elgl
+ \ifdebugname
+ \point[label=elgl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0}{0.5}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % elle
+ % Heist.
+ \ifdebugname
+ \point[label=elle]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % ellg
+ \ifdebugname
+ \point[label=ellg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{0.5}{0.5}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{%#8 < #9
+ % elll
+ \ifdebugname
+ \point[label=elll]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{0}{1}%(C)CE
+ }
+ }
+ }
+ }
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#2 pt > #4 pt}}{%#2 > #4
+ \ifthenelse{\lengthtest{#3 pt = #5 pt}}{%#3 = #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % geee
+ \ifdebugname
+ \point[label=geee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{1}{0}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % geeg
+ %Heist.
+ \ifdebugname
+ \point[label=geeg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ }{%#8 < #9
+ % geel
+ \ifdebugname
+ \point[label=geel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{1}{0}{0}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % gege
+ \ifdebugname
+ \point[label=gege]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{0}{0}{1}
+
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % gegg
+ \ifdebugname
+ \point[label=gegg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{1}{0}{0}{0}%(C)CE
+ }{%#8 < #9
+ % gegl
+ \ifdebugname
+ \point[label=gegl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0.5}{0}{0.5}
+ \@setBaryPointsB{1}{0}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % gele
+ % Heist.
+ \ifdebugname
+ \point[label=gele]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % gelg
+ \ifdebugname
+ \point[label=gelg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{%#8 < #9
+ % gell
+ % Aidous
+ \ifdebugname
+ \point[label=gell]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{0}{0}{0}{1}
+ }
+ }
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#3 pt > #5 pt}}{%#3 > #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % ggee
+ \ifdebugname
+ \point[label=ggee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % ggeg
+ % Aidos
+ \ifdebugname
+ \point[label=ggeg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ }{%#8 < #9
+ % ggel
+ % Aidos
+ \ifdebugname
+ \point[label=ggel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{1}{0}{0}{0}{0}{1}{0}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{1}{0}{0}{0}{0}{1}{0}{0}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % ggge
+ \ifdebugname
+ \point[label=ggge]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{1}{0}{0}{0}%(C)CE
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % gggg
+ \ifdebugname
+ \point[label=gggg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{1}{0}{0}{0}%(C)CE
+ }{%#8 < #9
+ % gggl
+ \ifdebugname
+ \point[label=gggl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{1}{0}{0}{0}%(C)CE
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % ggle
+ \ifdebugname
+ \point[label=ggle]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{1}{0}{0}%(C)CE
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % gglg
+ \ifdebugname
+ \point[label=gglg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{1}{0}{0}%(C)CE
+ }{%#8 < #9
+ % ggll
+ \ifdebugname
+ \point[label=ggll]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{1}{0}{0}%(C)CE
+ }
+ }
+ }
+ }
+ }{%#3 < #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % glee
+ \ifdebugname
+ \point[label=glee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0.5}{0}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{0.5}{0.5}{0}{0.0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0.5}{0.5}{0}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % gleg
+ % Hazard.
+ \ifdebugname
+ \point[label=gleg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{%#8 < #9
+ % glel
+ \ifdebugname
+ \point[label=glel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0.5}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % glge
+ \ifdebugname
+ \point[label=glge]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{1}{0}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % glgg
+ \ifdebugname
+ \point[label=glgg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{1}{0}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{1}{0}{0}{0}%(C)CE
+ }{%#8 < #9
+ % glgl
+ % Diagonal Coordination.
+ \ifdebugname
+ \point[label=glgl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\saa}{\sab}{\sba}{\sbb}
+
+ % (C)CE
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{1/3}{0}{1/3}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{1/3}{1/3}{0}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{1}{0}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{1/3}{1/3}{0}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{1/3}{1/3}{0}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{1/3}{0}{1/3}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{1/3}{0}{1/3}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@setBaryPointsB{0}{0}{0}{1}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{1}{0}{0}{0}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % glle
+ \ifdebugname
+ \point[label=glle]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % gllg
+ % Clockwise cycle
+ \ifdebugname
+ \point[label=gllg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % NE and (C)CE
+ \@setScaling{\saa}{\sab}{\sba}{\sbb}
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+ \@scaledPointA[color=\@polytopekey{ce color},size=2pt]
+ }{%#8 < #9
+ % glll
+ \ifdebugname
+ \point[label=glll]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{0}{1}%(C)CE
+ }
+ }
+ }
+ }
+ }
+ }
+ }{%#2 < #4
+ \ifthenelse{\lengthtest{#3 pt = #5 pt}}{%#3 = #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % leee
+ \ifdebugname
+ \point[label=leee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{0}{1}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % leeg
+ \ifdebugname
+ \point[label=leeg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{1}{0}
+ % NE
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ }{%#8 < #9
+ % leel
+ % Heist
+ \ifdebugname
+ \point[label=leel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{0}{0}{0}{1}
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % lege
+ % Heist
+ \ifdebugname
+ \point[label=lege]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % legg
+ \ifdebugname
+ \point[label=legg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{1}{0}%(C)CE
+ }{%#8 < #9
+ % legl
+ \ifdebugname
+ \point[label=legl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{0}{0}{1}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % lele
+ \ifdebugname
+ \point[label=lele]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{0}{1}{0}{0}{1}{0}
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{1}{0}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{1}{0}{0}
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{0}{1}{0}{0}{1}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % lelg
+ \ifdebugname
+ \point[label=lelg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\srowa}{\srowa}{\srowb}{\srowb}
+
+ % (C)CE
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0.5}{0}{0.5}
+ \@setBaryPointsB{0}{1}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0.5}{0}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}
+ }{%#8 < #9
+ % lell
+ % Aidos
+ \ifdebugname
+ \point[label=lell]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{1}{0}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{1}{0}{0}{0}{0}{0}{1}
+ }
+ }
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#3 pt > #5 pt}}{%#3 > #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % lgee
+ % Horseplay
+ \ifdebugname
+ \point[label=lgee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{0.5}{0}{0}
+ \@setBaryPointsB{0}{1}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{0}{1}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \@setBaryPointsA{0.5}{0.5}{0}{0}
+ \@setBaryPointsB{0}{1}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % lgeg
+ \ifdebugname
+ \point[label=lgeg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.5}{.5}{0}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}
+
+ }{%#8 < #9
+ % lgel
+ \ifdebugname
+ \point[label=lgel]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0.5}{0.5}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % lgge
+ \ifdebugname
+ \point[label=lgge]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE / NE Edges.
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % lggg
+ \ifdebugname
+ \point[label=lggg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{1}{0}%(C)CE
+ }{%#8 < #9
+ % lggl
+ % Anti-clockwise Cycle.
+ \ifdebugname
+ \point[label=lggl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % NE
+ \@setScaling{\saa}{\sab}{\sba}{\sbb}
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+ \@scaledPointA[color=\@polytopekey{ce color},size=2pt]
+ }
+ }
+ }{%#3 < #5
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % lgle
+ \ifdebugname
+ \point[label=lgle]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\scola}{\scolb}{\scola}{\scolb}
+
+ % (C)CE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{0.5}{0.5}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{0}{0.5}{0.5}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ne color},line style=dotted]
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % lglg
+ % Off-Diagonal Coordination.
+ \ifdebugname
+ \point[label=lglg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % Scaling.
+ \@setScaling{\saa}{\sab}{\sba}{\sbb}
+
+ % (C)CE
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{0}{1/3}{1/3}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{1/3}{1/3}{1/3}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{0}{1}{0}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{1/3}{1/3}{1/3}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{1/3}{1/3}{1/3}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@setBaryPointsB{0}{1/3}{1/3}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{1/3}{1/3}{1/3}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@setBaryPointsB{0}{0}{1}{0}
+ \@scaledBaryPerspectiveLineAB[color=\@polytopekey{ce color}]
+
+ % NE
+ \@setBaryPointsA{0}{1}{0}{0}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+
+ \@setBaryPointsA{0}{0}{1}{0}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+
+ \@setBaryPointsA{0.25}{0.25}{0.25}{0.25}
+ \@scaledPointA[color=\@polytopekey{ne color},size=3pt]
+ }{%#8 < #9
+ % lgll
+ \ifdebugname
+ \point[label=lgll]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{1}{0}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{1}{0}{0}%(C)CE
+ }
+ }
+ }
+ }
+ }{%#3 < #5
+ \ifthenelse{\lengthtest{#6 pt = #7 pt}}{%#6 = #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % llee
+ % Ignorance.
+ \ifdebugname
+ \point[label=llee]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % lleg
+ \ifdebugname
+ \point[label=lleg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{1}{0}%(C)CE
+ }{%#8 < #9
+ % llel
+ \ifdebugname
+ \point[label=llel]{0.333}{0.333}{0.333}{0.333}
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{0}{1}%(C)CE
+ }
+ }
+ }{
+ \ifthenelse{\lengthtest{#6 pt > #7 pt}}{%#6 > #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % llge
+ % Aidos.
+ \ifdebugname
+ \point[label=llge]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % llgg
+ \ifdebugname
+ \point[label=llgg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{1}{0}%(C)CE
+ }{%#8 < #9
+ % llgl
+ \ifdebugname
+ \point[label=llgl]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{0}{1}%(C)CE
+ }
+ }
+ }{%#6 < #7
+ \ifthenelse{\lengthtest{#8 pt = #9 pt}}{%#8 = #9
+ % llle
+ % Aidos.
+ \ifdebugname
+ \point[label=llle]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ % (C)CE
+ \@baryperspectiveline[color=\@polytopekey{ce color}]{0}{0}{1}{0}{0}{0}{0}{1}
+ % NE
+ \@baryperspectiveline[color=\@polytopekey{ne color},line style=dotted]{0}{0}{1}{0}{0}{0}{0}{1}
+ }{
+ \ifthenelse{\lengthtest{#8 pt > #9 pt}}{%#8 > #9
+ % lllg
+ \ifdebugname
+ \point[label=lllg]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{1}{0}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{1}{0}%(C)CE
+ }{%#8 < #9
+ % llll
+ \ifdebugname
+ \point[label=llll]{0.333}{0.333}{0.333}{0.333}
+ \else \fi
+
+
+ \point[color=\@polytopekey{ne color},size=3pt]{0}{0}{0}{1}%NE
+ \point[color=\@polytopekey{ce color},size=2pt]{0}{0}{0}{1}%(C)CE
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+% Layers.
+\pgfdeclarelayer{layer0}
+\pgfdeclarelayer{layer1}
+\pgfdeclarelayer{layer2}
+\pgfdeclarelayer{layer3}
+\pgfdeclarelayer{layer4}
+\pgfdeclarelayer{layer5}
+\pgfdeclarelayer{layer6}
+\pgfdeclarelayer{layer7}
+\pgfdeclarelayer{layer8}
+\pgfdeclarelayer{layer9}
+\pgfdeclarelayer{layer10}
+\pgfdeclarelayer{layer11}
+\pgfdeclarelayer{layer12}
+\pgfdeclarelayer{layer13}
+\pgfdeclarelayer{layer14}
+\pgfdeclarelayer{layer15}
+\pgfdeclarelayer{layer16}
+\pgfdeclarelayer{layer17}
+\pgfdeclarelayer{layer18}
+\pgfdeclarelayer{layer19}
+\pgfdeclarelayer{layer20}
+\pgfdeclarelayer{layer21}
+\pgfdeclarelayer{layer22}
+\pgfdeclarelayer{layer23}
+\pgfdeclarelayer{layer24}
+\pgfdeclarelayer{layer25}
+\pgfdeclarelayer{layer26}
+\pgfdeclarelayer{layer27}
+\pgfdeclarelayer{layer28}
+\pgfdeclarelayer{layer29}
+\pgfdeclarelayer{layer30}
+\pgfdeclarelayer{layer31}
+\pgfdeclarelayer{layer32}
+\pgfdeclarelayer{layer33}
+\pgfdeclarelayer{layer34}
+\pgfdeclarelayer{layer35}
+\pgfdeclarelayer{layer36}
+\pgfdeclarelayer{layer37}
+\pgfdeclarelayer{layer38}
+\pgfdeclarelayer{layer39}
+\pgfdeclarelayer{layer40}
+\pgfdeclarelayer{layer41}
+\pgfdeclarelayer{layer42}
+\pgfdeclarelayer{layer43}
+\pgfdeclarelayer{layer44}
+\pgfdeclarelayer{layer45}
+\pgfdeclarelayer{layer46}
+\pgfdeclarelayer{layer47}
+\pgfdeclarelayer{layer48}
+\pgfdeclarelayer{layer49}
+\pgfsetlayers{
+layer49,%
+layer48,%
+layer47,%
+layer46,%
+layer45,%
+layer44,%
+layer43,%
+layer42,%
+layer41,%
+layer40,%
+layer39,%
+layer38,%
+layer37,%
+layer36,%
+layer35,%
+layer34,%
+layer33,%
+layer32,%
+layer31,%
+layer30,%
+layer29,%
+layer28,%
+layer27,%
+layer26,%
+layer25,%
+layer24,%
+layer23,%
+layer22,%
+layer21,%
+layer20,%
+layer19,%
+layer18,%
+layer17,%
+layer16,%
+layer15,%
+layer14,%
+layer13,%
+layer12,%
+layer11,%
+layer10,%
+layer9,%
+layer8,%
+layer7,%
+layer6,%
+layer5,%
+layer4,%
+layer3,%
+layer2,%
+layer1,%
+layer0,%
+main} % Must include main.
+
+\DeclareRobustCommand{\@setScaling}[5][]{%
+ \pgfmathsetmacro{\saa}{#2}
+ \pgfmathsetmacro{\sab}{#3}
+ \pgfmathsetmacro{\sba}{#4}
+ \pgfmathsetmacro{\sbb}{#5}
+}
+
+\DeclareRobustCommand{\@setBaryPointsA}[5][]{%
+ % Scale the probabilities.
+ \pgfmathsetmacro{\aspaa}{#2 / \saa}
+ \pgfmathsetmacro{\aspab}{#3 / \sab}
+ \pgfmathsetmacro{\aspba}{#4 / \sba}
+ \pgfmathsetmacro{\aspbb}{#5 / \sbb}
+ % Normalize the probabilities.
+ \pgfmathsetmacro{\apaa}{\aspaa / (\aspaa + \aspab + \aspba + \aspbb)}
+ \pgfmathsetmacro{\apab}{\aspab / (\aspaa + \aspab + \aspba + \aspbb)}
+ \pgfmathsetmacro{\apba}{\aspba / (\aspaa + \aspab + \aspba + \aspbb)}
+ \pgfmathsetmacro{\apbb}{\aspbb / (\aspaa + \aspab + \aspba + \aspbb)}
+ % Find Cartesian.
+ \pgfmathsetlengthmacro{\xa}{{barytocartx(\apaa,\apab,\apba,\apbb)}}
+ \pgfmathsetlengthmacro{\ya}{{barytocarty(\apaa,\apab,\apba,\apbb)}}
+ \pgfmathsetlengthmacro{\za}{{barytocartz(\apaa,\apab,\apba,\apbb)}}
+}
+
+\DeclareRobustCommand{\@setBaryPointsB}[5][]{%
+ % Scale the probabilities.
+ \pgfmathsetmacro{\bspaa}{#2 / \saa}
+ \pgfmathsetmacro{\bspab}{#3 / \sab}
+ \pgfmathsetmacro{\bspba}{#4 / \sba}
+ \pgfmathsetmacro{\bspbb}{#5 / \sbb}
+ % Normalize the probabilities.
+ \pgfmathsetmacro{\bpaa}{\bspaa / (\bspaa + \bspab + \bspba + \bspbb)}
+ \pgfmathsetmacro{\bpab}{\bspab / (\bspaa + \bspab + \bspba + \bspbb)}
+ \pgfmathsetmacro{\bpba}{\bspba / (\bspaa + \bspab + \bspba + \bspbb)}
+ \pgfmathsetmacro{\bpbb}{\bspbb / (\bspaa + \bspab + \bspba + \bspbb)}
+ % Find Cartesian.
+ \pgfmathsetlengthmacro{\xb}{{barytocartx(\bpaa,\bpab,\bpba,\bpbb)}}
+ \pgfmathsetlengthmacro{\yb}{{barytocarty(\bpaa,\bpab,\bpba,\bpbb)}}
+ \pgfmathsetlengthmacro{\zb}{{barytocartz(\bpaa,\bpab,\bpba,\bpbb)}}
+}
+
+\newcommand{\@setdefaultpointkey}{%
+ \tikzset{
+ point/.is family,
+ point,
+ color/.initial=black,
+ label/.initial=,
+ label position/.initial=right,
+ size/.initial=2pt,
+ }%
+}
+\@setdefaultpointkey
+\newcommand{\@pointkey}[1]{\pgfkeysvalueof{/tikz/point/#1}}
+
+\DeclareRobustCommand{\point}[5][1]{%
+ % Process keys.
+ \@setdefaultpointkey
+ \tikzset{point,#1}
+ % Find Cartesian.
+ \pgfmathsetlengthmacro{\x}{{barytocartx(#2,#3,#4,#5)}}
+ \pgfmathsetlengthmacro{\y}{{barytocarty(#2,#3,#4,#5)}}
+ \pgfmathsetlengthmacro{\z}{{barytocartz(#2,#3,#4,#5)}}
+ % Draw node.
+ \node[circle,fill=\@pointkey{color},inner sep=0pt,minimum size=\@pointkey{size},label=\@pointkey{label position}:{\@pointkey{label}}] at (\x,\y,\z) {};
+}
+
+\DeclareRobustCommand{\@scaledPointA}[1][]{%
+ \@setdefaultpointkey%
+ \tikzset{point,#1}%
+ \node[circle,fill=\@pointkey{color},inner sep=0pt,minimum size=\@pointkey{size},label=right:{\@pointkey{label}}] at (\xa,\ya,\za) {};
+}
+
+\newif\ifdebuglayers
+\newif\ifdebugcameradistance
+\newif\ifdebugshading
+\newcommand{\@setdefaultlinekey}{%
+ \tikzset{
+ line/.is family,
+ line,
+ color/.initial=black,
+ segments/.initial=6,
+ line style/.initial=solid,
+ layer scale/.initial=1,
+ line width scale/.initial=1,
+ debug layers/.is if=debuglayers,%
+ debug camera distance/.is if=debugcameradistance,%
+ debug shading/.is if=debugshading,%
+ }%
+}
+\@setdefaultlinekey
+\newcommand{\@linekey}[1]{\pgfkeysvalueof{/tikz/line/#1}}
+\DeclareRobustCommand{\@perspectiveline}[7][]{%
+ \@setdefaultlinekey
+ \tikzset{line,#1}
+ \foreach \i [evaluate=\i] in {1,...,\@linekey{segments}} {
+ \pgfmathsetlengthmacro{\f}{{(\i - 1)/\@linekey{segments}}}
+ \pgfmathsetlengthmacro{\s}{{(\i)/\@linekey{segments}}}
+
+ \pgfmathsetlengthmacro{\xb}{{#2*\f+(1-\f)*#5}}
+ \pgfmathsetlengthmacro{\yb}{{#3*\f+(1-\f)*#6}}
+ \pgfmathsetlengthmacro{\zb}{{#4*\f+(1-\f)*#7}}
+
+ \pgfmathsetlengthmacro{\xe}{{#2*\s+(1-\s)*#5}}
+ \pgfmathsetlengthmacro{\ye}{{#3*\s+(1-\s)*#6}}
+ \pgfmathsetlengthmacro{\ze}{{#4*\s+(1-\s)*#7}}
+
+ \pgfmathsetlengthmacro{\xm}{(\xb + \xe)/2}
+ \pgfmathsetlengthmacro{\ym}{(\yb + \ye)/2}
+ \pgfmathsetlengthmacro{\zm}{(\zb + \ze)/2}
+
+ \pgfmathsetlengthmacro{\sxm}{\xm * \@linekey{layer scale}}
+ \pgfmathsetlengthmacro{\sym}{\ym * \@linekey{layer scale}}
+ \pgfmathsetlengthmacro{\szm}{\zm * \@linekey{layer scale}}
+
+ % Scaled camera distance for scaled layers.
+ \@setcameradistance{\sxm}{\sym}{\szm}{\@polytopekey{rotate x}}{\@polytopekey{rotate z}}{0.8}
+ % Magic constant here to scale to integer layers.
+ \pgfmathparse{{int(round(50 * \cd - 20))}}
+ \edef\layer{\pgfmathresult}
+ \edef\layername{layer\layer}
+
+ % Real camera distance.
+ \@setcameradistance{\xm}{\ym}{\zm}{\@polytopekey{rotate x}}{\@polytopekey{rotate z}}{0.8}
+ \pgfmathsetlengthmacro{\lw}{{\@linekey{line width scale}/\cd}}
+
+ % Shading magic constants.
+ \pgfmathparse{{int(round(120 - 50 * \cd))}}
+ \edef\shading{\pgfmathresult}
+
+ % Debug layers.
+ \ifdebuglayers
+ \filldraw[\@pointkey{color}] (\xm,\ym,\zm) circle (0.0pt) node[anchor=east]{\layer};
+ \else \fi
+ \ifdebugcameradistance
+ \filldraw[\@pointkey{color}] (\xm,\ym,\zm) circle (0.0pt) node[anchor=west]{\cd};
+ \else \fi
+ \ifdebugshading
+ \filldraw[\@pointkey{color}] (\xm,\ym,\zm) circle (0.0pt) node[anchor=west]{\shading};
+ \else \fi
+
+ \begin{pgfonlayer}{\layername}
+ \draw [{\@linekey{color}!\shading},line width=\lw,\@linekey{line style}] (\xb,\yb,\zb) -- (\xe,\ye,\ze);
+ \end{pgfonlayer}
+ }
+}
+
+\DeclareRobustCommand{\@scaledBaryPerspectiveLineAB}[1][]{%
+ \@perspectiveline[#1]{\xa}{\ya}{\za}{\xb}{\yb}{\zb}
+}
+
+\DeclareRobustCommand{\@baryperspectiveline}[9][]{%
+ \pgfmathsetlengthmacro{\xa}{{barytocartx(#2,#3,#4,#5)}}
+ \pgfmathsetlengthmacro{\ya}{{barytocarty(#2,#3,#4,#5)}}
+ \pgfmathsetlengthmacro{\za}{{barytocartz(#2,#3,#4,#5)}}
+ \pgfmathsetlengthmacro{\xb}{{barytocartx(#6,#7,#8,#9)}}
+ \pgfmathsetlengthmacro{\yb}{{barytocarty(#6,#7,#8,#9)}}
+ \pgfmathsetlengthmacro{\zb}{{barytocartz(#6,#7,#8,#9)}}
+ \@perspectiveline[#1]{\xa}{\ya}{\za}{\xb}{\yb}{\zb}
+}
+
+\DeclareRobustCommand{\@cameraline}[0]{%
+ \pgfmathsetlengthmacro{\xc}{{sin(\@polytopekey{rotate x}) * sin(\@polytopekey{rotate z})}}
+ \pgfmathsetlengthmacro{\yc}{{-sin(\@polytopekey{rotate x}) * cos(\@polytopekey{rotate z})}}
+ \pgfmathsetlengthmacro{\zc}{{cos(\@polytopekey{rotate x})}}
+ \draw [green] (0,0,0)--(\xc,\yc,\zc);
+}
+
+\DeclareRobustCommand{\@setcameradistance}[6]{%
+ \pgfmathsetlengthmacro{\xc}{{sin(#4) * sin(#5)}}
+ \pgfmathsetlengthmacro{\yc}{{-sin(#4) * cos(#5)}}
+ \pgfmathsetlengthmacro{\zc}{{cos(#4)}}
+ \pgfmathsetlengthmacro{\cd}{{#6 - (\xc * #1) - (\yc * #2) - (\zc * #3)}}
+}
+
+\makeatother