% DIAGRAM MACROS (version 3.1)
% MICRO-DIAGRAM FILE
% JUST PLAIN ARROWS
% ARROWHEADS DESIGNED AS \vector

\catcode`\@=11

%%%%% FIXING SOME PARAMETERS

%%% Fixing the default scaling factor for diagrams
\newcount\defaultscale
\def\setdefaultscale#1{\global\defaultscale=#1}
\setdefaultscale{100}

\newcount\actualtextarrowspace
\newcount\actualtextarrowlength

% \computetextparameters computes the parameters
% required to design a text arrow
\newcommand{\computetextparameters}%
{\global\actualtextarrowspace=\textarrowlength%
\global\advance\actualtextarrowspace by 3%
\global\actualtextarrowlength=\textarrowlength%
\global\multiply\actualtextarrowlength by 100}

%%% Fixing the default length of text arrows
\newcount\textarrowlength
\def\settextarrowlength#1{\global\textarrowlength=#1%
\computetextparameters}
\settextarrowlength{20}

\newcount\actualdisplayarrowspace
\newcount\actualdisplayarrowlength

% \computedisplayparameters computes the parameters
% required to design a displayed arrow
\newcommand{\computedisplayparameters}%
{\global\actualdisplayarrowspace=\displayarrowlength%
\global\advance\actualdisplayarrowspace by 3%
\global\actualdisplayarrowlength=\displayarrowlength%
\global\multiply\actualdisplayarrowlength by 100}

%%% Fixing the default length of displayed arrows
\newcount\displayarrowlength
\def\setdisplayarrowlength#1{\global\displayarrowlength=#1%
\computedisplayparameters}
\setdisplayarrowlength{30}

% ERROR MESSAGES

% Checking the next token without gobbling blanks
\def\@ifnexttok#1#2#3{\let\@tempe #1\def\@tempa{#2}\def\@tempb{#3}%
\futurelet\@tempc\@ifntok}
\def\@ifntok{\ifx \@tempc \@tempe\let\@tempd\@tempa\else\let\@tempd\@tempb\fi%
\@tempd}

%  \@diagramerror{MSG}{HLP}: Types a Diagram error message MSG and gives an error
%                            halt with error help message HLP.
\def\@diagramerror#1#2{%
\edef\@@tempc{#2}\expandafter\errhelp\expandafter{\@@tempc}%
\typeout{Diagram error. \space See User's guide for explanation.^^J
 \space\@spaces\@spaces\@spaces Type \space H <return> \space for 
 immediate help.}\errmessage{#1}}

\newif\ifdiagram

% error test and message for text arrows 
\def\testtextmode{%
\ifdiagram\@diagramerror{Text arrows are not allowed in diagrams}{Here you
should use east or west diagram arrows, not forward or backward text arrows.
Try proceeding now, typeset could succeed but with unpredictable output.}
\else\ifmmode\relax\else%
\@diagramerror{Missing \string$}{Text arrows should be introduced in math mode.
Try proceeding now, typeset could succeed but output could not be what you expected.}\fi\fi}

% error test and message for diagram arrows
\def\testdiagrammode{\ifdiagram\relax\else
\@diagramerror{Diagram arrows are not allowed in formulas}{Here you
should use forward or backward text arrows, not diagram arrows. Proceeding
could work with unpredictable output, but overflow arithmetic
could also occur.}\fi}

% error test and message for diagrams in math mode
\def\checkmode{\ifmmode\@diagramerror{Wrong mode: no diagrams 
allowed in math mode.}{You should leave math mode before
introducing your diagram. All items in the diagram will automatically be
processed in math mode.}\else\relax\fi\global\diagramtrue}

\global\diagramfalse

% INITIALIZATION

\newcount\SCALE%

\newcount\NUMBER%

\newcount\LINE%

\newcount\COLUMN%

\newcount\WIDTH%

\newcount\SOURCE%

\newcount\ARROW%

\newcount\TARGET%

\newcount\ARROWLENGTH%

\newcounter{x}%

\newcounter{y}%

\newcounter{z}%

\newcounter{horizontal}%

\newcounter{vertical}%

\newskip\itemlength%

\newskip\firstitem%

\newskip\seconditem%

\newcommand{\printarrow}{}%

\newcount\Y%

\newcount\Z%


% MACROS FOR DESIGNING DIAGRAMS


% \truex{n} divides n x 100 by the scaling factor and puts the result 
% in counter x 
\newcommand{\truex}[1]{%
\NUMBER=#1%
\multiply\NUMBER by 100%
\divide\NUMBER by \SCALE%
\setcounter{x}{\NUMBER}}%

% \truey{n} divides n x 100 by the scaling factor and puts the result 
% in counter y 
\newcommand{\truey}[1]{%
\NUMBER=#1%
\multiply\NUMBER by 100%
\divide\NUMBER by \SCALE%
\setcounter{y}{\NUMBER}}%

% \truez{n} divides n x 100 by the scaling factor and puts the result 
% in counter z 
\newcommand{\truez}[1]{%
\NUMBER=#1%
\multiply\NUMBER by 100%
\divide\NUMBER by \SCALE%
\setcounter{z}{\NUMBER}}%


% \changecounters computes the values of the various parameters required
% to design an arrow with adjusted length.
\newcommand{\changecounters}[1]{%
\SOURCE=\ARROW%
\ARROW=\TARGET%
\settowidth{\itemlength}{#1}%
\ifdim \itemlength > 2800\unitlength%
\addtolength{\itemlength}{-2800\unitlength}%
\TARGET=\itemlength%
\divide\TARGET by 1310%
\multiply\TARGET by 100%
\divide\TARGET by \SCALE%
\else%
\TARGET=0%
\fi%
\ARROWLENGTH=5000%
\advance\ARROWLENGTH by -\SOURCE%
\advance\ARROWLENGTH by -\TARGET%
\divide\ARROWLENGTH by 100%
\advance\SOURCE by -\TARGET}%

% \initialize initializes the counters required to produce the diagram
% and defines the formal dimensions of the diagram to be (0,0).
\newcommand{\initialize}[1]{%
\LINE=0%
\COLUMN=0%
\WIDTH=0%
\ARROW=0%
\TARGET=0%
\changecounters{#1}%
\renewcommand{\printarrow}{#1}%
\begin{center}%
\vspace{2pt}%
\begin{picture}(0,0)}%

% \DIAGV{n} starts the construction of a diagram scaled by a factor 
% n percent, computes the scaled unit length and the unscaling factor.
\newcommand{\DIAGV}[2]{%
\checkmode%
\SCALE=#1%
\setlength{\unitlength}{655sp}%
\multiply\unitlength by \SCALE%
\divide\unitlength by 100%
\initialize{\mbox{$#2$}}}%

% \n introduces the next item of the diagram, computes its parameters
% and prints the previous item.
\newcommand{\n}[1]{%
\changecounters{\mbox{$#1$}}%
\put(\COLUMN,\LINE){\makebox(0,0){\printarrow}}%
\thinlines%
\renewcommand{\printarrow}{\mbox{$#1$}}%
\advance\COLUMN by 4000}%

% \nn prints the  last item of a line and starts a new line.
\newcommand{\nn}[1]{%
\put(\COLUMN,\LINE){\makebox(0,0){\printarrow}}%
\thinlines%
\ifnum \WIDTH < \COLUMN%
\WIDTH=\COLUMN%
\else%
\fi%
\advance\LINE by -4000%
\COLUMN=0%
\ARROW=0%
\TARGET=0%
\changecounters{\mbox{$#1$}}%
\renewcommand{\printarrow}{\mbox{$#1$}}}%

% \conclude prints the last item of the diagram and sets the
% dimensions of the diagram;
\newcommand{\conclude}{%
\put(\COLUMN,\LINE){\makebox(0,0){\printarrow}}%
\thinlines%
\ifnum \WIDTH < \COLUMN%
\WIDTH=\COLUMN%
\else%
\fi%
\setcounter{horizontal}{\WIDTH}%
\setcounter{vertical}{-\LINE}%
\end{picture}}%

% \diag prints the last item of the diagram and takes care of the spacing
\newcommand{\diag}{%
\conclude%
\raisebox{0pt}[0pt][\value{vertical}\unitlength]{}%
\hspace*{\value{horizontal}\unitlength}%
\vspace{12pt}%
\end{center}%
\setlength{\unitlength}{1pt}%
\global\diagramfalse}%

% \diagv{t}{l}{b} prints the last item of the diagram and
% adds a t points extra space at the top of the diagram
% adds a l points extra space at the left of the diagram
% adds a b points extra space at the bottom of the diagram
\newcommand{\diagv}[3]{%
\conclude%
\NUMBER=#1%
\rule{0pt}{\NUMBER pt}%
\hspace*{-#2pt}%
\raisebox{0pt}[0pt][\value{vertical}\unitlength]{}%
\hspace*{\value{horizontal}\unitlength}%6
\NUMBER=#3%
\advance\NUMBER by 12%
\vspace*{\NUMBER pt}%
\end{center}%
\setlength{\unitlength}{1pt}%
\global\diagramfalse}%

% \movename(n,m){f} moves the name f of the arrow n points right
% and m points up.
\def\movename(#1,#2)#3{%
\hspace{#1pt}%
\raisebox{#2pt}[5pt][2pt]{\raisebox{#2pt}{$#3$}}%
\hspace{-#1pt}}%

% \movearrow(n,m){\...} moves arrow \... n points right
% and m points up.
\def\movearrow(#1,#2)#3{%
\makebox[0pt]{%
\hspace{#1pt}\hspace{#1pt}%
\raisebox{#2pt}[0pt][0pt]{\raisebox{#2pt}{$#3$}}}}%

% \movevertex(n,m){A} moves vertex A n points right and m points up
\def\movevertex(#1,#2)#3{%
\mbox{\hspace{#1pt}%
\raisebox{#2pt}{\raisebox{#2pt}{$#3$}}%
\hspace{-#1pt}}}% 

% \movevertexleft{XXX} moves vertex XXX left 
\newcommand{\movevertexleft}[1]{\makebox[2800\unitlength][r]{$#1$}}

% \movevertexright{XXX} moves vertex XXX right 
\newcommand{\movevertexright}[1]{\makebox[2800\unitlength][l]{$#1$}}

% \crosslength{P}{Q} computes the formal dimensions of the
% superposition of pictures P and Q
\newcommand{\crosslength}[2]{%
\settowidth{\firstitem}{#1}%
\settowidth{\seconditem}{#2}%
\ifdim\firstitem < \seconditem%
\itemlength=\seconditem%
\else%
\itemlength=\firstitem%
\fi%
\divide\itemlength by 2%
\hspace{\itemlength}}%

% \cross{P}{Q} superposes pictures P and Q
\newcommand{\cross}[2]{%
\crosslength{\mbox{$#1$}}{\mbox{$#2$}}%
\begin{picture}(0,0)%
\put(0,0){\makebox(0,0){$#1$}}%
\thinlines%
\put(0,0){\makebox(0,0){$#2$}}%
\thinlines%
\end{picture}%
\crosslength{\mbox{$#1$}}{\mbox{$#2$}}}%

% \bold prints the next arrow in bold-face type
\newcommand{\bold}{\ifdiagram\thicklines\else\typeout{Sorry: command
\string\bold does not apply to text arrows; I am ignoring it.}\fi}

% \unbold switches back to normal arrows
\newcommand{\unbold}{\thinlines}

% SHORTENING THE TYPING OF DIAGRAMS

\def\basicDIAG#1�{\DIAGV{\defaultscale}{#1}\@ifnexttok�{\finishline}{\basicn}}
\def\basicDIAGV[#1]#2�{\DIAGV{#1}{#2}\@ifnexttok�{\finishline}{\basicn}}
\def\basicn#1�{\n{#1}\@ifnexttok�{\finishline}{\basicn}}
\def\basicnn#1�{\nn{#1}\@ifnexttok�{\finishline}{\basicn}}
\def\finishline#1{\@ifnextchar\end{\diag}%
{\@ifnextchar\spacing{\relax}{\basicnn}}}
\def\spacing(#1,#2,#3){\diagv{#1}{#2}{#3}}

\newif\ifcaption%

\newenvironment{diagram}{%
\iffloatdiag\relax\else
\global\def\diagramcaption##1{%
\global\captiontrue%
\global\def\@diagcaption{##1}}%
\global\def\@diagcaption{}\fi%
\@ifnextchar[{\basicDIAGV}{\basicDIAG}}%
{\iffloatdiag\relax\else%
\ifcaption
\begin{center}\mbox{}\@diagcaption\end{center}%
\else\relax\fi\fi\global\captionfalse}

\global\captionfalse


% MACROS FOR FLOATING DIAGRAMS

\gdef\@diaglabel{Diagram}
\gdef\diagramlabel#1{\gdef\@diaglabel{#1}}

\newcounter{Diagram}
\setcounter{Diagram}{0}
\def\theDiagram{\@arabic\c@Diagram}
\def\fps@Diagram{tbp}
\def\ftype@Diagram{1}
\def\ext@Diagram{lof}
\def\fnum@Diagram{\@diaglabel\ \theDiagram}
\def\Diagram{\@float{Diagram}}
\let\endDiagram\end@float
\@namedef{Diagram*}{\@dblfloat{Diagram}}
\@namedef{endDiagram*}{\end@dblfloat}

\def\setdiagramcounter#1{\@addtoreset{Diagram}{#1}%
\def\theDiagram{\arabic{#1}.\@arabic\c@Diagram}}

\newif\iffloatdiag

\newenvironment{floatingdiagram}{%
\global\floatdiagtrue%
\long\def\@makecaption##1##2{
 \vskip 0pt
 \setbox\@tempboxa\hbox{##1##2}
 \ifdim \wd\@tempboxa >\hsize \unhbox\@tempboxa\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil}
 \fi}%
\global\def\diagramcaption##1{\global\def\@diagcaption{: ##1}}%
\global\def\@diagcaption{}%
\begin{Diagram}[tbp]\begin{diagram}}%
{\end{diagram}\caption{\@diagcaption}\end{Diagram}%
\global\floatdiagfalse}

\global\floatdiagfalse

% MACROS FOR DRAWING TEXT PICTURES

% \tlowername{P}{f} puts the name f under the picture P
\newcommand{\tlowername}[2]%
{$\stackrel{\makebox[1pt]{#1}}%
{\begin{picture}(0,0)%
\put(0,0){\makebox(0,6)[t]{\makebox[1pt]{$\scriptstyle#2$}}}%
\end{picture}}$}%

% \tcase{P} draws the picture P with length \textarrowlength pt.
\newcommand{\tcase}[1]{%
\testtextmode%
\setlength{\unitlength}{0.01pt}%
\makebox[\actualtextarrowspace pt]%
{\raisebox{2.5pt}{#1{\actualtextarrowlength}}}%
\setlength{\unitlength}{1pt}}%

% \Tcase{P}{f} draws the picture P with upper name f
% and length \textarrowlength pt. 
\newcommand{\Tcase}[2]{%
\testtextmode%
\setlength{\unitlength}{0.01pt}%
\makebox[\actualtextarrowspace pt]%
{\raisebox{2.5pt}{$\stackrel{\scriptstyle #2}{#1{\actualtextarrowlength}}$}}%
\setlength{\unitlength}{1pt}}%

% MACROS FOR DRAWING DISPLAYED PICTURES

% \dlowername{P}{f} puts the name f under the picture P
\newcommand{\dlowername}[2]%
{$\stackrel{\makebox[1pt]{#1}}%
{\begin{picture}(0,0)%
\put(0,0){\makebox(0,6)[t]{\makebox[1pt]{$\textstyle#2$}}}%
\end{picture}}$}%

% \dcase{P} draws the picture P with length \displayarrowlength pt.
\newcommand{\dcase}[1]{%
\testtextmode%
\setlength{\unitlength}{0.01pt}%
\makebox[\actualdisplayarrowspace pt]%
{\raisebox{2.5pt}{#1{\actualdisplayarrowlength}}}%
\setlength{\unitlength}{1pt}}%

% \Dcase{P}{f} draws the picture P with upper name f
% and length \displayarrowlength pt. 
\newcommand{\Dcase}[2]{%
\testtextmode%
\setlength{\unitlength}{0.01pt}%
\makebox[\actualdisplayarrowspace pt]%
{\raisebox{2.5pt}{$\stackrel{\textstyle #2}{#1{\actualdisplayarrowlength}}$}}%
\setlength{\unitlength}{1pt}}%

% IN-TEXT ARROWS

% \AR{n} draws an arrow of length n units
\newcommand{\AR}[1]%
{\begin{picture}(#1,0)%
\put(0,0){\vector(1,0){#1}}%
\end{picture}}%

% All the following commands produce arrows with length 20pt
% and scriptstyle names in math mode but arrows with length
% \displayarrowlength pt and textstyle names in display math mode.

% arrow 
\newcommand{\ar}{\ifinner\tcase{\AR}\else\dcase{\AR}\fi}%

% arrow with upper name [1] 
\newcommand{\Ar}[1]{\ifinner\Tcase{\AR}{#1}\else\Dcase{\AR}{#1}\fi}%

% IN-TEXT BACK ARROWS

% \BKAR{n} draws a pointing back arrow of length n units
\newcommand{\BKAR}[1]%
{\begin{picture}(#1,0)%
\put(#1,0){\vector(-1,0){#1}}%
\end{picture}}%

% All the following commands produce back arrows with length 20pt
% and scriptstyle names in math mode but arrows with length
% \displayarrowlength and textstyle names in display math mode.

% back arrow 
\newcommand{\bkar}{\ifinner\tcase{\BKAR}\else\dcase{\BKAR}\fi}%

% back arrow with upper name [1] 
\newcommand{\Bkar}[1]{\ifinner\Tcase{\BKAR}{#1}\else\Dcase{\BKAR}{#1}\fi}%


% MACROS FOR DRAWING HORIZONTAL PICTURES


% \lowername{P}{f} puts the name f under the picture P
\newcommand{\lowername}[2]%
{$\stackrel{\makebox[1pt]{#1}}%
{\begin{picture}(0,0)%
\truex{600}%
\put(0,0){\makebox(0,\value{x})[t]{\makebox[1pt]{$#2$}}}%
\end{picture}}$}%

% \hcase{P}{n} draws the picture P with length n units
\newcommand{\hcase}[2]%
{\testdiagrammode\makebox[0pt]%
{\raisebox{0pt}[0pt][0pt]{#1{#2}}}}%

% \Hcase{P}{f}{n} draws the picture P with upper name f
% and length n units. 
\newcommand{\Hcase}[3]%
{\testdiagrammode\makebox[0pt]
{\raisebox{0pt}[0pt][0pt]%
{$\stackrel{\makebox[0pt]{$\textstyle{#2}$}}{#1{#3}}$}}}%

% \hcasE{P}{f}{n} draws the picture P with lower name f
% and length n units. 
\newcommand{\hcasE}[3]%
{\testdiagrammode\makebox[0pt]%
{\raisebox{-8pt}[0pt][0pt]%
{\lowername{#1{#3}}{#2}}}}%

% EAST ARROWS

% \EAR{n} draws an east arrow of length n units
\newcommand{\EAR}[1]%
{\begin{picture}(#1,0)%
\put(0,0){\vector(1,0){#1}}%
\end{picture}}%

% All the following commands produce east arrows 

% basic east arrow
\def\basicear[#1]{%
\Z=#1%
\multiply \Z by 100%
\hcase{\EAR}{\Z}}%

% east arrow 
\newcommand{\ear}{\@ifnextchar[{\basicear}%
{\hspace{\SOURCE\unitlength}\basicear[\ARROWLENGTH]}}%

% basic east arrow with upper name
\def\basicEar[#1]#2{%
\Z=#1%
\multiply \Z by 100%
\Hcase{\EAR}{#2}{\Z}}%
 
% east arrow with upper name
\newcommand{\Ear}{\@ifnextchar[{\basicEar}%
{\hspace{\SOURCE\unitlength}\basicEar[\ARROWLENGTH]}}%

% basic east arrow with lower name
\def\basiceaR[#1]#2{%
\Z=#1%
\multiply \Z by 100%
\hcasE{\EAR}{#2}{\Z}}%
 
% east arrow with lower name
\newcommand{\eaR}{\@ifnextchar[{\basiceaR}%
{\hspace{\SOURCE\unitlength}\basiceaR[\ARROWLENGTH]}}%

% WEST ARROWS

% \WAR{n} draws a pointing back arrow of length n units
\newcommand{\WAR}[1]%
{\begin{picture}(#1,0)%
\put(#1,0){\vector(-1,0){#1}}%
\end{picture}}%

% All the following commands produce west arrows 

% basic west arrow
\def\basicwar[#1]{%
\Z=#1%
\multiply \Z by 100%
\hcase{\WAR}{\Z}}%

% west arrow 
\newcommand{\war}{\@ifnextchar[{\basicwar}%
{\hspace{\SOURCE\unitlength}\basicwar[\ARROWLENGTH]}}%

% basic west arrow with upper name
\def\basicWar[#1]#2{%
\Z=#1%
\multiply \Z by 100%
\Hcase{\WAR}{#2}{\Z}}%
 
% west arrow with upper name
\newcommand{\War}{\@ifnextchar[{\basicWar}%
{\hspace{\SOURCE\unitlength}\basicWar[\ARROWLENGTH]}}%

% basic west arrow with lower name
\def\basicwaR[#1]#2{%
\Z=#1%
\multiply \Z by 100%
\hcasE{\WAR}{#2}{\Z}}%
 
% west arrow with lower name
\newcommand{\waR}{\@ifnextchar[{\basicwaR}%
{\hspace{\SOURCE\unitlength}\basicwaR[\ARROWLENGTH]}}%

% MACROS FOR DRAWING VERTICAL PICTURES

% \vcase{P}{n} draws the vertical picture P with length n units.
\newcommand{\vcase}[2]{\testdiagrammode#1{#2}}%

% \Vcase{P}{f}{n} draws the vertical picture P
% with left name f and length n units.
\newcommand{\Vcase}[3]{\testdiagrammode\makebox[0pt]%
{\makebox[0pt][r]{\raisebox{0pt}[0pt][0pt]{${#2}\hspace{2pt}$}}}#1{#3}}%

% \vcasE{P}{f}{n} draws the vertical picture P
% with right name f and length n units.
\newcommand{\vcasE}[3]{\testdiagrammode\makebox[0pt]%
{#1{#3}\makebox[0pt][l]{\raisebox{0pt}[0pt][0pt]{\hspace{2pt}$#2$}}}}%

% SOUTH ARROWS

% \SAR{n} draws a south arrow of length n units
% and centers it in a box of width  0pt and height 0pt
\newcommand{\SAR}[1]%
{\begin{picture}(0,0)%
\put(0,0){\makebox(0,0)%
{\begin{picture}(0,#1)%
\put(0,#1){\vector(0,-1){#1}}%
\end{picture}}}\end{picture}}%

% All the following commands produce south arrows

% basic south arrow
\def\basicsar[#1]{\vcase{\SAR}{#100}}%

% south arrow 
\newcommand{\sar}{\@ifnextchar[{\basicsar}{\basicsar[50]}}%

% basic south arrow with left name
\def\basicSar[#1]#2{\Vcase{\SAR}{#2}{#100}}%
 
% south arrow with left name
\newcommand{\Sar}{\@ifnextchar[{\basicSar}{\basicSar[50]}}%

% basic south arrow with right name
\def\basicsaR[#1]#2{\vcasE{\SAR}{#2}{#100}}%
 
% south arrow with right name
\newcommand{\saR}{\@ifnextchar[{\basicsaR}{\basicsaR[50]}}%

% NORTH ARROWS

% \NAR{n} draws a north arrow of length n pt
% and centers it in a box of width 0pt and height 0pt
\newcommand{\NAR}[1]%
{\begin{picture}(0,0)%
\put(0,0){\makebox(0,0)%
{\begin{picture}(0,#1)%
\put(0,0){\vector(0,1){#1}}%
\end{picture}}}\end{picture}}%

% All the following commands produce north arrows

% basic north arrow
\def\basicnar[#1]{\vcase{\NAR}{#100}}%

% north arrow 
\newcommand{\nar}{\@ifnextchar[{\basicnar}{\basicnar[50]}}%

% basic north arrow with left name
\def\basicNar[#1]#2{\Vcase{\NAR}{#2}{#100}}%
 
% north arrow with left name
\newcommand{\Nar}{\@ifnextchar[{\basicNar}{\basicNar[50]}}%

% basic north arrow with right name
\def\basicnaR[#1]#2{\vcasE{\NAR}{#2}{#100}}%
 
% north arrow with right name
\newcommand{\naR}{\@ifnextchar[{\basicnaR}{\basicnaR[50]}}%

% MACROS FOR  FIRST DIAGONAL PICTURES

% \fdcase{P}{f}{g}{n} draws the picture P with names f, g
% and length n units
\newcommand{\fdcase}[4]{\testdiagrammode\begin{picture}(0,0)%
\put(0,0){#1{#4}}%
\truex{200}\truey{600}\truez{600}%
\put(-\value{x},-\value{x}){\makebox(0,\value{z})[r]{${#2}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#3}$}}%
\end{picture}}%

% NORTH-EAST ARROWS

% \NEAR{n} draws a north-east arrow of length nx100 units
\newcommand{\NEAR}[1]{%
\Y=#1%
\divide\Y by 2%
\begin{picture}(0,0)%
\put(-\Y,-\Y){\vector(1,1){#1}}%
\end{picture}}%

% All the following commands draw north-east arrows 

% north-east arrow of length nx100 units
\def\basicnear[#1]{\fdcase{\NEAR}{}{}{#100}}%

% north-east arrow
\newcommand{\near}{\@ifnextchar[{\basicnear}{\basicnear[59]}}%

% north-east arrow with upper name [1] and length nx100 units
\def\basicNear[#1]#2{\fdcase{\NEAR}{#2}{}{#100}}%

% north-east arrow with upper name
\newcommand{\Near}{\@ifnextchar[{\basicNear}{\basicNear[59]}}%

% north-east arrow with lower name [1]  and length nx100 units
\def\basicneaR[#1]#2{\fdcase{\NEAR}{}{#2}{#100}}%

% north-east arrow with lower name [1]
\newcommand{\neaR}{\@ifnextchar[{\basicneaR}{\basicneaR[59]}}%

% SOUT-WEST ARROWS

% \SWAR{n} draws a south-west arrow of length nx100 units
\newcommand{\SWAR}[1]{%
\Y=#1%
\divide\Y by 2%
\begin{picture}(0,0)%
\put(\Y,\Y){\vector(-1,-1){#1}}%
\end{picture}}%

% All the following commands draw south-west arrows 

% south-west arrow of length nx100 units
\def\basicswar[#1]{\fdcase{\SWAR}{}{}{#100}}%

% south-west arrow
\newcommand{\swar}{\@ifnextchar[{\basicswar}{\basicswar[59]}}%

% south-west arrow with upper name [1] and length nx100 units
\def\basicSwar[#1]#2{\fdcase{\SWAR}{#2}{}{#100}}%

% south-west arrow with upper name
\newcommand{\Swar}{\@ifnextchar[{\basicSwar}{\basicSwar[59]}}%

% south-west arrow with lower name [1]  and length nx100 units
\def\basicswaR[#1]#2{\fdcase{\SWAR}{}{#2}{#100}}%

% south-west arrow with lower name [1]
\newcommand{\swaR}{\@ifnextchar[{\basicswaR}{\basicswaR[59]}}%

% MACROS FOR  SECOND DIAGONAL PICTURES

% \sdcase{P}{f}{g}{n} draws the picture P with names f, g
% and length n units
\newcommand{\sdcase}[4]{\testdiagrammode\begin{picture}(0,0)%
\put(0,0){#1{#4}}%
\truex{100}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#2}$}}%
\truex{300}\truey{800}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#3}$}}%
\end{picture}}%

% SOUTH-EAST ARROWS

% \SEAR{n} draws a south-east arrow of length nx100 units
\newcommand{\SEAR}[1]{%
\Y=#1%
\divide\Y by 2%
\begin{picture}(0,0)%
\put(-\Y,\Y){\vector(1,-1){#1}}%
\end{picture}}%

% All the following commands draw south-east arrows 

% south-east arrow of length nx100 units
\def\basicsear[#1]{\sdcase{\SEAR}{}{}{#100}}%

% south-east arrow
\newcommand{\sear}{\@ifnextchar[{\basicsear}{\basicsear[59]}}%

% south-east arrow with upper name [1] and length nx100 units
\def\basicSear[#1]#2{\sdcase{\SEAR}{#2}{}{#100}}%

% south-east arrow with upper name
\newcommand{\Sear}{\@ifnextchar[{\basicSear}{\basicSear[59]}}%

% south-east arrow with lower name [1]  and length nx100 units
\def\basicseaR[#1]#2{\sdcase{\SEAR}{}{#2}{#100}}%

% south-east arrow with lower name [1]
\newcommand{\seaR}{\@ifnextchar[{\basicseaR}{\basicseaR[59]}}%

% NORTH-WEST ARROWS

% \NWAR{n} draws a north-west arrow of length nx100 units
\newcommand{\NWAR}[1]{%
\Y=#1%
\divide\Y by 2%
\begin{picture}(0,0)%
\put(\Y,-\Y){\vector(-1,1){#1}}%
\end{picture}}%

% All the following commands draw north-west arrows 

% north-west arrow of length nx100 units
\def\basicnwar[#1]{\sdcase{\NWAR}{}{}{#100}}%

% north-west arrow
\newcommand{\nwar}{\@ifnextchar[{\basicnwar}{\basicnwar[59]}}%

% north-west arrow with upper name [1] and length nx100 units
\def\basicNwar[#1]#2{\sdcase{\NWAR}{#2}{}{#100}}%

% north-west arrow with upper name
\newcommand{\Nwar}{\@ifnextchar[{\basicNwar}{\basicNwar[59]}}%

% north-west arrow with lower name [1]  and length nx100 units
\def\basicnwaR[#1]#2{\sdcase{\NWAR}{}{#2}{#100}}%

% north-west arrow with lower name [1]
\newcommand{\nwaR}{\@ifnextchar[{\basicnwaR}{\basicnwaR[59]}}%

% EAST-NORTH-EAST ARROWS

% The following commands produce east-north-east arrows 
% of horizontal extent n units

% \ENEAR{f}{g}{n} draws a east-north-east arrow with names f, g 
% and length n units
\newcommand{\ENEAR}[3]{\testdiagrammode%
\Y=#3%
\divide\Y by 2%
\Z=\Y%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(-\Y,-\Z){\vector(2,1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% The following commands produce east-north-east arrows;
% the default length is 13300 units

% basic east-north-east arrow
\def\basicenear[#1]{\ENEAR{}{}{#100}}%

% east-north-east arrow
\newcommand{\enear}{\@ifnextchar[{\basicenear}{\basicenear[133]}}%

% basic east-north-east arrow with upper name
\def\basicWnear[#1]#2{\ENEAR{#2}{}{#100}}%

% east-north-east arrow with upper name
\newcommand{\Enear}{\@ifnextchar[{\basicEnear}{\basicEnear[133]}}%

% basic east-north-east arrow with lower name
\def\basiceneaR[#1]#2{\ENEAR{}{#2}{#100}}%

% east-north-east arrow with lower name
\newcommand{\eneaR}{\@ifnextchar[{\basiceneaR}{\basiceneaR[133]}}%


% EAST-SOUTH-EAST ARROWS

% The following commands produce east-south-east arrows 
% of horizontal extent n units

% \ESEAR{f}{g}{n} draws a east-south-east arrow with names f, g 
% and length n units
\newcommand{\ESEAR}[3]{\testdiagrammode%
\Y=#3%
\divide\Y by 2%
\Z=\Y%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(-\Y,\Z){\vector(2,-1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% The following commands produce east-south-east arrows;
% the default length is 13300 units

% basic east-south-east arrow
\def\basicesear[#1]{\ESEAR{}{}{#100}}%

% east-south-east arrow
\newcommand{\esear}{\@ifnextchar[{\basicesear}{\basicesear[133]}}%

% basic east-south-east arrow with upper name
\def\basicEsear[#1]#2{\ESEAR{#2}{}{#100}}%

% east-south-east arrow with upper name
\newcommand{\Esear}{\@ifnextchar[{\basicEsear}{\basicEsear[133]}}%

% basic east-south-east arrow with lower name
\def\basiceseaR[#1]#2{\ESEAR{}{#2}{#100}}%

% east-south-east arrow with lower name
\newcommand{\eseaR}{\@ifnextchar[{\basiceseaR}{\basiceseaR[133]}}%

% WEST-SOUTH-WEST ARROWS

% The following commands produce west-south-west arrows 
% of horizontal extent n units

% \WSWAR{f}{g}{n} draws a west-south-west arrow with names f, g 
% and length n units
\newcommand{\WSWAR}[3]{\testdiagrammode%
\Y=#3%
\divide\Y by 2%
\Z=\Y%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(\Y,\Z){\vector(-2,-1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% The following commands produce west-south-west arrows;
% the default length is 13300 units

% basic west-south-west arrow
\def\basicwswar[#1]{\WSWAR{}{}{#100}}%

% west-south-west arrow
\newcommand{\wswar}{\@ifnextchar[{\basicwswar}{\basicwswar[133]}}%

% basic west-south-west arrow with upper name
\def\basicWswar[#1]#2{\WSWAR{#2}{}{#100}}%

% west-south-west arrow with upper name
\newcommand{\Wswar}{\@ifnextchar[{\basicWswar}{\basicWswar[133]}}%

% basic west-south-west arrow with lower name
\def\basicwswaR[#1]#2{\WSWAR{}{#2}{#100}}%

% west-south-west arrow with lower name
\newcommand{\wswaR}{\@ifnextchar[{\basicwswaR}{\basicwswaR[133]}}%

% WEST-NORTH-WEST ARROWS

% The following commands produce west-north-west arrows 
% of horizontal extent n units

% \WNWAR{f}{g}{n} draws a west-north-west arrow with names f, g 
% and length n units
\newcommand{\WNWAR}[3]{\testdiagrammode%
\Y=#3%
\divide\Y by 2%
\Z=\Y%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(\Y,-\Z){\vector(-2,1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% The following commands produce west-north-west arrows;
% the default length is 13300 units

% basic west-north-west arrow
\def\basicwnwar[#1]{\WNWAR{}{}{#100}}%

% west-north-west arrow
\newcommand{\wnwar}{\@ifnextchar[{\basicwnwar}{\basicwnwar[133]}}%

% basic west-north-west arrow with upper name
\def\basicWnwar[#1]#2{\WNWAR{#2}{}{#100}}%

% west-north-west arrow with upper name
\newcommand{\Wnwar}{\@ifnextchar[{\basicWnwar}{\basicWnwar[133]}}%

% basic west-north-west arrow with lower name
\def\basicwnwaR[#1]#2{\WNWAR{}{#2}{#100}}%

% west-north-west arrow with lower name
\newcommand{\wnwaR}{\@ifnextchar[{\basicwnwaR}{\basicwnwaR[133]}}%

% NORTH-NORTH-EAST ARROWS

% The following commands produce north-north-east arrows 
% of horizontal extent n units

% \NNEAR{f}{g}{n} draws a north-north-east arrow with names f, g 
% and length n units
\newcommand{\NNEAR}[3]{\testdiagrammode%
\Z=#3%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(-\Z,-#3){\vector(1,2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% The following commands produce north-north-east arrows;
% the default length is 6700 units

% basic north-north-east arrow
\def\basicnnear[#1]{\NNEAR{}{}{#100}}%

% north-north-east arrow
\newcommand{\nnear}{\@ifnextchar[{\basicnnear}{\basicnnear[67]}}%

% basic north-north-east arrow with upper name
\def\basicNnear[#1]#2{\NNEAR{#2}{}{#100}}%

% north-north-east arrow with upper name
\newcommand{\Nnear}{\@ifnextchar[{\basicNnear}{\basicNnear[67]}}%

% basic north-north-east arrow with lower name
\def\basicnneaR[#1]#2{\NNEAR{}{#2}{#100}}%

% north-north-east arrow with lower name
\newcommand{\nneaR}{\@ifnextchar[{\basicnneaR}{\basicnneaR[67]}}%


% SOUTH-SOUTH-EAST ARROWS

% The following commands produce south-south-east arrows 
% of horizontal extent n units

% \SSEAR{f}{g}{n} draws a south-south-east arrow with names f, g 
% and length n units
\newcommand{\SSEAR}[3]{\testdiagrammode%
\Z=#3%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(-\Z,#3){\vector(1,-2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% The following commands produce south-south-east arrows;
% the default length is 6700 units

% basic south-south-east arrow
\def\basicssear[#1]{\SSEAR{}{}{#100}}%

% south-south-east arrow
\newcommand{\ssear}{\@ifnextchar[{\basicssear}{\basicssear[67]}}%

% basic south-south-east arrow with upper name
\def\basicSsear[#1]#2{\SSEAR{#2}{}{#100}}%

% south-south-east arrow with upper name
\newcommand{\Ssear}{\@ifnextchar[{\basicSsear}{\basicSsear[67]}}%

% basic south-south-east arrow with lower name
\def\basicsseaR[#1]#2{\SSEAR{}{#2}{#100}}%

% south-south-east arrow with lower name
\newcommand{\sseaR}{\@ifnextchar[{\basicsseaR}{\basicsseaR[67]}}%

% SOUTH-SOUTH-WEST ARROWS

% The following commands produce south-south-west arrows 
% of horizontal extent n units

% \SSWAR{f}{g}{n} draws a south-south-west arrow with names f, g 
% and length n units
\newcommand{\SSWAR}[3]{\testdiagrammode%
\Z=#3%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(\Z,#3){\vector(-1,-2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% The following commands produce south-south-west arrows;
% the default length is 6700 units

% basic south-south-west arrow
\def\basicsswar[#1]{\SSWAR{}{}{#100}}%

% south-south-west arrow
\newcommand{\sswar}{\@ifnextchar[{\basicsswar}{\basicsswar[67]}}%

% basic south-south-west arrow with upper name
\def\basicSswar[#1]#2{\SSWAR{#2}{}{#100}}%

% south-south-west arrow with upper name
\newcommand{\Sswar}{\@ifnextchar[{\basicSswar}{\basicSswar[67]}}%

% basic south-south-west arrow with lower name
\def\basicsswaR[#1]#2{\SSWAR{}{#2}{#100}}%

% south-south-west arrow with lower name
\newcommand{\sswaR}{\@ifnextchar[{\basicsswaR}{\basicsswaR[67]}}%

% NORTH-NORTH-WEST ARROWS

% The following commands produce north-north-west arrows 
% of horizontal extent n units

% \NNWAR{f}{g}{n} draws a north-north-west arrow with names f, g 
% and length n units
\newcommand{\NNWAR}[3]{\testdiagrammode%
\Z=#3%
\divide\Z by 2%
\begin{picture}(0,0)%
\put(\Z,-#3){\vector(-1,2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% The following commands produce north-north-west arrows;
% the default length is 6700 units

% basic north-north-west arrow
\def\basicnnwar[#1]{\NNWAR{}{}{#100}}%

% north-north-west arrow
\newcommand{\nnwar}{\@ifnextchar[{\basicnnwar}{\basicnnwar[67]}}%

% basic north-north-west arrow with upper name
\def\basicNnwar[#1]#2{\NNWAR{#2}{}{#100}}%

% north-north-west arrow with upper name
\newcommand{\Nnwar}{\@ifnextchar[{\basicNnwar}{\basicNnwar[67]}}%

% basic north-north-west arrow with lower name
\def\basicnnwaR[#1]#2{\NNWAR{}{#2}{#100}}%

% north-north-west arrow with lower name
\newcommand{\nnwaR}{\@ifnextchar[{\basicnnwaR}{\basicnnwaR[67]}}%

% EAST-EAST-NORTH-EAST ARROWS
% default length: 21100 units

% \EENEAR{f}{g}{n} draws a east-east-north-east arrow with names f, g
% and length n units 
\newcommand{\EENEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(-\Y,-\Z){\vector(3,1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic east-east-north-east arrow
\def\basiceenear[#1]{\EENEAR{}{}{#100}}%

% east-east-north-east arrow
\newcommand{\eenear}{\@ifnextchar[{\basiceenear}{\basiceenear[211]}}%

% basic east-east-north-east arrow with upper name
\def\basicEenear[#1]#2{\EENEAR{#2}{}{#100}}%

% east-east-north-east arrow with upper name
\newcommand{\Eenear}{\@ifnextchar[{\basicEenear}{\basicEenear[211]}}%

% basic east-east-north-east arrow with lower name
\def\basiceeneaR[#1]#2{\EENEAR{}{#2}{#100}}%

% east-east-north-east arrow with lower name
\newcommand{\eeneaR}{\@ifnextchar[{\basiceeneaR}{\basiceeneaR[211]}}%

% EAST-EAST-SOUTH-EAST ARROWS
% default length: 21100 units

% \EESEAR{f}{g}{n} draws an east-east-south-east arrow with names f, g 
% and length n units
\newcommand{\EESEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(-\Y,\Z){\vector(3,-1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic east-east-south-east arrow
\def\basiceesear[#1]{\EESEAR{}{}{#100}}%

% east-east-south-east arrow
\newcommand{\eesear}{\@ifnextchar[{\basiceesear}{\basiceesear[211]}}%

% basic east-east-south-east arrow with upper name
\def\basicEesear[#1]#2{\EESEAR{#2}{}{#100}}%

% east-east-south-east arrow with upper name
\newcommand{\Eesear}{\@ifnextchar[{\basicEesear}{\basicEesear[211]}}%

% basic east-east-south-east arrow with lower name
\def\basiceeseaR[#1]#2{\EESEAR{}{#2}{#100}}%

% east-east-south-east arrow with lower name
\newcommand{\eeseaR}{\@ifnextchar[{\basiceeseaR}{\basiceeseaR[211]}}%

% WEST-WEST-NORTH-WEST ARROWS
% default length: 21100 units

% \WWNWAR{f}{g}{n} draws a west-west-north-west arrow with names f, g 
% 	and length n units
\newcommand{\WWNWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(\Y,-\Z){\vector(-3,1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic west-west-north-west arrow
\def\basicwwnwar[#1]{\WWNWAR{}{}{#100}}%

% west-west-north-west arrow
\newcommand{\wwnwar}{\@ifnextchar[{\basicwwnwar}{\basicwwnwar[211]}}%

% basic west-west-north-west arrow with upper name
\def\basicWwnwar[#1]#2{\WWNWAR{#2}{}{#100}}%

% west-west-north-west arrow with upper name
\newcommand{\Wwnwar}{\@ifnextchar[{\basicWwnwar}{\basicWwnwar[211]}}%

% basic west-west-north-west arrow with lower name
\def\basicwwnwaR[#1]#2{\WWNWAR{}{#2}{#100}}%

% west-west-north-west arrow with lower name
\newcommand{\wwnwaR}{\@ifnextchar[{\basicwwnwaR}{\basicwwnwaR[211]}}%

% WEST-WEST-SOUTH-WEST ARROWS
% default length: 21100 units

% \WWSWAR{f}{g} draws a west-west-south-west arrow with names f, g 
\newcommand{\WWSWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(\Y,\Z){\vector(-3,-1){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic west-west-south-west arrow
\def\basicwwswar[#1]{\WWSWAR{}{}{#100}}%

% west-west-south-west arrow
\newcommand{\wwswar}{\@ifnextchar[{\basicwwswar}{\basicwwswar[211]}}%

% basic west-west-south-west arrow with upper name
\def\basicWwswar[#1]#2{\WWSWAR{#2}{}{#100}}%

% west-west-south-west arrow with upper name
\newcommand{\Wwswar}{\@ifnextchar[{\basicWwswar}{\basicWwswar[211]}}%

% basic west-west-south-west arrow with lower name
\def\basicwwswaR[#1]#2{\WWSWAR{}{#2}{#100}}%

% west-west-south-west arrow with lower name
\newcommand{\wwswaR}{\@ifnextchar[{\basicwwswaR}{\basicwwswaR[211]}}%


% NORTH-NORTH-NORTH-EAST ARROWS
% default length: 7100 units

% \NNNEAR{f}{g}{n} draws a north-north-north-east arrow with names f, g 
% and length n units
\newcommand{\NNNEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\multiply \Z by 3%
\begin{picture}(0,0)%
\put(-\Y,-\Z){\vector(1,3){#3}}%
\truex{100}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{z}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic north-north-north-east arrow
\def\basicnnnear[#1]{\NNNEAR{}{}{#100}}%

% north-north-north-east arrow
\newcommand{\nnnear}{\@ifnextchar[{\basicnnnear}{\basicnnnear[71]}}%

% basic north-north-north-east arrow with upper name
\def\basicNnnear[#1]#2{\NNNEAR{#2}{}{#100}}%

% north-north-north-east arrow with upper name
\newcommand{\Nnnear}{\@ifnextchar[{\basicNnnear}{\basicNnnear[71]}}%

% basic north-north-north-east arrow with lower name
\def\basicnnneaR[#1]#2{\NNNEAR{}{#2}{#100}}%

% north-north-north-east arrow with lower name
\newcommand{\nnneaR}{\@ifnextchar[{\basicnnneaR}{\basicnnneaR[71]}}%

% SOUTH-SOUTH-SOUTH-WEST ARROWS
% default length: 7100 units

% \SSSWAR{f}{g}{n} draws a south-south-south-west arrow with names f, g 
% and length n units
\newcommand{\SSSWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\multiply \Z by 3%
\begin{picture}(0,0)%
\put(\Y,\Z){\vector(-1,-3){#3}}%
\truex{100}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{z}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic south-south-south-west arrow
\def\basicssswar[#1]{\SSSWAR{}{}{#100}}%

% south-south-south-west arrow
\newcommand{\ssswar}{\@ifnextchar[{\basicssswar}{\basicssswar[71]}}%

% basic south-south-south-west arrow with upper name
\def\basicSsswar[#1]#2{\SSSWAR{#2}{}{#100}}%

% south-south-south-west arrow with upper name
\newcommand{\Ssswar}{\@ifnextchar[{\basicSsswar}{\basicSsswar[71]}}%

% basic south-south-south-west arrow with lower name
\def\basicssswaR[#1]#2{\SSSWAR{}{#2}{#100}}%

% south-south-south-west arrow with lower name
\newcommand{\ssswaR}{\@ifnextchar[{\basicssswaR}{\basicssswaR[71]}}%

% SOUTH-SOUTH-SOUTH-EAST ARROWS
% default length: 7100 units

% \SSSEAR{f}{g}{n} draws a south-south-south-east arrow with names f, g 
% and length n units
\newcommand{\SSSEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\multiply \Z by 3%
\begin{picture}(0,0)%
\put(-\Y,\Z){\vector(1,-3){#3}}%
\truex{200}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{z}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic south-south-south-east arrow
\def\basicsssear[#1]{\SSSEAR{}{}{#100}}%

% south-south-south-east arrow
\newcommand{\sssear}{\@ifnextchar[{\basicsssear}{\basicsssear[71]}}%

% basic south-south-south-east arrow with upper name
\def\basicSssear[#1]#2{\SSSEAR{#2}{}{#100}}%

% south-south-south-east arrow with upper name
\newcommand{\Sssear}{\@ifnextchar[{\basicSssear}{\basicSssear[71]}}%

% basic south-south-south-east arrow with lower name
\def\basicssseaR[#1]#2{\SSSEAR{}{#2}{#100}}%

% south-south-south-east arrow with lower name
\newcommand{\ssseaR}{\@ifnextchar[{\basicssseaR}{\basicssseaR[71]}}%

% NORTH-NORTH-NORTH-WEST ARROWS
% default length: 7100 units

% \NNNWAR{f}{g}{n} draws a north-north-north-west arrow with names f, g
% and length n units 
\newcommand{\NNNWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=\Y%
\multiply \Z by 3%
\begin{picture}(0,0)%
\put(\Y,-\Z){\vector(-1,3){#3}}%
\truex{200}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{z}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic north-north-north-west arrow
\def\basicnnnwar[#1]{\NNNWAR{}{}{#100}}%

% north-north-north-west arrow
\newcommand{\nnnwar}{\@ifnextchar[{\basicnnnwar}{\basicnnnwar[71]}}%

% basic north-north-north-west arrow with upper name
\def\basicNnnwar[#1]#2{\NNNWAR{#2}{}{#100}}%

% north-north-north-west arrow with upper name
\newcommand{\Nnnwar}{\@ifnextchar[{\basicNnnwar}{\basicNnnwar[71]}}%

% basic north-north-north-west arrow with lower name
\def\basicnnnwaR[#1]#2{\NNNWAR{}{#2}{#100}}%

% north-north-north-west arrow with lower name
\newcommand{\nnnwaR}{\@ifnextchar[{\basicnnnwaR}{\basicnnnwaR[71]}}%

% NORTH-EAST-EAST-NORTH-EAST ARROWS
% default length: 21500 units

% \NEENEAR{f}{g}{n} draws a north-east-east-north-east arrow with names f, g 
% and length n units
\newcommand{\NEENEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(-\Y,-\Z){\vector(3,2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic north-east-east-north-east arrow
\def\basicneenear[#1]{\NEENEAR{}{}{#100}}%

% north-east-east-north-east arrow
\newcommand{\neenear}{\@ifnextchar[{\basicneenear}{\basicneenear[215]}}%

% basic north-east-east-north-east arrow with upper name
\def\basicNeenear[#1]#2{\NEENEAR{#2}{}{#100}}%

% north-east-east-north-east arrow with upper name
\newcommand{\Neenear}{\@ifnextchar[{\basicNeenear}{\basicNeenear[215]}}%

% basic north-east-east-north-east arrow with lower name
\def\basicneeneaR[#1]#2{\NEENEAR{}{#2}{#100}}%

% north-east-east-north-east arrow with lower name
\newcommand{\neeneaR}{\@ifnextchar[{\basicneeneaR}{\basicneeneaR[215]}}%

% SOUTH-EAST-EAST-SOUTH-EAST ARROWS
% DEFAULT LENGTH: 21500 UNITS

% \SEESEAR{f}{g} draws an sout-east-east-south-east arrow with names f, g 
% and length n units
\newcommand{\SEESEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(-\Y,\Z){\vector(3,-2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic south-east-east-south-east arrow
\def\basicseesear[#1]{\SEESEAR{}{}{#100}}%

% south-east-east-south-east arrow
\newcommand{\seesear}{\@ifnextchar[{\basicseesear}{\basicseesear[215]}}%

% basic south-east-east-south-east arrow with upper name
\def\basicSeesear[#1]#2{\SEESEAR{#2}{}{#100}}%

% south-east-east-south-east arrow with upper name
\newcommand{\Seesear}{\@ifnextchar[{\basicSeesear}{\basicSeesear[215]}}%

% basic south-east-east-south-east arrow with lower name
\def\basicseeseaR[#1]#2{\SEESEAR{}{#2}{#100}}%

% south-east-east-south-east arrow with lower name
\newcommand{\seeseaR}{\@ifnextchar[{\basicseeseaR}{\basicseeseaR[215]}}%

% NORTH-WEST-NORTH-NORTH-WEST ARROWS
% default length: 21500 units

% \NWWNWAR{f}{g}{n} draws a north-west-west-north-west arrow with names f, g
% and length n units 
\newcommand{\NWWNWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(\Y,-\Z){\vector(-3,2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{y}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic north-west-west-north-west arrow
\def\basicnwwnwar[#1]{\NWWNWAR{}{}{#100}}%

% north-west-west-north-west arrow
\newcommand{\nwwnwar}{\@ifnextchar[{\basicnwwnwar}{\basicnwwnwar[215]}}%

% basic north-west-west-north-west arrow with upper name
\def\basicNwwnwar[#1]#2{\NWWNWAR{#2}{}{#100}}%

% north-west-west-north-west arrow with upper name
\newcommand{\Nwwnwar}{\@ifnextchar[{\basicNwwnwar}{\basicNwwnwar[215]}}%

% basic north-west-west-north-west arrow with lower name
\def\basicnwwnwaR[#1]#2{\NWWNWAR{}{#2}{#100}}%

% north-west-west-north-west arrow with lower name
\newcommand{\nwwnwaR}{\@ifnextchar[{\basicnwwnwaR}{\basicnwwnwaR[215]}}%

% SOUTH-WEST-WEST-SOUTH-WEST ARROWS
% default length: 21500 units

% \SWWSWAR{f}{g}{n} draws a south-west-west-south-west arrow with names f, g
% and length n units 
\newcommand{\SWWSWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\divide \Z by 3%
\begin{picture}(0,0)%
\put(\Y,\Z){\vector(-3,-2){#3}}%
\truex{200}\truey{800}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{y}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic south-west-west-south-west arrow
\def\basicswwswar[#1]{\SWWSWAR{}{}{#100}}%

% south-west-west-south-west arrow
\newcommand{\swwswar}{\@ifnextchar[{\basicswwswar}{\basicswwswar[215]}}%

% basic south-west-west-south-west arrow with upper name
\def\basicSwwswar[#1]#2{\SWWSWAR{#2}{}{#100}}%

% south-west-west-south-west arrow with upper name
\newcommand{\Swwswar}{\@ifnextchar[{\basicSwwswar}{\basicSwwswar[215]}}%

% basic south-west-west-south-west arrow with lower name
\def\basicswwswaR[#1]#2{\SWWSWAR{}{#2}{#100}}%

% south-west-west-south-west arrow with lower name
\newcommand{\swwswaR}{\@ifnextchar[{\basicswwswaR}{\basicswwswaR[215]}}%


% NORTH-EAST-NORTH-NORTH-EAST ARROWS
% default length 14300 units

% \NENNEAR{f}{g}{n} draws a north-east-north-north-east arrow with names f, g 
% and length n units
\newcommand{\NENNEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\multiply \Z by 3%
\divide \Z by 4%
\begin{picture}(0,0)%
\put(-\Y,-\Z){\vector(2,3){#3}}%
\truex{100}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{z}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic north-east-north-north-east arrow
\def\basicnennear[#1]{\NENNEAR{}{}{#100}}%

% north-east-north-north-east arrow
\newcommand{\nennear}{\@ifnextchar[{\basicnennear}{\basicnennear[143]}}%

% basic north-east-north-north-east arrow with upper name
\def\basicNennear[#1]#2{\NENNEAR{#2}{}{#100}}%

% north-east-north-north-east arrow with upper name
\newcommand{\Nennear}{\@ifnextchar[{\basicNennear}{\basicNennear[143]}}%

% basic north-east-north-north-east arrow with lower name
\def\basicnenneaR[#1]#2{\NENNEAR{}{#2}{#100}}%

% north-east-north-north-east arrow with lower name
\newcommand{\nenneaR}{\@ifnextchar[{\basicnenneaR}{\basicnenneaR[143]}}%

% SOUTH-WEST-SOUTH-SOUTH-WEST ARROWS 
% default length: 14300 units

% \SWSSWAR{f}{g}{n} draws a south-west-south-south-west arrow with names f, g 
% and length n units
\newcommand{\SWSSWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\multiply \Z by 3%
\divide \Z by 4%
\begin{picture}(0,0)%
\put(\Y,\Z){\vector(-2,-3){#3}}%
\truex{100}\truez{600}%
\put(-\value{x},\value{x}){\makebox(0,\value{z})[r]{${#1}$}}%
\put(\value{x},-\value{z}){\makebox(0,\value{z})[l]{${#2}$}}%
\end{picture}}%

% basic south-west-south-south-west arrow
\def\basicswsswar[#1]{\SWSSWAR{}{}{#100}}%

% south-west-south-south-west arrow
\newcommand{\swsswar}{\@ifnextchar[{\basicswsswar}{\basicswsswar[143]}}%

% basic south-west-south-south-west arrow with upper name
\def\basicSwsswar[#1]#2{\SWSSWAR{#2}{}{#100}}%

% south-west-south-south-west arrow with upper name
\newcommand{\Swsswar}{\@ifnextchar[{\basicSwsswar}{\basicSwsswar[143]}}%

% basic south-west-south-south-west arrow with lower name
\def\basicswsswaR[#1]#2{\SWSSWAR{}{#2}{#100}}%

% south-west-south-south-west arrow with lower name
\newcommand{\swsswaR}{\@ifnextchar[{\basicswsswaR}{\basicswsswaR[143]}}%

% SOUT-EAST-SOUTH-SOUTH-EAST ARROWS
% default length: 14300 units

% \SESSEAR{f}{g}{n} draws a south-east-south-south-east arrow with names f, g 
% and length n units
\newcommand{\SESSEAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\multiply \Z by 3%
\divide \Z by 4%
\begin{picture}(0,0)%
\put(-\Y,\Z){\vector(2,-3){#3}}%
\truex{200}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{z}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic south-east-south-south-east arrow
\def\basicsessear[#1]{\SESSEAR{}{}{#100}}%

% south-east-south-south-east arrow
\newcommand{\sessear}{\@ifnextchar[{\basicsessear}{\basicsessear[143]}}%

% basic south-east-south-south-east arrow with upper name
\def\basicSessear[#1]#2{\SESSEAR{#2}{}{#100}}%

% south-east-south-south-east arrow with upper name
\newcommand{\Sessear}{\@ifnextchar[{\basicSessear}{\basicSessear[143]}}%

% basic south-east-south-south-east arrow with lower name
\def\basicsesseaR[#1]#2{\SESSEAR{}{#2}{#100}}%

% south-east-south-south-east arrow with lower name
\newcommand{\sesseaR}{\@ifnextchar[{\basicsesseaR}{\basicsesseaR[143]}}%

% NORTH-WEST-NORTH-NORTH-WEST ARROWS
% default length: 14300 units

% \NWNNWAR{f}{g}{n} draws a north-west-north-north-west arrow with names f, g 
% and length n units
\newcommand{\NWNNWAR}[3]{\testdiagrammode%
\Y=#3%
\divide \Y by 2%
\Z=#3%
\multiply \Z by 3%
\divide \Z by 4%
\begin{picture}(0,0)%
\put(\Y,-\Z){\vector(-2,3){#3}}%
\truex{200}\truez{600}%
\put(\value{x},\value{x}){\makebox(0,\value{z})[l]{${#1}$}}%
\put(-\value{x},-\value{z}){\makebox(0,\value{z})[r]{${#2}$}}%
\end{picture}}%

% basic north-west-north-north-west arrow
\def\basicnwnnwar[#1]{\NWNNWAR{}{}{#100}}%

% north-west-north-north-west arrow
\newcommand{\nwnnwar}{\@ifnextchar[{\basicnwnnwar}{\basicnwnnwar[143]}}%

% basic north-west-north-north-west arrow with upper name
\def\basicNwnnwar[#1]#2{\NWNNWAR{#2}{}{#100}}%

% north-west-north-north-west arrow with upper name
\newcommand{\Nwnnwar}{\@ifnextchar[{\basicNwnnwar}{\basicNwnnwar[143]}}%

% basic north-west-north-north-west arrow with lower name
\def\basicnwnnwaR[#1]#2{\NWNNWAR{}{#2}{#100}}%

% north-west-north-north-west arrow with lower name
\newcommand{\nwnnwaR}{\@ifnextchar[{\basicnwnnwaR}{\basicnwnnwaR[143]}}%

% HORIZONTAL CURVED ARROWS

% The following commands produce horizontal curved arrows
% default length: 160 units

% North\East curved arrow with name [1] and length [2]x100 units
\newcommand{\Necurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1300}\truey{2000}\truez{200}%
\put(0,\value{x}){\oval(#200,\value{y})[t]}%
\put(0,\value{x}){\makebox(0,0){\begin{picture}(#200,0)%
\put(#200,0){\line(0,-1){\value{z}}}%
\put(#200,-\value{z}){\shead}%
\put(0,0){\line(0,-1){\value{z}}}\end{picture}}}%
\truex{2500}%
\put(0,\value{x}){\makebox(0,0)[b]{${#1}$}}%
\end{picture}}%

% basic north\east curved arrow
\def\basicnecurvar[#1]{\Necurve{}{#1}}

% north\east curved arrow
\newcommand{\necurvar}{\@ifnextchar[{\basicnecurvar}{\basicnecurvar[160]}}%

% basic north\east curved arrow with name
\def\basicNecurvar[#1]#2{\Necurve{#2}{#1}}%

% north\east curved arrow with name
\newcommand{\Necurvar}{\@ifnextchar[{\basicNecurvar}{\basicNecurvar[160]}}%
\let\necurvaR=\Necurvar

% North\West curved arrow with name [1] and length [2]x100 units
\newcommand{\Nwcurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1300}\truey{2000}\truez{200}%
\put(0,\value{x}){\oval(#200,\value{y})[t]}%
\put(0,\value{x}){\makebox(0,0){\begin{picture}(#200,0)%
\put(#200,0){\line(0,-1){\value{z}}}%
\put(0,0){\line(0,-1){\value{z}}}%
\put(0,-\value{z}){\shead}%
\end{picture}}}%
\truex{2500}%
\put(0,\value{x}){\makebox(0,0)[b]{${#1}$}}%
\end{picture}}%

% basic north\west curved arrow
\def\basicnwcurvar[#1]{\Nwcurve{}{#1}}

% north\west curved arrow
\newcommand{\nwcurvar}{\@ifnextchar[{\basicnwcurvar}{\basicnwcurvar[160]}}%

% basic north\west curved arrow with name
\def\basicNwcurvar[#1]#2{\Nwcurve{#2}{#1}}%

% north\west curved arrow with name
\newcommand{\Nwcurvar}{\@ifnextchar[{\basicNwcurvar}{\basicNwcurvar[160]}}%
\let\nwcurvaR=\Nwcurvar

% South\East curved arrow with name [1] and length [2]x100 units
\newcommand{\Securve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1300}\truey{2000}\truez{200}%
\put(0,-\value{x}){\oval(#200,\value{y})[b]}%
\put(0,-\value{x}){\makebox(0,0){\begin{picture}(#200,0)%
\put(#200,0){\line(0,1){\value{z}}}%
\put(0,0){\line(0,1){\value{z}}}%
\put(#200,\value{z}){\nhead}%
\end{picture}}}%
\truex{2500}%
\put(0,-\value{x}){\makebox(0,0)[t]{${#1}$}}%
\end{picture}}%

% basic south\east curved arrow
\def\basicsecurvar[#1]{\Securve{}{#1}}

% south\east curved arrow
\newcommand{\securvar}{\@ifnextchar[{\basicsecurvar}{\basicsecurvar[160]}}%

% basic south\east curved arrow with name
\def\basicSecurvar[#1]#2{\Securve{#2}{#1}}%

% south\east curved arrow with name
\newcommand{\Securvar}{\@ifnextchar[{\basicSecurvar}{\basicSecurvar[160]}}%
\let\securvaR=\Securvar

% South\West curved arrow with name [1] and length [2]x100 units
\newcommand{\Swcurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1300}\truey{2000}\truez{200}%
\put(0,-\value{x}){\oval(#200,\value{y})[b]}%
\put(0,-\value{x}){\makebox(0,0){\begin{picture}(#200,0)%
\put(#200,0){\line(0,1){\value{z}}}%
\put(0,0){\line(0,1){\value{z}}}%
\put(0,\value{z}){\nhead}%
\end{picture}}}%
\truex{2500}%
\put(0,-\value{x}){\makebox(0,0)[t]{${#1}$}}%
\end{picture}}%

% basic south\west curved arrow
\def\basicswcurvar[#1]{\Swcurve{}{#1}}

% south\west curved arrow
\newcommand{\swcurvar}{\@ifnextchar[{\basicswcurvar}{\basicswcurvar[160]}}%

% basic south\west curved arrow with name
\def\basicSwcurvar[#1]#2{\Swcurve{#2}{#1}}%

% south\west curved arrow with name
\newcommand{\Swcurvar}{\@ifnextchar[{\basicSwcurvar}{\basicSwcurvar[160]}}%
\let\swcurvaR=\Swcurvar

% VERTICAL CURVED ARROWS

% The following commands produce vertical curved arrows
% default length: 160pt

% East\South curved arrow with name [1] and length [2]x100 units
\newcommand{\Escurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1400}\truey{2000}\truez{200}%
\put(\value{x},0){\oval(\value{y},#200)[r]}%
\put(\value{x},0){\makebox(0,0){\begin{picture}(0,#200)%
\put(0,0){\line(-1,0){\value{z}}}%
\put(0,#200){\line(-1,0){\value{z}}}%
\put(-\value{z},0){\whead}%
\end{picture}}}%
\truex{2500}%
\put(\value{x},0){\makebox(0,0)[l]{${#1}$}}%
\end{picture}}%

% basic east\south curved arrow
\def\basicescurvar[#1]{\Escurve{}{#1}}

% east\south curved arrow
\newcommand{\escurvar}{\@ifnextchar[{\basicescurvar}{\basicescurvar[160]}}%

% basic east\south curved arrow with name
\def\basicEscurvar[#1]#2{\Escurve{#2}{#1}}%

% east\south curved arrow with name
\newcommand{\Escurvar}{\@ifnextchar[{\basicEscurvar}{\basicEscurvar[160]}}%
\let\escurvaR=\Escurvar

% East\North curved arrow with name [1] and length [2]x100 units
\newcommand{\Encurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1400}\truey{2000}\truez{200}%
\put(\value{x},0){\oval(\value{y},#200)[r]}%
\put(\value{x},0){\makebox(0,0){\begin{picture}(0,#200)%
\put(0,0){\line(-1,0){\value{z}}}%
\put(0,#200){\line(-1,0){\value{z}}}%
\put(-\value{z},#200){\whead}%
\end{picture}}}%
\truex{2500}%
\put(\value{x},0){\makebox(0,0)[l]{${#1}$}}%
\end{picture}}%

% basic east\north curved arrow
\def\basicencurvar[#1]{\Encurve{}{#1}}

% east\north curved arrow
\newcommand{\encurvar}{\@ifnextchar[{\basicencurvar}{\basicencurvar[160]}}%

% basic east\north curved arrow with name
\def\basicEncurvar[#1]#2{\Encurve{#2}{#1}}%

% east\north curved arrow with name
\newcommand{\Encurvar}{\@ifnextchar[{\basicEncurvar}{\basicEncurvar[160]}}%
\let\encurvaR=\Encurvar

% West\South curved arrow with name [1] and length [2]x100 units
\newcommand{\Wscurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1300}\truey{2000}\truez{200}%
\put(-\value{x},0){\oval(\value{y},#200)[l]}%
\put(-\value{x},0){\makebox(0,0){\begin{picture}(0,#200)%
\put(0,0){\line(1,0){\value{z}}}%
\put(0,#200){\line(1,0){\value{z}}}%
\put(\value{z},0){\ehead}%
\end{picture}}}%
\truex{2400}%
\put(-\value{x},0){\makebox(0,0)[r]{${#1}$}}%
\end{picture}}%

% basic west\south curved arrow
\def\basicwscurvar[#1]{\Wscurve{}{#1}}

% west\south curved arrow
\newcommand{\wscurvar}{\@ifnextchar[{\basicwscurvar}{\basicwscurvar[160]}}%

% basic west\south curved arrow with name
\def\basicWscurvar[#1]#2{\Wscurve{#2}{#1}}%

% west\south curved arrow with name
\newcommand{\Wscurvar}{\@ifnextchar[{\basicWscurvar}{\basicWscurvar[160]}}%
\let\wscurvaR=\Wscurvar

% West\North curved arrow with name [1] and length [2]x100 units
\newcommand{\Wncurve}[2]%
{\testdiagrammode\begin{picture}(0,0)%
\truex{1300}\truey{2000}\truez{200}%
\put(-\value{x},0){\oval(\value{y},#200)[l]}%
\put(-\value{x},0){\makebox(0,0){\begin{picture}(0,#200)%
\put(0,0){\line(1,0){\value{z}}}%
\put(\value{z},#200){\ehead}%
\put(0,#200){\line(1,0){\value{z}}}%
\end{picture}}}%
\truex{2400}%
\put(-\value{x},0){\makebox(0,0)[r]{${#1}$}}%
\end{picture}}%

% basic west\north curved arrow
\def\basicwncurvar[#1]{\Wncurve{}{#1}}

% west\north curved arrow
\newcommand{\wncurvar}{\@ifnextchar[{\basicwncurvar}{\basicwncurvar[160]}}%

% basic west\north curved arrow with name
\def\basicWncurvar[#1]#2{\Wncurve{#2}{#1}}%

% west\north curved arrow with name
\newcommand{\Wncurvar}{\@ifnextchar[{\basicWncurvar}{\basicWncurvar[160]}}%
\let\wncurvaR=\Wncurvar

\catcode`\@=12