%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% defxpic.tex                                                           %
% general picture elements                                              %
%                                                                       %
% author:        TH Darmstadt, 90s, unknown                             %  
% extended:      K.H.Hofmann                                            %
% e-mail:        karlheinrich.hofmann@hs-rm.de                          %
% created:       ?                                                      %
% last revision: 07.07.2016, 14.04.2016, 02.02.2015                     %
%                                                                       %
% The files                                                             %
% kreisa.tex, kreisb.tex, kreisc.tex, kreisd.tex, kreise.tex            %
% should be located in the same directory.                              %
% otherwise the pathname must be adapted.                               %
%                                                                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \usepackage{calc}       % required for calculations with parameters
% \usepackage{eepic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FOR DRAWINGS                                                          %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\unitlength}{1mm}
\thicklines
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Punkte, Kringel, Additions-, Multiplikationsstellen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dot: Knotenpunkt, Durchmesser 1mm
% {Mittelpunkt(x)}{Mittelpunkt(y)}
\renewcommand{\dot}[2]{\put(#1,#2){\circle*{1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% kringel: Durchmesser 1.4 mm
% {Mittelpunkt(x)}{Mittelpunkt(y)}
\newcommand{\kringel}[2]{\put(#1,#2){\circle{1.4}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% kringelb: Durchmesser 1.4 mm, ausgef"ullt
% {Mittelpunkt(x)}{Mittelpunkt(y)}
\newcommand{\kringelb}[2]{\put(#1,#2){\circle*{1.4}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% picadd: Addition ("ahnlich \oplus) Durchmesser 5mm
\newcommand{\picadd}[2]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
        \put(2.5,2.5){\circle{5}}
        \put(1,2.5){\line(1,0){3}}
        \put(2.5,1){\line(0,1){3}}
        \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% picsumb: Addition (mit Summenzeichen) Durchmesser 8mm
\newcommand{\picsumb}[2]{\put(#1,#2){\begin{picture}(8,8)(4,4)
        \put(4,4){\circle{8}}
        \put(3,4){ \makebox(0,0){$\textstyle \sum$}}
        \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% picsums: Addition (mit Summenzeichen) Durchmesser 6mm
\newcommand{\picsums}[2]{\put(#1,#2){\begin{picture}(6,6)(3,3)
        \put(3,3){\circle{6}}
%	\put(2,3){ \makebox(0,0){$\textstyle\sum$}} % changed 07.07.2016
        \put(2,3){ \makebox(0,0){$\scriptstyle\sum$}}
        \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% picmult: Multiplikation (wie \bigotimes) Durchmesser 5mm
\newcommand{\picmult}[2]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
        \put(2.5,2.5){\circle{5}}
        \put(0.73,0.73){\line(1,1){3.535}}
        \put(4.27,0.73){\line(-1,1){3.535}}
        \end{picture}}}           
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mults: Multiplikation (wie \bigotimes) Durchmesser 4mm
\newcommand{\mults}[2]{\put(#1,#2){\begin{picture}(4,4)(2,2)
                                  % \kreisa{2}{2}{2}
                                  \put(2,2){\circle{4}}
                                  \put(0.586,0.586){\line(1,1){2.828}}
                                  \put(3.414,0.586){\line(-1,1){2.828}}
                                  \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% multss: Multiplikation (wie \bigotimes) Durchmesser 3mm 
\newcommand{\multss}[2]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  \put(2.5,2.5){\circle{3}}
                                  %\kreisa{2.5}{2.5}{1.5}
                                  %\drawline(1.44,1.44)(3.56,3.56)
                                  %\drawline(1.44,3.56)(3.56,1.44)
                                  \put(1.44,1.44){\line(1,1){2.12}}
                                  \put(3.56,1.44){\line(-1,1){2.12}}
                                  \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add: Additionsstelle, Durchmesser 5 mm
% {Mittelpunkt(x)}{Mittelpunkt(y)}:
\newcommand{\add}[2]{\put(#1,#2){\circle{5}}\put(#1,#2){\makebox(0,0){$+$}}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%adds:  Additionsstelle, Durchmesser 4 mm
% {Mittelpunkt(x)}{Mittelpunkt(y)}:
\newcommand{\adds}[2]{\put(#1,#2){\circle{4}}\put(#1,#2){\makebox(0,0){$+$}}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%addss:  Additionsstelle, Durchmesser 3 mm
% {Mittelpunkt(x)}{Mittelpunkt(y)}:
\newcommand{\addss}[2]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.7,2.5){\line(1,0){1.6}}
                                  \put(2.5,1.7){\line(0,1){1.6}}
                                  \end{picture}} }
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pmadd: Plus-Minus Additionsstelle
% {Mittelpunkt(x)}{Mittelpunkt(y)}:
\newcommand{\pmadd}[2]{\put(#1,#2){\circle{5}}
         \put(#1,#2){\begin{picture}(6,6)
                                    \put(3,-3){\makebox(0,0){$+$}}
                                    \put(-3,3){\makebox(0,0){$-$}}
                                   \end{picture} }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% multr: Multiplikationsstelle Pfeil von rechts 
\newcommand{\multr}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.44,1.44){\line(1,1){2.12}}
                                  \put(3.56,1.44){\line(-1,1){2.12}}
                                  \vcl{8}{2.5}{4}
                                  \txtl{8.6}{2.5}{#3}
                                  \end{picture}}}
% multl: Multiplikationsstelle Pfeil von links
\newcommand{\multl}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.44,1.44){\line(1,1){2.12}}
                                  \put(3.56,1.44){\line(-1,1){2.12}}
                                  \vcr{-3}{2.5}{4}
                                  \txtr{-3.6}{2.5}{#3}
                                  \end{picture}}}
% multb: Multiplikationsstelle Pfeil von unten
\newcommand{\multb}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.44,1.44){\line(1,1){2.12}}
                                  \put(3.56,1.44){\line(-1,1){2.12}}
                                  \vcu{2.5}{-3}{4}
                                  \txtt{2.5}{-3.6}{#3}
                                  \end{picture}}}
% multt: Multiplikationsstelle Pfeil von oben
\newcommand{\multt}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.44,1.44){\line(1,1){2.12}}
                                  \put(3.56,1.44){\line(-1,1){2.12}}
                                  \vcd{2.5}{8}{4}
                                  \txtb{2.5}{8.6}{#3}
                                  \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% addr: Additionsstelle Pfeil von rechts 
\newcommand{\addr}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.7,2.5){\line(1,0){1.6}}
                                  \put(2.5,1.7){\line(0,1){1.6}}
                                  \vcl{8}{2.5}{4}
                                  \txtl{8.6}{2.5}{#3}
                                  \end{picture}}}
% addl: Additionsstelle Pfeil von links
\newcommand{\addl}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.7,2.5){\line(1,0){1.6}}
                                  \put(2.5,1.7){\line(0,1){1.6}}
                                  \vcr{-3}{2.5}{4}
                                  \txtr{-3.6}{2.5}{#3}
                                  \end{picture}}}
% addb: Additionsstelle Pfeil von unten
\newcommand{\addb}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.7,2.5){\line(1,0){1.6}}
                                  \put(2.5,1.7){\line(0,1){1.6}}
                                   \vcu{2.5}{-3}{4}
                                  \txtt{2.5}{-3.6}{#3}
                                  \end{picture}}}
% addt: Additionsstelle Pfeil von oben
\newcommand{\addt}[3]{\put(#1,#2){\begin{picture}(5,5)(2.5,2.5)
                                  % \kreisa{2.5}{2.5}{1.5}
                                  \put(2.5,2.5){\circle{3}}
                                  \put(1.7,2.5){\line(1,0){1.6}}
                                  \put(2.5,1.7){\line(0,1){1.6}}
                                  \vcd{2.5}{8}{4}
                                  \txtb{2.5}{8.6}{#3}
                                  \end{picture}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ifthen: if then, reference: center 
% size: x=18mm, y=9mm
% #1: x coordinate reference point 
% #2: y coordinate reference point
% #3: condition 
\newcommand{\ifthen}[3]{\put(#1,#2){\begin{picture}(18,9)(0,0)
        \put(-9,0){\line(2,1){9}} \put(-9,0){\line(2,-1){9}}
        \put(9,0){\line(-2,1){9}} \put(9,0){\line(-2,-1){9}}
        \txt{0}{0}{#3}
        \end{picture}}}  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% vectors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% vcr: vector right
\newcommand{\vcr}[3]{\put(#1,#2){\vector(1,0){#3}}}
% vcl: vector left
\newcommand{\vcl}[3]{\put(#1,#2){\vector(-1,0){#3}}}
% vcd: vector down
\newcommand{\vcd}[3]{\put(#1,#2){\vector(0,-1){#3}}}
% vcu: vector up
\newcommand{\vcu}[3]{\put(#1,#2){\vector(0,1){#3}}}
% vcud: vector up-down
\newcommand{\vcud}[3]{\put(#1,#2){\vector(0,1){#3}}
                      \put(#1,#2){\vector(0,-1){#3}} }
% vclr: vector left-right
\newcommand{\vclr}[3]{\put(#1,#2){\vector(1,0){#3}}
                      \put(#1,#2){\vector(-1,0){#3}} }
% vcinc: vector inclined
% #1: x coordinate reference point 
% #2: y coordinate reference point
% #3: Delta_x (half vector)
% #4: Delta_y (half vector)
% #5: length in x direction (half vector)
\newcommand{\vcinc}[5]{\put(#1,#2){\vector(#3,#4){#5}}
                      \put(#1,#2){\vector(-#3,-#4){#5}} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% double vectors (representation of complex signals)
% integer values only 
% spacing between lines: 1mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% counter definitions for the following commands
\newcounter{vcca}
%
% vccr: double vector right
\newcommand{\vccr}[3]{\put(#1,#2){\begin{picture}(#3,3)
                       \setcounter{vcca}{#3-1}%
                       \put(0,0.5){\line(1,0){\thevcca}}
                       \put(0,-0.5){\line(1,0){\thevcca}}
                       \setcounter{vcca}{#3-2}%
                       \drawline(#3,0)(\thevcca,1.3) 
                       \drawline(#3,0)(\thevcca,-1.3) 
           \end{picture}
           }}
% vccl: double vector left
\newcommand{\vccl}[3]{
           \put(#1,#2){\begin{picture}(#3,3)
                       \setcounter{vcca}{#3-1}%
                       \put(0,0.5){\line(-1,0){\thevcca}}
                       \put(0,-0.5){\line(-1,0){\thevcca}}
                       \setcounter{vcca}{#3-2}%  
                       \drawline(-#3,0)(-\thevcca,1.3)
                       \drawline(-#3,0)(-\thevcca,-1.3) 
           \end{picture}
           }}
% vccd: double vector down
\newcommand{\vccd}[3]{
           \put(#1,#2){\begin{picture}(3,#3)
                       \setcounter{vcca}{#3-1}%
                       \put(0.5,0){\line(0,-1){\thevcca}}
                       \put(-0.5,0){\line(0,-1){\thevcca}}
                       \setcounter{vcca}{#3-2}%  
                       \drawline(0,-#3)(1.3,-\thevcca)
                       \drawline(0,-#3)(-1.3,-\thevcca) 
           \end{picture}
           }}
% vccu: double vector up
\newcommand{\vccu}[3]{
           \put(#1,#2){\begin{picture}(3,#3)
                       \setcounter{vcca}{#3-1}%
                       \put(0.5,0){\line(0,1){\thevcca}}
                       \put(-0.5,0){\line(0,1){\thevcca}}
                       \setcounter{vcca}{#3-2}%  
                       \drawline(0,#3)(1.3,\thevcca)
                       \drawline(0,#3)(-1.3,\thevcca) 
           \end{picture}
           }}
% lncr: double line right 
\newcommand{\lncr}[3]{
           \put(#1,#2){\begin{picture}(#3,3)
                       \put(0,0.5){\line(1,0){#3}}
                       \put(0,-0.5){\line(1,0){#3}}
           \end{picture}
           }}
% lncl: double line left
\newcommand{\lncl}[3]{
           \put(#1,#2){\begin{picture}(#3,3)
                       \put(0,0.5){\line(-1,0){#3}}
                       \put(0,-0.5){\line(-1,0){#3}}
           \end{picture}
           }} 
% lncd: double line down
\newcommand{\lncd}[3]{
           \put(#1,#2){\begin{picture}(3,#3)
                       \put(0.5,0){\line(0,-1){#3}}
                       \put(-0.5,0){\line(0,-1){#3}}
           \end{picture}
           }}
% lncu: double line up
\newcommand{\lncu}[3]{
           \put(#1,#2){\begin{picture}(3,#3)
                       \put(0.5,0){\line(0,1){#3}}
                       \put(-0.5,0){\line(0,1){#3}}
           \end{picture}
           }}
% cclb: double corner left bottom
\newcommand{\cclb}[2]{
           \put(#1,#2){\begin{picture}(2.5,2.5)
                       \put(-0.5,-0.5){\line(1,0){2.5}}
                       \put(-0.5,-0.5){\line(0,1){2.5}} 
                       \put(0.5,0.5){\line(1,0){1.5}}
                       \put(0.5,0.5){\line(0,1){1.5}} 
           \end{picture}
           }}
% ccrb: double corner right bottom
\newcommand{\ccrb}[2]{
           \put(#1,#2){\begin{picture}(2.5,2.5)
                       \put(0.5,-0.5){\line(-1,0){2.5}}
                       \put(0.5,-0.5){\line(0,1){2.5}} 
                       \put(-0.5,0.5){\line(-1,0){1.5}}
                       \put(-0.5,0.5){\line(0,1){1.5}} 
           \end{picture}
           }}%
% cclt: double corner left top
\newcommand{\cclt}[2]{
           \put(#1,#2){\begin{picture}(2.5,2.5)
                       \put(-0.5,0.5){\line(1,0){2.5}}
                       \put(-0.5,0.5){\line(0,-1){2.5}} 
                       \put(0.5,-0.5){\line(1,0){1.5}}
                       \put(0.5,-0.5){\line(0,-1){1.5}} 
           \end{picture}
           }}
% ccrt: double corner right top
\newcommand{\ccrt}[2]{
           \put(#1,#2){\begin{picture}(2.5,2.5)
                       \put(0.5,0.5){\line(-1,0){2.5}}
                       \put(0.5,0.5){\line(0,-1){2.5}} 
                       \put(-0.5,-0.5){\line(-1,0){1.5}}
                       \put(-0.5,-0.5){\line(0,-1){1.5}} 
           \end{picture}
           }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% lines
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% lnr: line right
\newcommand{\lnr}[3]{\put(#1,#2){\line(1,0){#3}}}
% lnl: line left
\newcommand{\lnl}[3]{\put(#1,#2){\line(-1,0){#3}}}
% lnd: line down
\newcommand{\lnd}[3]{\put(#1,#2){\line(0,-1){#3}}}
% lnu: line up
\newcommand{\lnu}[3]{\put(#1,#2){\line(0,1){#3}}}
% lnud: line up-down
\newcommand{\lnud}[3]{\put(#1,#2){\line(0,1){#3}}
                      \put(#1,#2){\line(0,-1){#3}}
                     }
% lnlr: line left-right
\newcommand{\lnlr}[3]{\put(#1,#2){\line(1,0){#3}}
                      \put(#1,#2){\line(-1,0){#3}}
                     }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% samples
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{sample}
\newcommand{\sampleu}[3]{\put(#1,#2){\line(0,1){#3}}
                         \setcounter{sample}{#2+#3}
                         \put(#1,\thesample){\circle*{1}}
                         }
\newcommand{\sampled}[3]{\put(#1,#2){\line(0,-1){#3}}
                         \setcounter{sample}{#2-#3}
                         \put(#1,\thesample){\circle*{1}}
                         }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% axes, cross, boxes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% counter definitions for the following commands
\newcounter{dummya}
\newcounter{dummyb}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% axesxy 
% parameter 1: x-coordinate of origin
% parameter 2: y-coordinate of origin
% parameter 3: x axis length right
% parameter 4: x axis length left
% parameter 5: y axis length up
% parameter 6: y axis length down
%
\newcommand{\axesxy}[6]{
  \vcr{#1}{#2}{#3}
  \lnl{#1}{#2}{#4}
  \vcu{#1}{#2}{#5}
  \lnd{#1}{#2}{#6} 
  }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tickmarksx
% note that the length of the tick marks is fixed to 2 mm
% parameter 1: x axis start position
% parameter 2: y axis start position
% parameter 3: x step size
% parameter 4: number of x ticks
%
\newcommand{\tickmarksx}[4]{
  \setcounter{dummya}{(#2)-1}%
  \multiput(#1,\thedummya)(#3,0){#4}{\lnu{0}{0}{2}}
  }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tickmarksy
% note that the length of the tick marks is fixed to 2 mm
% parameter 1: x axis start position
% parameter 2: y axis start position
% parameter 3: y step size
% parameter 4: number of y ticks
%
\newcommand{\tickmarksy}[4]{
  \setcounter{dummya}{(#1)-1}%
  \multiput(\thedummya,#2)(0,#3){#4}{\lnr{0}{0}{2}}
  }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gridthin
% parameter 1: x-coordinate of bottom left corner
% parameter 2: y-coordinate of bottom left corner
% parameter 3: horizontal step size
% parameter 4: number of vertical lines
% parameter 5: vertical step size 
% parameter 6: number of horizontal lines
%
\newcommand{\gridthin}[6]{
  \setcounter{dummya}{(#3)*(#4 -1)}%
  \setcounter{dummyb}{(#5)*(#6 -1)}%
  \thinlines
  \multiput(#1,#2)(0,#5){#6}{\lnr{0}{0}{\thedummya}}
  \multiput(#1,#2)(#3,0){#4}{\lnu{0}{0}{\thedummyb}}
  \thicklines 
  }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% crossxy 
% parameter 1: x-coordinate of origin
% parameter 2: y-coordinate of origin
% parameter 3: x axis length right
% parameter 4: x axis length left
% parameter 5: y axis length right
% parameter 6: y axis length left
%
\newcommand{\crossxy}[6]{
  \lnr{#1}{#2}{#3}
  \lnl{#1}{#2}{#4}
  \lnu{#1}{#2}{#5}
  \lnd{#1}{#2}{#6} 
  }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Text in Zeichnungen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% txt: text centered
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txt}[3]{\put(#1,#2){\makebox(0,0){#3}}}
%
% txtl: text left aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtl}[3]{\put(#1,#2){\makebox(0,0)[l]{#3}}}
%
% txtr: text right aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtr}[3]{\put(#1,#2){\makebox(0,0)[r]{#3}}}
%
% txtt: text top aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtt}[3]{\put(#1,#2){\makebox(0,0)[t]{#3}}}
%
% txtb: text bottom aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtb}[3]{\put(#1,#2){\makebox(0,0)[b]{#3}}}
%
% txtlb: text left-bottom aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtlb}[3]{\put(#1,#2){\makebox(0,0)[lb]{#3}}}
%
% txtlt: text left-top aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtlt}[3]{\put(#1,#2){\makebox(0,0)[lt]{#3}}}
%
% txtrb: text right-bottom aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtrb}[3]{\put(#1,#2){\makebox(0,0)[rb]{#3}}}
%
% txtrt: text right-top aligned
% {Mittelpunkt(x)}{Mittelpunkt(y)}{Inhalt}:
\newcommand{\txtrt}[3]{\put(#1,#2){\makebox(0,0)[rt]{#3}}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Text with border
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Text centered in box 
% {left bottom corner (x)}{left upper corner (y)}{width}{height}{text}:
%
\newcommand{\textbox}[5]{\put(#1,#2){\framebox(#3,#4){#5}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Text centered in dashed box 
% Parameter: #1 {left bottom corner (x)}
%            #2 {left upper corner (y)}
%            #3 {width}
%            #4 {height}
%            #5 {dash_dim}
%            #6 {text}
% 
\newcommand{\textdbox}[6]{\put(#1,#2){\dashbox{#5}(#3,#4){#6}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ovale Box (Bezugspunkt, Mitte) 
% Parameter 1: x-Koordinate des Bezugspunktes
% Parameter 2: y-Koordinate des Bezugspunktes
% Parameter 3: Gesamtl"ange
% Parameter 4: Gesamt"hohe
% Parameter 5: Text, zentriert 
%
\newcommand{\ovbox}[5]{\put(#1,#2){\oval(#3,#4)\makebox(0,0){#5}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ovale Box (Bezugspunkt, Mitte)
% 2mm Radius in den Ecken 
% Parameter 1: x-Koordinate des Bezugspunktes
% Parameter 2: y-Koordinate des Bezugspunktes
% Parameter 3: Gesamtl"ange
% Parameter 4: Gesamt"hohe
% Parameter 5: Text, zentriert 
%
\newcounter{myyh}
\newcounter{myxh}
\newcounter{myyhmi}
\newcounter{myxhmi}
%
\newcommand{\ovboxa}[5]{\setlength{\unitlength}{1mm}
      \setcounter{myyh}{(#4/2)}
      \setcounter{myxh}{(#3/2)}
      \setcounter{myyhmi}{(#4/2)-2}
      \setcounter{myxhmi}{(#3/2)-2}
\put(#1,#2){\makebox(0,0){#5}}
\put(#1,#2){\put(0,\themyyh){\line(1,0){\themyxhmi}}
            \put(0,\themyyh){\line(-1,0){\themyxhmi}}
            \put(0,-\themyyh){\line(1,0){\themyxhmi}}
            \put(0,-\themyyh){\line(-1,0){\themyxhmi}}
%  
  \put(-\themyxh,0){\line(0,1){\themyyhmi}}
  \put(-\themyxh,0){\line(0,-1){\themyyhmi}}
  \put(\themyxh,0){\line(0,1){\themyyhmi}}
  \put(\themyxh,0){\line(0,-1){\themyyhmi}}
%  \put(-\themyxhmi,\themyyhmi){\oval(4,4)[tl]}
%  \put(-\themyxhmi,-\themyyhmi){\oval(4,4)[bl]}
%  \put(\themyxhmi,\themyyhmi){\oval(4,4)[tr]}
%  \put(\themyxhmi,-\themyyhmi){\oval(4,4)[br]} 
\renewcommand{\circlethickness}{\setlength{\unitlength}{1mm}\circle*{0.07}}
   \kreisaa{\themyxhmi}{\themyyhmi}{2}
   \kreisab{-\themyxhmi}{\themyyhmi}{2}
   \kreisad{\themyxhmi}{-\themyyhmi}{2}
   \kreisac{-\themyxhmi}{-\themyyhmi}{2}
\renewcommand{\circlethickness}{\setlength{\unitlength}{1mm}\circle*{0.1}}
   } 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      
% circle commands                                                       %      
% \kreisx{x0}{y0}{r},  x0,y0: center; r: radius                         %
% full cirle, 0 to 2 pi                                                 %
% kreisa{x0}{y0}{r}   r<9mm                                             %
% kreisb{x0}{y0}{r}   r<14mm                                            %
% kreisc{x0}{y0}{r}   r<18mm                                            %
% kreisd{x0}{y0}{r}   r<30mm                                            %
% kreise{x0}{y0}{r}   r<35mm                                            %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\circlethickness}{\setlength{\unitlength}{1mm}\circle*{0.1}}
% ! valid for all kreisxx commands 
%
\newcommand{\pkt}[2]{\put(-#1,-#2){\circlethickness}
                     \put(-#1,#2){\circlethickness}
                     \put(#1,-#2){\circlethickness}
                     \put(#1,#2){\circlethickness}}
%
\newcommand{\kreisa}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
   \renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}
                          \put(-##1,##2){\circlethickness}
                          \put(##1,-##2){\circlethickness}
                          \put(##1,##2){\circlethickness}}
                        \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisa.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
\newcommand{\kreisb}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
   \renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}
                          \put(-##1,##2){\circlethickness}
                          \put(##1,-##2){\circlethickness}
                          \put(##1,##2){\circlethickness}} 
                        \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisb.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
\newcommand{\kreisc}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
   \renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}
                          \put(-##1,##2){\circlethickness}
                          \put(##1,-##2){\circlethickness}
                          \put(##1,##2){\circlethickness}}  
                        \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisc.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
\newcommand{\kreisd}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
   \renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}
                          \put(-##1,##2){\circlethickness}
                          \put(##1,-##2){\circlethickness}
                          \put(##1,##2){\circlethickness}}
                        \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisd.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
\newcommand{\kreise}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
   \renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}
                          \put(-##1,##2){\circlethickness}
                          \put(##1,-##2){\circlethickness}
                          \put(##1,##2){\circlethickness}}
                        \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreise.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% circle commands                                                       %      
% \kreisxx{x0}{y0}{r},  x0,y0: center; r: radius                        %
% arc of angle pi/2                                                     %
%                                                                       %
% r<9mm                                                                 %
% kreisaa{x0}{y0}{r}     0 - pi/2                                       %
% kreisab{x0}{y0}{r}  pi/2 - pi                                         %
% kreisac{x0}{y0}{r}    pi - 3pi/2                                      %
% kreisad{x0}{y0}{r} 3pi/2 - 2pi                                        %
% r<14mm                                                                %
% kreisba{x0}{y0}{r}     0 - pi/2                                       %
% kreisbb{x0}{y0}{r}  pi/2 - pi                                         %
% kreisbc{x0}{y0}{r}    pi - 3pi/2                                      %
% kreisbd{x0}{y0}{r} 3pi/2 - 2pi                                        %
% r<18mm                                                                %
% kreisca{x0}{y0}{r}     0 - pi/2                                       %
% kreiscb{x0}{y0}{r}  pi/2 - pi                                         %
% kreiscc{x0}{y0}{r}    pi - 3pi/2                                      %
% kreiscd{x0}{y0}{r} 3pi/2 - 2pi                                        %
% r<30mm                                                                %
% kreisda{x0}{y0}{r}     0 - pi/2                                       %
% kreisdb{x0}{y0}{r}  pi/2 - pi                                         %
% kreisdc{x0}{y0}{r}    pi - 3pi/2                                      %
% kreisdd{x0}{y0}{r} 3pi/2 - 2pi                                        %
% r<30mm                                                                %
% kreisea{x0}{y0}{r}     0 - pi/2                                       %
% kreiseb{x0}{y0}{r}  pi/2 - pi                                         %
% kreisec{x0}{y0}{r}    pi - 3pi/2                                      %
% kreised{x0}{y0}{r} 3pi/2 - 2pi                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% kreisaa{x0}{y0}{r}
\newcommand{\kreisaa}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisa.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisab{x0}{y0}{r}
\newcommand{\kreisab}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisa.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisac{x0}{y0}{r}
\newcommand{\kreisac}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisa.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisad{x0}{y0}{r}
\newcommand{\kreisad}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisa.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% kreisba{x0}{y0}{r}
\newcommand{\kreisba}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisb.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisbb{x0}{y0}{r}
\newcommand{\kreisbb}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisb.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisbc{x0}{y0}{r}
\newcommand{\kreisbc}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisb.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisbd{x0}{y0}{r}
\newcommand{\kreisbd}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisb.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% kreisca{x0}{y0}{r}
\newcommand{\kreisca}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisc.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreiscb{x0}{y0}{r}
\newcommand{\kreiscb}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisc.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreiscc{x0}{y0}{r}
\newcommand{\kreiscc}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisc.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreiscd{x0}{y0}{r}
\newcommand{\kreiscd}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisc.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% kreisda{x0}{y0}{r}
\newcommand{\kreisda}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisd.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisdb{x0}{y0}{r}
\newcommand{\kreisdb}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisd.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisdc{x0}{y0}{r}
\newcommand{\kreisdc}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisd.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisdd{x0}{y0}{r}
\newcommand{\kreisdd}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreisd.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% kreisea{x0}{y0}{r}
\newcommand{\kreisea}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreise.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreiseb{x0}{y0}{r}
\newcommand{\kreiseb}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreise.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreisec{x0}{y0}{r}
\newcommand{\kreisec}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(-##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreise.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
% kreised{x0}{y0}{r}
\newcommand{\kreised}[3]{\put(#1,#2){\begin{picture}(0,0)(0,0)
\renewcommand{\pkt}[2]{\put(##1,-##2){\circlethickness}}
                                    \setlength{\unitlength}{#3mm}
                                    \input \pathmacros/kreise.tex
                                    \end{picture}}
                                    \setlength{\unitlength}{1mm}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EOF
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%











