% June 20, 1995
%
%     The following special characters are used in 
%     this macro package:
%     
%     backslash:      \
%     vertical bar:   |
%     left quote:     `
%     right quote:    '
%     quotation mark: "
%     left brace:     {
%     right brace:    }
%     dollar sign:    $
%     percent sign:   %
%     number sign:    #
%     circumflex:     ^
%
{\catcode`\|=0 |catcode`|\=12 |obeyspaces |let|m=|message
|m{                                                                        }
|m{  These macros may be used free of charge and without authorization     }
|m{  for scientific work only.  Written permission is required for any     }
|m{  commercial use.  If used in publications, citation similar to the     }
|m{  following reference is required:                                      }
|m{                                                                        }
|m{  Michael Ramek,                                                        }
|m{  ``Chemical Structure Formul\ae\ and x/y-Diagrams with \TeX'',         }
|m{  in                                                                    }
|m{  ``\TeX: Applications, Uses, Methods, Proceedings of the \TeX88        }
|m{  Conference'',                                                         }
|m{  edited by Malcolm Clark,                                              }
|m{  published by Ellis Horwood Publishers, Chichester, UK, 1990,          }
|m{  pages 227--258                                                        }
|m{                                                                        }
|m{  Questions and inquiries should be addressed to the author:            }
|m{                                                                        }
|m{  Michael Ramek                                                         }
|m{  Institut f\"ur Physikalische und Theoretische Chemie,                 }
|m{  Technische Universit\"at Graz                                         }
|m{  Rechbauerstra{\ss}e 12                                                }
|m{  A--8010 Graz                                                          }
|m{  Austria                                                               }
|m{     }|m{}}
%
\newwrite\eIns\newwrite\zwEi
\newhelp\noscaleIgnored{mproper noscale ignored!}
\newhelp\noaxisIgnored{mproper noaxis ignored!}
\newhelp\curveIgnored{ncomplete curve ignored!}
\newhelp\hpointIgnored{mproper hpoint encountered!}
\newhelp\vpointIgnored{mproper vpoint encountered!}
\newhelp\diagramIgnored{ncorrect diagram ignored!}
\newhelp\improperxIncrement{mproper increment of x-axis!}
\newhelp\negativxIncrement{ncrement of x-axis is not positive!}
\newhelp\improperyIncrement{mproper increment of y-axis!}
\newhelp\negativyIncrement{ncrement of y-axis is not positive!}
%
\def\messAge#1{{\escapechar`I\message{\the#1}}}%
%
\def\vrUl#1#2#3{\vrule width#1 height#2 depth#3}%
\def\negadvAnce#1#2{\advance#1-#2}%
\def\divthOusand#1{\divide#1 \thOusand}%
\def\hAlve#1{\divide#1 2}%
%
\def\nogrid{\gridflag0\relax}%
%
\def\noscale{\ifnum\axmark=30\xscaling0\else%
\ifnum\axmark=40\yscaling0\else%
\messAge{\noscaleIgnored}\fi\fi\relax}%
\def\noaxis{\ifnum\axmark=30\xscaling0\xprint0\else%
\ifnum\axmark=40\yscaling0\yprint0\else%
\messAge{\noaxisIgnored}\fi\fi\relax}%
%
\def\xaxis#1,#2.#3,#4.#5,#6.#7,#8;{\xnumberlength#6.#7\pt\relax%
\ifdim\xnumberlength>\zEro\axmark30\advance\xtotal#1%
\fontdimen2\tenrm\dimen252\setbox0\hbox{#8}%
\ifdim\wd0>\zEro\setbox0\hbox{#8$\qquad\longrightarrow$}\fi%
\xnumberheight\ht0\advance\xnumberheight\dp0%
\advance\xnumberheight2\hAlf\em%
\advance\ytotal\xnumberheight\fontdimen2\tenrm\zEro%
\dimone#2.#3\pt\dimthree#4.#5\pt\negadvAnce\dimthree\dimone%
\axIshelp\xmin#2;\xmax#4;\xinc#6;\xvalfrac0#3\chelptwo0#5%
\chelpfour0#7\setbox2\hbox{#2.}\xnumberlength\wd2%
\setbox2\hbox{#6.}\ifdim\wd2>\xnumberlength\xnumberlength\wd2\fi%
\setbox2\hbox{#3}\xfraclen\wd2\setbox2\hbox{#5}%
\ifdim\wd2>\xfraclen\xfraclen\wd2\fi\setbox2\hbox{#7}%
\ifdim\wd2>\xfraclen\xfraclen\wd2\fi%
\advance\xnumberlength\xfraclen\xbasis1%
\loop\setbox2\hbox{\number\xbasis}\ifdim\wd2<\xfraclen%
\multiply\xbasis10\repeat\multiply\xbasis10%
\multiply\xmin\xbasis\multiply\xmax\xbasis%
\multiply\xinc\xbasis\axhElp{#3}\xfraclen\xvalfrac%
\xlength#2.#3\pt\relax\ifdim\xlength<\zEro%
\negadvAnce\xmin\xvalfrac\else\advance\xmin\xvalfrac\fi%
\axhElp{#5}\xfraclen\chelptwo%
\xlength#4.#5\pt\relax\ifdim\xlength<\zEro%
\negadvAnce\xmax\chelptwo\else\advance\xmax\chelptwo\fi%
\axhElp{#7}\xfraclen\chelpfour%
\advance\xinc\chelpfour\xlength#1%
\xfinal\xmin\loop\advance\xfinal\xinc\relax%
\ifnum\xfinal<\xmax\repeat%
\ifnum\xmax=\xfinal\advance\axcount1\else%
\messAge{\improperxIncrement}\fi%
\else\messAge{\negativexIncrement}\fi}%
%
\def\axIshelp#1#2;#3#4;#5#6;{%
\setbox2\hbox{#2}\ifdim\wd2=\zEro#1=0\else%
\ifdim\wd2=\wd4 % sometimes these blanks are essential!
\if#2-#1=0\else#1#2\fi\else#1#2\fi\fi%
\setbox2\hbox{#6}\ifdim\wd2=\zEro#5=0\else%
\ifdim\wd2=\wd4 % sometimes these blanks are essential!
\if#6-#5=0\else#5#6\fi\else#5#6\fi\fi%
\setbox2\hbox{#4}\ifdim\wd2=\zEro#3=0\else%
\ifdim\wd2=\wd4 % sometimes these blanks are essential!
\if#4-#3=0\else#3#4\fi\else#3#4\fi\fi}%
%
\def\yaxis#1,#2.#3,#4.#5,#6.#7,#8;{\ynumbering#6.#7\pt\relax%
\ifdim\ynumbering>\zEro\axmark40\advance\ytotal#1%
\fontdimen2\tenrm\dimen252\setbox1\hbox{#8}%
\fontdimen2\tenrm\zEro\advance\xtotal2\hAlf\em%
\advance\xtotal\wd1\setbox2\hbox{#2.}\ynumbering\wd2%
\setbox2\hbox{#6.}\ifdim\wd2>\ynumbering\ynumbering\wd2\fi%
\setbox2\hbox{#3}\yfraclen\wd2%
\setbox2\hbox{#5}\ifdim\wd2>\yfraclen\yfraclen\wd2\fi%
\setbox2\hbox{#7}\ifdim\wd2>\yfraclen\yfraclen\wd2\fi%
\advance\ynumbering\yfraclen\advance\xtotal\ynumbering%
\dimtwo#2.#3\pt\dimfour#4.#5\pt\negadvAnce\dimfour\dimtwo%
\axIshelp\ymin#2;\ymax#4;\yinc#6;%
\yvalfrac0#3\chelpfive0#5\chelpsix0#7\ybasis1%
\loop\setbox2\hbox{\number\ybasis}\ifdim\wd2<\yfraclen%
\multiply\ybasis10\repeat\multiply\ybasis10%
\multiply\ymin\ybasis\multiply\ymax\ybasis%
\multiply\yinc\ybasis\axhElp{#3}\yfraclen\yvalfrac%
\ylength#2.#3\pt\relax\ifdim\ylength<\zEro%
\negadvAnce\ymin\yvalfrac\else\advance\ymin\yvalfrac\fi%
\axhElp{#5}\yfraclen\chelpfive%
\ylength#4.#5\pt\relax\ifdim\ylength<\zEro%
\negadvAnce\ymax\chelpfive\else\advance\ymax\chelpfive\fi%
\axhElp{#7}\yfraclen\chelpsix\advance\yinc\chelpsix\ylength#1%
\yfinal\ymin\loop\advance\yfinal\yinc\relax%
\ifnum\yfinal<\ymax\repeat%
\ifnum\ymax=\yfinal\advance\axcount2\else%
\messAge{\improperyIncrement}\fi%
\else\messAge{\negativyIncrement}\fi}%
%
\def\axhElp#1#2#3{\setbox2\hbox{#1}\loop\ifdim\wd2<#2%
\setbox2\hbox{\unhbox2 0}\multiply#3 10\repeat}%
%
\def\printsymbol#1{{\symbol#1\box2}}%
%
\def\symbol#1{\ifcase#1%
\ownsymbol{\lower.03em\hbox{\kern.05em$\circ$}}\or%
\ownsymbol{\lower.03em\hbox{\kern.05em$\bullet$}}\or%
\ownsymbol{\raise.1em\hbox{$\oplus$}}\or%
\ownsymbol{\raise.1em\hbox{\kern.01em$\otimes$}}\or%
\ownsymbol{\raise.1em\hbox{\kern.0235em+}}\or%
\ownsymbol{\raise.1em\hbox{\kern.05em$\times$}}\or%
\ownsymbol{$\ast$}\or%
\ownsymbol{\vrule width.4em height.4em}\or%
\ownsymbol{\lower.03em\hbox{\kern.03em$\diamond$}}\or%
\ownsymbol{$\bowtie$}\fi}%
%
\def\ownsymbol#1{\advance\dimen12 .5\wd2%
\advance\dimen13 .5\ht2\advance\dimen13 .5\dp2%
\setbox2\hbox{#1}\advance\dimen12-.5\wd2%
\advance\dimen13-.5\ht2\advance\dimen13-.5\dp2}%
%
\def\nosymbol{\ownsymbol{}}%
%
\def\values#1{\curvetyp0\ownsymbol{\kern.02\em{\tt x}}#1}%
%
\def\connect#1{\curvetyp1\gridflag0\nosymbol#1}%
%
\def\curve#1{\curvetyp3\gridflag0\yfinal0%
\immediate\openout\eIns\jobname.co1\nosymbol#1\nosymbol%
\immediate\write\eIns{-1}\immediate\closeout\eIns%
\ifnum\gridflag<2\messAge{\curveIgnored}\fi\relax%
\ifnum\gridflag=2\advance\xfinal\yfinal\relax%
\ifnum\xfinal=0\immediate\openin\eIns\jobname.co1%
\immediate\read\eIns to\zeIle%
\immediate\read\eIns to\zeIle\dhelptwo=\zeIle%
\immediate\read\eIns to\zeIle\ynumbering=\zeIle%
\immediate\closein\eIns\docOnnect\fi\else%
\axmark\eIns\chelpseven\zwEi\chelpsix\dhelpone%
\divide\chelpsix175\multiply\chelpsix\chelpsix%
\chelpeight0\loop\chelpnine0\ifnum\axmark=\eIns%
\immediate\openin\axmark\jobname.co1%
\immediate\openout\chelpseven\jobname.co2\else%
\immediate\openin\axmark\jobname.co2%
\immediate\openout\chelpseven\jobname.co1\fi%
\gridflag0\readAxmark\yfinal=\zeIle\relax%
\dacApo\ifnum\yfinal>-1\dhelptwenty\dhelptwo\xfraclen\ynumbering%
\readAxmark\dhelptwo=\zeIle\readAxmark%
\ynumbering=\zeIle\advance\gridflag1\relax\ifnum\gridflag=2%
\dhelpfour\dhelptwo\dhelpfive\ynumbering\chelpten\yfinal%
\dhelpeight\dhelptwo\dhelpnine\ynumbering\chelpeleven\yfinal\fi%
\ifnum\gridflag=1\dhelptwelve\dhelptwo\dhelpthirteen\ynumbering%
\chelptwelve\yfinal\dhelpfourteen\dhelptwo\dhelpfifteen\ynumbering%
\yprint\yfinal\fi\ifnum\gridflag=3\strok\dhelptwo%
\dhelpsixteen\ynumbering\chelpthirteen\yfinal\ifnum\chelptwelve=0%
\ifnum\chelpten=2\dhelpeleven\dhelpthirteen\dhelpten\dhelpfour%
\multiply\dhelpten2\negadvAnce\dhelpten\dhelptwelve\fi\relax%
\ifnum\chelpten=1\dhelpten\dhelptwelve\dhelpeleven\dhelpfive%
\multiply\dhelpeleven2\negadvAnce\dhelpeleven\dhelpthirteen\fi\relax%
\ifnum\chelpten=0\dhelpten\dhelptwo\dhelpeleven\ynumbering\fi%
\fi\fi\relax\ifnum\gridflag>3\helpdOcurve\strok\dhelptwo%
\dhelpsixteen\ynumbering\chelpthirteen\yfinal\fi\relax%
\ifnum\gridflag>2\reallydOcurve\fi\chelpfourteen\yfinal%
\readAxmark\yfinal=\zeIle\fi\relax\ifnum\yfinal>-1\alfIne\relax%
\ifnum\gridflag=2\ifnum\chelptwelve=2\dhelpeleven\dhelpfive%
\dhelpten\dhelptwelve\multiply\dhelpten2%
\negadvAnce\dhelpten\dhelpfour\chelpten0\fi\relax%
\ifnum\chelptwelve=1\dhelpten\dhelpfour\dhelpeleven\dhelpthirteen%
\multiply\dhelpeleven2\negadvAnce\dhelpeleven\dhelpfive\chelpten0%
\fi\relax%
\ifnum\chelpten=2\dhelpeleven\dhelpthirteen\dhelpten\dhelpfour%
\multiply\dhelpten2\negadvAnce\dhelpten\dhelptwelve\fi%
\ifnum\chelpten=1\dhelpten\dhelptwelve\dhelpeleven\dhelpfive%
\multiply\dhelpeleven2\negadvAnce\dhelpeleven\dhelpthirteen\fi%
\strok\dhelpten\dhelpsixteen\dhelpeleven\else\dhelptwenty\dhelptwo%
\xfraclen\ynumbering\chelpfourteen\chelpthirteen\helpdOcurve%
\strok\dhelpten\dhelpsixteen\dhelpeleven\chelpthirteen\xprint\fi%
\reallydOcurve\immediate\write\chelpseven{\the\chelpfourteen}%
\immediate\write\chelpseven{\the\dhelptwo}%
\immediate\write\chelpseven{\the\ynumbering}%
\immediate\write\chelpseven{-1}%
\immediate\closein\axmark\immediate\closeout\chelpseven%
\advance\chelpnine1\message{\the\chelpnine}%
\xvalint\chelpseven\chelpseven\axmark\axmark\xvalint%
\ifnum\chelpnine=\chelpeight\chelpnine999\else%
\chelpeight\chelpnine\fi\relax%
\relax\ifnum\chelpnine<99\repeat\relax\ifnum\axmark=\eIns%
\immediate\openin\axmark\jobname.co1\else%
\immediate\openin\axmark\jobname.co2\fi%
\readAxmark\yfinal=\zeIle\readAxmark%
\dhelpfourteen=\zeIle\advance\dhelpfourteen\hAlf\wd1%
\readAxmark\dhelpfifteen=\zeIle\readAxmark%
\yfinal=\zeIle\relax\dacApo\readAxmark\dhelpeight=\zeIle%
\advance\dhelpeight\hAlf\wd1\readAxmark\dhelpnine=\zeIle%
\dhelptwo\dhelpfourteen\ynumbering\dhelpfifteen%
\dhelptwenty\dhelpeight\xfraclen\dhelpnine\dhelpfourteen\dhelpeight%
\dhelpfifteen\dhelpnine\docOnnect\readAxmark\yfinal=\zeIle%
\relax\ifnum\yfinal>-1\alfIne\immediate\closein\axmark\relax%
\fi}%
%
\def\absdOcurve{\relax%
\ifdim\dhelpthree<\zEro\dhelpthree-\dhelpthree\fi\relax}%
%
\def\readAxmark{\read\axmark to\zeIle}%
%
\def\helpdOcurve{\dhelpten\dhelptwelve\dhelpeleven\dhelpthirteen%
\xprint\chelptwelve\dhelptwelve\dhelpfour\dhelpthirteen\dhelpfive%
\chelptwelve\chelpten\dhelpfourteen\dhelpeight\dhelpfifteen\dhelpnine%
\yprint\chelpeleven\dhelpfour\dhelptwenty\dhelpfive\xfraclen%
\chelpten\chelpfourteen\dhelpeight\dhelpfour\dhelpnine\dhelpfive%
\chelpeleven\chelpten}%
%
\def\reallydOcurve{\ifnum\chelptwelve=2\dhelpeleven\dhelpfive%
\dhelpten\dhelptwelve\multiply\dhelpten2%
\negadvAnce\dhelpten\dhelpfour\fi%
\ifnum\chelptwelve=1\dhelpten\dhelpfour%
\dhelpeleven\dhelpthirteen\multiply\dhelpeleven2%
\negadvAnce\dhelpeleven\dhelpfive\fi%
\ifnum\chelpeleven=2\dhelpsixteen\dhelpfifteen\strok\dhelpeight%
\multiply\strok2\negadvAnce\strok\dhelpfourteen\fi%
\ifnum\chelpeleven=1\strok\dhelpfourteen\dhelpsixteen\dhelpnine%
\multiply\dhelpsixteen2\negadvAnce\dhelpsixteen\dhelpfifteen\fi%
\immediate\write\chelpseven{\the\chelptwelve}%
\immediate\write\chelpseven{\the\dhelptwelve}%
\immediate\write\chelpseven{\the\dhelpthirteen}%
\advance\chelpnine1\relax\dhelpthree\dhelptwelve%
\negadvAnce\dhelpthree\dhelpfour\yfraclen\dhelpthirteen%
\negadvAnce\yfraclen\dhelpfive\divthOusand\dhelpthree%
\divthOusand\yfraclen\chelpfifteen\dhelpthree%
\multiply\chelpfifteen\chelpfifteen\chelpsixteen\yfraclen%
\multiply\chelpsixteen\chelpsixteen%
\advance\chelpsixteen\chelpfifteen\relax%
\ifnum\chelpsixteen>\chelpsix\kreisdOcurve\dfive\dsix\dseven\deight%
\chelpseventeen\chelpfifteen\kreisdOcurve\relax%
\advance\chelpseventeen\chelpfifteen\relax\ifnum\chelpseventeen<6%
\advance\dsix\dfive\hAlve\dsix\advance\deight\dseven%
\hAlve\deight\immediate\write\chelpseven{0}%
\immediate\write\chelpseven{\the\dsix}%
\immediate\write\chelpseven{\the\deight}%
\advance\chelpnine1\fi\fi\relax}%
%
\def\kreisdOcurve{\chelpfifteen0\dsix\dhelptwelve%
\advance\dsix\dhelpfour\hAlve\dsix\deight\dhelpthirteen%
\advance\deight\dhelpfive\hAlve\deight%
\ifnum\chelptwelve=2\dhelpsix\dhelptwelve\dhelpthree\dhelpfour%
\negadvAnce\dhelpthree\dhelptwelve\yfraclen\dhelpthirteen%
\negadvAnce\yfraclen\dhelpfive%
\relax\ifdim\yfraclen<\thOusand sp\ifdim\yfraclen<-\thOusand sp%
\else\ifdim\yfraclen<\zEro\yfraclen-\thOusand sp%
\else\yfraclen\thOusand sp\fi\fi\fi%
\divthOusand\yfraclen\divide\dhelpthree\yfraclen%
\dhelpseven\dhelptwelve\negadvAnce\dhelpseven\dsix%
\divthOusand\dhelpseven\multiply\dhelpseven\dhelpthree%
\advance\dhelpseven\deight\chelpfifteen1\fi\relax%
\ifnum\chelptwelve=1\dhelpseven\dhelpthirteen%
\dhelpthree\dhelpthirteen\negadvAnce\dhelpthree\dhelpfive%
\yfraclen\dhelpfour\negadvAnce\yfraclen\dhelptwelve%
\divthOusand\yfraclen\divide\dhelpthree\yfraclen%
\dhelpsix\dhelpthirteen\negadvAnce\dhelpsix\deight%
\divthOusand\dhelpsix\multiply\dhelpsix\dhelpthree%
\advance\dhelpsix\dsix\chelpfifteen1\fi\relax%
\ifnum\chelpfifteen=0\dhelpthree\dhelpfour%
\negadvAnce\dhelpthree\dhelptwelve\yfraclen\dhelpthirteen%
\negadvAnce\yfraclen\dhelpeleven\divthOusand\dhelpthree%
\divthOusand\yfraclen\multiply\yfraclen\dhelpthree%
\dhelpthree\dhelptwelve\negadvAnce\dhelpthree\dhelpten%
\dnine\dhelpfive\divthOusand\dhelpthree%
\negadvAnce\dnine\dhelpthirteen\divthOusand\dnine%
\multiply\dhelpthree\dnine\negadvAnce\dhelpthree\yfraclen%
\absdOcurve\ifdim\dhelpthree<\hAlf\pt\dnine\dsix%
\negadvAnce\dnine\dhelptwelve\divthOusand\dnine%
\yfraclen\deight\negadvAnce\yfraclen\dhelpthirteen%
\divthOusand\yfraclen\multiply\dnine\dnine%
\multiply\yfraclen\yfraclen\advance\dnine\yfraclen%
\cfour\dnine\rOot\chelpfifteen\cthree%
\multiply\chelpfifteen\thOusand\dnine\dhelptwelve%
\negadvAnce\dnine\dhelpten\yfraclen\dhelpthirteen%
\negadvAnce\yfraclen\dhelpeleven\divthOusand\dnine%
\divthOusand\yfraclen\cfour\dnine%
\multiply\cfour\cfour\cthree\yfraclen%
\multiply\cthree\cthree\advance\cfour\cthree\rOot%
\divide\chelpfifteen\cthree\multiply\dnine\chelpfifteen%
\multiply\yfraclen\chelpfifteen\advance\dnine\dhelptwelve%
\advance\yfraclen\dhelpthirteen\advance\dsix\dnine%
\advance\deight\yfraclen\hAlve\dsix%
\hAlve\deight\relax\chelpfifteen2\ifdim\dhelpthree=\zEro%
\chelpfifteen3\fi\fi\fi\relax\ifnum\chelpfifteen=0%
\dhelpsix\dhelptwelve\chelpsixteen\chelptwelve\relax%
\ifnum\chelpsixteen=0\dhelpthree\dhelpeleven%
\negadvAnce\dhelpthree\dhelpthirteen\absdOcurve%
\ifdim\dhelpthree<\dhelpone\chelpsixteen2\dhelpsix\dhelpten%
\advance\dhelpsix\dhelptwelve\hAlve\dhelpsix\fi\fi%
\dhelpthree\dhelptwelve\negadvAnce\dhelpthree\dhelpfour%
\yfraclen\dhelpfive\negadvAnce\yfraclen\dhelpthirteen%
\ifnum\chelpsixteen=0\dnine\yfraclen\relax%
\ifdim\dnine<\zEro\dnine-\dnine\fi\relax%
\ifdim\dnine<\dhelpone\dhelpsix\dhelptwelve%
\advance\dhelpsix\dhelpfour\hAlve\dhelpsix%
\dhelpthree\dhelpten\negadvAnce\dhelpthree\dhelptwelve%
\yfraclen\dhelpthirteen\negadvAnce\yfraclen\dhelpeleven%
\dsix\dhelpten\advance\dsix\dhelptwelve\hAlve\dsix%
\deight\dhelpeleven\advance\deight\dhelpthirteen%
\hAlve\deight\chelpsixteen2\fi\fi\relax%
\ifnum\chelpsixteen=2\divthOusand\yfraclen%
\divide\dhelpthree\yfraclen\dhelpseven\dhelpsix%
\negadvAnce\dhelpseven\dsix\divthOusand\dhelpseven%
\multiply\dhelpseven\dhelpthree\advance\dhelpseven\deight%
\dsix\dhelptwelve\advance\dsix\dhelpfour\hAlve\dsix%
\deight\dhelpthirteen\advance\deight\dhelpfive\hAlve\deight\fi%
\ifnum\chelpsixteen=1\dhelpseven\dhelpthirteen%
\divthOusand\dhelpthree\divide\yfraclen\dhelpthree%
\dhelpsix\deight\negadvAnce\dhelpsix\dhelpseven%
\divthOusand\dhelpsix\multiply\dhelpsix\yfraclen%
\advance\dhelpsix\dsix\fi%
\ifnum\chelpsixteen=0\dten\dhelpeleven%
\negadvAnce\dten\dhelpfive\dnine\dhelpfour\dhelpseven\dten\relax%
\ifdim\dhelpseven<\zEro\dhelpseven-\dhelpseven\fi\relax%
\ifdim\dhelpseven<\dhelpone\dhelpsix\dhelpfour%
\advance\dhelpsix\dhelpten\hAlve\dhelpsix%
\negadvAnce\dnine\dhelptwelve\dten\dhelpthirteen%
\negadvAnce\dten\dhelpfive\divthOusand\dten%
\dhelpseven\dhelpsix\divide\dnine\dten%
\negadvAnce\dhelpseven\dsix\divthOusand\dhelpseven%
\multiply\dhelpseven\dnine\advance\dhelpseven\deight%
\else\negadvAnce\dnine\dhelpten\divthOusand\yfraclen%
\divthOusand\dten\deleven\dhelpfour%
\advance\deleven\dhelpten\hAlve\deleven%
\dtwelve\dhelpfive\advance\dtwelve\dhelpeleven%
\hAlve\dtwelve\divide\dhelpthree\yfraclen%
\divide\dnine\dten\chelpnineteen\dhelpthree%
\chelpeighteen\dnine\dhelpsix\dsix\divthOusand\dhelpsix%
\multiply\dhelpsix\chelpnineteen\divthOusand\deleven%
\multiply\deleven\chelpeighteen\negadvAnce\dhelpsix\deleven%
\advance\dhelpsix\dtwelve\negadvAnce\dhelpsix\deight%
\negadvAnce\chelpnineteen\chelpeighteen%
\divide\dhelpsix\chelpnineteen\dhelpseven\dhelpsix%
\multiply\dhelpsix\thOusand\multiply\dhelpseven\chelpeighteen%
\negadvAnce\dhelpseven\deleven\advance\dhelpseven\dtwelve\fi\fi%
\fi\relax\ifnum\chelpfifteen<2\dhelpthree\dhelpsix%
\negadvAnce\dhelpthree\dhelptwelve\absdOcurve\yfraclen\dhelpthree%
\dhelpthree\dhelpseven\negadvAnce\dhelpthree\dhelpthirteen%
\absdOcurve\ifdim\dhelpthree<\yfraclen\dnine\dhelpthree%
\dhelpthree\yfraclen\yfraclen\dnine\fi\chelptwenty\thOusand%
\divthOusand\dhelpthree\divthOusand\yfraclen\relax%
\kreisdOloop\kreisdOloop\kreisdOloop\kreisdOloop\kreisdOloop%
\multiply\dhelpthree\dhelpthree\multiply\yfraclen\yfraclen%
\advance\dhelpthree\yfraclen\cfour\dhelpthree\rOot%
\multiply\cthree\thOusand\chelpsixteen\cthree\dhelpthree\dsix%
\negadvAnce\dhelpthree\dhelpsix\divide\dhelpthree\chelptwenty%
\cfour\dhelpthree\multiply\cfour\cfour\yfraclen\deight%
\negadvAnce\yfraclen\dhelpseven\divide\yfraclen\chelptwenty%
\cthree\yfraclen\multiply\cthree\cthree\advance\cfour\cthree%
\rOot\divide\chelpsixteen\cthree\relax%
\ifnum\chelpsixteen=\thOusand\relax\else%
\ifnum\chelptwenty>\thOusand\divthOusand\chelptwenty%
\multiply\dhelpthree\chelptwenty\multiply\yfraclen\chelptwenty%
\fi\multiply\dhelpthree\chelpsixteen\dsix\dhelpsix%
\deight\dhelpseven\advance\dsix\dhelpthree%
\multiply\yfraclen\chelpsixteen\advance\deight\yfraclen\fi\fi%
\dhelpthree\dhelptwelve\dhelptwelve\dhelpeight\dhelpeight\dhelpthree%
\dhelpthree\dhelpfour\dhelpfour\dhelpfourteen%
\dhelpfourteen\dhelpthree\dhelpthree\dhelpthirteen%
\dhelpthirteen\dhelpnine\dhelpnine\dhelpthree\dhelpthree\dhelpfive%
\dhelpfive\dhelpfifteen\dhelpfifteen\dhelpthree\dhelpthree\dhelpten%
\dhelpten\strok\strok\dhelpthree\dhelpthree\dhelpeleven%
\dhelpeleven\dhelpsixteen\dhelpsixteen\dhelpthree\cfour\chelptwelve%
\chelptwelve\chelpeleven\chelpeleven\cfour}%
%
\def\kreisdOloop{\ifdim\dhelpthree>.1\pt\divide\dhelpthree10%
\divide\yfraclen10\multiply\chelptwenty10\fi\relax}%
%
\def\lsqline#1{\ownsymbol{\kern.02\em{\tt x}}\curvetyp2\gridflag0%
\xscaling0\chelptwentyone0\chelptwentytwo0\chelptwelve0\relax#1%
\nosymbol\xprint\chelptwentyone\divthOusand\xprint%
\divide\xprint\gridflag\divide\chelptwentytwo\xprint%
\multiply\chelptwentytwo-\thOusand\advance\chelptwentytwo\xscaling%
\divide\chelptwelve\xprint\multiply\chelptwelve-\thOusand%
\advance\chelptwelve\chelptwentyone\multiply\chelptwentytwo10%
\divide\chelptwelve100%
\divide\chelptwentytwo\chelptwelve% 1000 slope
\multiply\xprint\chelptwentytwo\divide\xscaling\gridflag%
\negadvAnce\xscaling\xprint% intercept
\dhelptwenty\zEro\xfraclen\xscaling sp\relax%
\ifdim\xfraclen>\ylength\dhelptwenty\ylength%
\negadvAnce\dhelptwenty\xfraclen\xfraclen\ylength%
\multiply\dhelptwenty\thOusand\divide\dhelptwenty\chelptwentytwo\fi%
\ifdim\xfraclen<\zEro\dhelptwenty-\xfraclen\xfraclen\zEro%
\multiply\dhelptwenty\thOusand\divide\dhelptwenty\chelptwentytwo\fi%
\advance\xfraclen\ypos\advance\dhelptwenty\xpos%
\dhelptwo\xlength\yscaling\dhelptwo\divthOusand\yscaling%
\multiply\yscaling\chelptwentytwo\advance\yscaling\xscaling%
\ynumbering\yscaling sp\relax%
\ifdim\ynumbering>\ylength\dhelptwo\ylength\ynumbering\ylength%
\advance\dhelptwo-\xscaling sp\multiply\dhelptwo\thOusand%
\divide\dhelptwo\chelptwentytwo\fi%
\ifdim\ynumbering<\zEro\dhelptwo-\xscaling sp\ynumbering\zEro%
\multiply\dhelptwo\thOusand\divide\dhelptwo\chelptwentytwo\fi%
\advance\ynumbering\ypos\advance\dhelptwo\xpos\docOnnect}%
%
\def\dacApo#1\alfIne{\def\dacApoalfine{#1}\dacApoal}%
%
\def\dacApoal{\dacApoalfine\let\fIne\dacApoal\else%
\let\fIne\relax\fi\fIne}%
%
\def\rOot{\cthree\cfour\divide\cthree4\ifnum\cthree>0\rOo\fi}%
% Compute \cthree:=sqrt(\cfour) by a recursion formula.
\def\rOo{\roOt\let\roOz\rOo\else\let\roOz\relax\fi\roOz}%
\def\roOt{\cfive\cfour\divide\cfive\cthree%
\advance\cfive\cthree\csix\cfive\hAlve\csix%
\advance\csix5\ifnum\cthree>\csix\cthree\cfive%
\hAlve\cthree\relax}%
%
\def\docOnnect{\ifdim\dhelptwo=\dhelptwenty%
\advance\dhelptwenty\hAlf\wd2\advance\ynumbering\hAlf\dp2%
\advance\ynumbering\hAlf\ht2\advance\xfraclen\hAlf\dp2%
\advance\xfraclen\hAlf\ht2\kern\dhelptwenty%
\ifdim\ynumbering>\xfraclen\negadvAnce\xfraclen\dhelpone%
\vrUl\dhelpone\ynumbering{-\xfraclen}\else%
\negadvAnce\ynumbering\dhelpone%
\vrUl\dhelpone\xfraclen{-\ynumbering}\fi%
\kern-\dhelpone\kern-\dhelptwenty\else\ifdim\ynumbering=\xfraclen%
\advance\dhelptwenty\hAlf\wd2\advance\dhelptwo\hAlf\wd2%
\ifdim\dhelptwo>\dhelptwenty\ynumbering\dhelptwo\dhelptwo\dhelptwenty%
\dhelptwenty\ynumbering\fi\negadvAnce\dhelptwenty\dhelptwo%
\advance\xfraclen\hAlf\dp2\advance\xfraclen\hAlf\ht2%
\ynumbering\xfraclen\negadvAnce\ynumbering\dhelpone\kern\dhelptwo%
\vrUl\dhelptwenty\xfraclen{-\ynumbering}%
\kern-\dhelptwo\kern-\dhelptwenty\else\dhelpnineteen\dhelptwo%
\negadvAnce\dhelpnineteen\dhelptwenty%
\divide\dhelpnineteen\thOusand0\dhelpseventeen\ynumbering%
\negadvAnce\dhelpseventeen\xfraclen\divide\dhelpseventeen\thOusand0%
\cthree\dhelpnineteen\multiply\cthree\dhelpnineteen%
\cfour\dhelpseventeen\multiply\cfour\dhelpseventeen%
\advance\cfour\cthree\rOot\chelpthree0\cfour\thOusand0%
\negadvAnce\cfour\chelpthree\csix\wd1\multiply\csix2%
\divide\csix3\divide\csix\cthree\advance\xfraclen\hAlf\dp2%
\advance\dhelptwenty\hAlf\wd2\advance\xfraclen\hAlf\ht2%
\kern\dhelptwenty\loop\dhelptwelve\zEro%
\advance\dhelptwelve\chelpthree\dhelpnineteen\dhelpeighteen\xfraclen%
\advance\dhelpeighteen\chelpthree\dhelpseventeen\kern\dhelptwelve%
\raise\dhelpeighteen\copy1\kern-\wd1\kern-\dhelptwelve%
\advance\chelpthree\csix%
\ifnum\chelpthree<\cfour\repeat\kern-\dhelptwenty\fi\fi}%
%
\def\hpoint#1;{\ifnum\curvetyp<3\messAge{\hpointIgnored}%
\else\yfinal2\fi\point#1;}%
%
\def\vpoint#1;{\ifnum\curvetyp<3\messAge{\vpointIgnored}%
\else\yfinal1\fi\point#1;}%
%
\def\point#1.#2,#3.#4;{\dhelptwo#1.#2\pt\ynumbering\dimthree%
\negadvAnce\dhelptwo\dimone\relax\chelpone\dhelptwo%
\chelpthree\ynumbering\multiply\chelpone10%
\poInt\cthree\poInt\cfour\poInt\cfive\poInt\csix\poInt\cseven%
\ceight\chelpone\divide\ceight\chelpthree%
\ynumbering\xpos\dhelpthree\xlength%
\pOint\cthree\pOint\cfour\pOint\cfive\pOint\csix\pOint\ceight%
\dhelptwo\ynumbering\dhelpten\dhelptwo\negadvAnce\dhelpten\xpos%
\advance\dhelptwo-\hAlf\wd2%
\ynumbering#3.#4\pt\dhelpthree\dimfour\negadvAnce\ynumbering\dimtwo%
\chelpone\ynumbering\chelpthree\dhelpthree\multiply\chelpone10%
\poInt\cthree\poInt\cfour\poInt\cfive\poInt\csix\poInt\cseven%
\ceight\chelpone\divide\ceight\chelpthree%
\ynumbering\ypos\dhelpthree\ylength%
\pOint\cthree\pOint\cfour\pOint\cfive\pOint\csix\pOint\ceight%
\dhelptwelve\ynumbering\negadvAnce\dhelptwelve\ypos%
\advance\ynumbering-\hAlf\ht2\advance\ynumbering-\hAlf\dp2%
\raise\ynumbering\hbox to\xtotal{\kern\dhelptwo\copy2\hss}%
\kern-\xtotal%
%
\ifnum\curvetyp=2\advance\gridflag1\xvalint\dhelpten%
\advance\chelptwentyone\xvalint\divthOusand\xvalint%
\xvalfrac\dhelptwelve\advance\xscaling\xvalfrac\cthree\xvalint%
\multiply\cthree\xvalint\advance\chelptwelve\cthree%
\divthOusand\xvalfrac\multiply\xvalfrac\xvalint%
\advance\chelptwentytwo\xvalfrac\fi\relax%
%
\ifnum\curvetyp=3\advance\dhelptwelve\ypos%
\advance\dhelpten\xpos\immediate\write\eIns{\the\yfinal}%
\advance\dhelpten-\hAlf\dhelpone\immediate\write\eIns{\the\dhelpten}%
\advance\dhelptwelve\hAlf\dhelpone%
\immediate\write\eIns{\the\dhelptwelve}\advance\gridflag1%
\ifnum\gridflag=2\dhelpten\dhelptwenty\dhelptwelve\xfraclen\fi\fi%
\relax%
%
\ifnum\curvetyp=1\ifnum\gridflag=0\gridflag1\else%
\dhelpten\dhelptwo\dhelpeleven\ynumbering\docOnnect%
\ynumbering\dhelpeleven\dhelptwo\dhelpten\fi\fi%
%
\dhelptwenty\dhelptwo\xfraclen\ynumbering\xfinal\yfinal\yfinal0}%
%
\def\poInt#1{#1\chelpone\divide#1\chelpthree\xvalint\chelpthree%
\multiply\xvalint#1\negadvAnce\chelpone\xvalint%
\multiply\chelpone10}%
\def\pOint#1{\divide\dhelpthree10%
\advance\ynumbering#1\dhelpthree}%
%
\def\nomOrediagrams{\def\nogrid{}\def\noscale{}%
\def\noaxis{}\def\xaxis{}\def\yaxis{}\def\printsymbol{}%
\def\ownsymbol{}\def\symbol{}\def\nosymbol{}\def\values{}%
\def\curve{}\def\rOot{}\def\connect{}\def\absdOcurve{}%
\def\readAxmark{}\def\helpdOcurve{}\def\reallydOcurve{}%
\def\kreisdOcurve{}\def\lsqline{}\def\dacApo{}\def\rOo{}%
\def\roOt{}\def\dacApoal{}\def\docOnnect{}\def\poInt{}%
\def\hpoint{}\def\vpoint{}\def\point{}\def\diagram{}%
\def\pOint{}\def\negadvAnce{}\def\hAlve{}%
\def\divthOusand{}\def\vrUl{}\def\kreisdOloop{}%
\def\zEro{}\def\thOusand{}\def\hAlf{}%
%\ifnum\count17=\zwEi\advance\count17-2\fi}%
\ifnum\count17=\zwEi\global\advance\count17-2\fi}%
%
\def\nomorediagrams{\nomOrediagrams\def\nomOrediagrams{}}%
%
\def\zEro{0\em}\def\thOusand{1000}\def\hAlf{.5}%
\def\diagram#1#2{\hbox{\tenrm%
\dimendef\em250\em1em\dimendef\pt249\pt1pt%
\dimen252\fontdimen2\tenrm\fontdimen2\tenrm\zEro%
\dimen253\fontdimen3\tenrm\fontdimen3\tenrm\zEro%
\dimen254\fontdimen4\tenrm\fontdimen4\tenrm\zEro%
\dimen255\fontdimen7\tenrm\fontdimen7\tenrm\zEro%
\parindent\zEro%
\countdef\gridflag0\countdef\curvetyp1\countdef\axcount1%
\countdef\axmark20\countdef\xscaling30\countdef\yscaling40%
\countdef\xprint31\countdef\yprint41%
\countdef\xmin12\countdef\xmax14\countdef\xinc16%
\countdef\xbasis18\countdef\xfinal19\dimendef\xfraclen13%
\countdef\xvalint11\countdef\xvalfrac13\countdef\yvalfrac23%
\countdef\ymin22\countdef\ymax24\countdef\yinc26%
\countdef\ybasis28\countdef\yfinal29\dimendef\yfraclen14%
\countdef\chelpone9\countdef\chelptwo15\countdef\cthree3%
\countdef\cfour4\countdef\cfive5\countdef\csix6\countdef\cseven7%
\countdef\ceight8\countdef\chelpthree2%
\countdef\chelpfour17\countdef\chelpfive25\countdef\chelpsix27%
\countdef\chelpseven21\countdef\chelpeight39\countdef\chelpnine38%
\countdef\chelpten35\countdef\chelpeleven43\countdef\chelptwelve33%
\countdef\chelpthirteen45\countdef\chelpfourteen37%
\countdef\chelpfifteen251\countdef\chelpsixteen252%
\countdef\chelpseventeen255\countdef\chelpeighteen254%
\countdef\chelpnineteen253\countdef\chelptwenty48%
\countdef\chelptwentyone34\countdef\chelptwentytwo32%
\dimendef\strok44\dimendef\xtotal1\dimendef\ytotal2%
\dimendef\xlength3\dimendef\ylength4%
\dimendef\xpos5\dimendef\ypos6\dimendef\ynumbering10%
\dimendef\dhelpone0\dimendef\dhelptwo9\dimendef\dhelpthree11%
\dimendef\dhelpfour34\dimendef\dhelpfive35\dimendef\dhelpsix36%
\dimendef\dhelpseven37\dimendef\dhelpeight42\dimendef\dhelpnine43%
\dimendef\dhelpten30\dimendef\dhelpeleven31%
\dimendef\dhelptwelve32\dimendef\dhelpthirteen33%
\dimendef\dhelpfourteen40\dimendef\dhelpfifteen41%
\dimendef\dhelpsixteen45\dimendef\dhelpeighteen18%
\dimendef\dhelpseventeen17\dimendef\dhelpnineteen16%
\dimendef\dhelptwenty12%
\dimendef\xnumberheight8\dimendef\xnumberlength7%
\dimendef\dimone61\dimendef\dimtwo62\dimendef\dimthree63%
\dimendef\dimfour64\dimendef\dfive23\dimendef\dsix25%
\dimendef\dseven24\dimendef\deight26\dimendef\dnine15%
\dimendef\dten19\dimendef\deleven21\dimendef\dtwelve22%
\gridflag1\curvetyp0\axmark0\xscaling1\yscaling1%
\xprint1\yprint1\strok.07\em\xtotal\zEro\ytotal\zEro%
\dhelpone\strok%
\setbox4\hbox{-}#1\setbox2\hbox{0}\ifnum\axcount=3%
\vbox to\ytotal{\xpos\xtotal\negadvAnce\xpos\xlength%
\ypos\ytotal\negadvAnce\ypos\ylength%
\hbox to\xtotal{%
 \vbox to\ytotal{%
  \ifdim\wd1>\zEro\hbox to\wd1{\hss$\Bigl\uparrow$\hss}%
  \vskip2\em\box1\fi\vfill\hbox to\xtotal{\hfill\box0}%
 }%
 \kern-\xtotal\ifnum\yprint=0\dhelpone\zEro\fi%
 \raise\ytotal\hbox to\xtotal{\hfill%
 \vrUl\dhelpone\zEro\ylength\kern\xlength}%
 \kern-\xtotal\dhelpone\strok\ifnum\xprint=0%
 \dhelpone\zEro\fi\raise\ypos\hbox to\xtotal{\hfill%
 \advance\xlength\dhelpone%
 \vrUl\xlength\zEro\dhelpone}\kern-\xtotal%
 \xfinal0\advance\xnumberheight-1\hAlf\em\xaxIs\dhelpone\strok%
 \ifnum\xprint=0\dhelpone\zEro\else\hAlve\dhelpone\fi%
 \advance\xtotal-\hAlf\xnumberlength\dhelptwo\zEro%
 \advance\xlength-\hAlf\xnumberlength\advance\ylength-\hAlf\ht2%
 \ifnum\gridflag=1\dhelptwo\ylength\fi\raise\ypos%
 \hbox to\xtotal{\kern\xpos\loop%
  \vrUl\dhelpone\dhelptwo{.3\em}%
  \ifnum\xmin<\xmax\advance\xmin\xinc\hss%
  \else\xfinal1\fi\relax\ifnum\xfinal<1\repeat%
 }\kern-\xtotal\ynumbering\ypos\advance\ynumbering-\hAlf\ht2%
 \dhelpone\strok\ifnum\yprint=0\dhelpone\zEro\else%
 \hAlve\dhelpone\fi\yaxIs\dhelptwo.3\em\ifnum\gridflag=1%
 \advance\dhelptwo\xlength\fi\raise\ypos%
 \hbox to\xtotal{\kern\xpos\kern-.3\em%
  \vbox to\ylength{\xfinal0\yfinal0%
   \setbox1\hbox{%
    \vrUl\dhelptwo\zEro\dhelpone}%
   \loop\advance\xfinal1%
   \advance\ymin\yinc\ifnum\ymin>\ymax%
   \yfinal1\fi\relax\ifnum\yfinal=0\repeat%
   \loop\copy1\negadvAnce\xfinal1\relax%
   \ifnum\xfinal>0\vss\repeat}%
  \hfill}\kern-\xtotal\dhelpone\strok%
 \setbox1\hbox{\vrUl\dhelpone\zEro\dhelpone}%
 #2\hss}%
}\else\messAge{\diagramIgnored}\fi%
\fontdimen2\tenrm\dimen252\fontdimen3\tenrm\dimen253%
\fontdimen4\tenrm\dimen254\fontdimen7\tenrm\dimen255}}%
%
\def\xaxIs{\ifnum\xscaling=1\raise\xnumberheight\hbox to\xtotal{%
\kern\xpos\kern-\hAlf\xnumberlength\loop\xvalint\xmin%
\divide\xvalint\xbasis\xvalfrac\xvalint%
\multiply\xvalfrac-\xbasis\advance\xvalfrac\xmin%
\relax\ifnum\xvalfrac<0\xvalfrac-\xvalfrac\fi%
\ifnum\xvalint<0\xvalint-\xvalint\fi%
\hbox to\xnumberlength{\setbox0\hbox{\the\xvalfrac}%
\loop\ifdim\wd0<\xfraclen\setbox0\hbox{0\unhbox0}\repeat%
\hss\ifnum\xmin<0$-$\fi\number\xvalint.\box0}%
\ifnum\xmin<\xmax\advance\xmin\xinc\hss%
\else\xfinal1\fi\relax\ifnum\xfinal<1\repeat%
}\kern-\xtotal\fi}%
%
\def\yaxIs{\ifnum\yscaling=1\raise\ynumbering%
\hbox to\xpos{\advance\ylength\ht2%
\vbox to\ylength{\xfinal0\yfinal0\loop%
\advance\xfinal1\xvalint\ymin%
\divide\xvalint\ybasis\yvalfrac\xvalint%
\multiply\yvalfrac-\ybasis\advance\yvalfrac\ymin%
\relax\ifnum\yvalfrac<0\yvalfrac-\yvalfrac\fi%
\ifnum\xvalint<0\xvalint-\xvalint\fi%
\setbox\xfinal\hbox to\xpos{\setbox0\hbox{\the\yvalfrac}%
\loop\ifdim\wd0<\yfraclen\setbox0\hbox{0\unhbox0}\repeat%
\hfill\ifnum\ymin<0$-$\fi\number\xvalint.\box0\kern\hAlf\em}%
\advance\ymin\yinc\ifnum\ymin>\ymax%
\yfinal1\fi\relax\ifnum\yfinal=0\repeat%
\loop\box\xfinal\negadvAnce\xfinal1\relax%
\ifnum\xfinal>0\vss\repeat}%
}\kern-\xpos\fi}%
% Addition May 16, 1997 (allows integer coordinates in \point)
\let\oldpoint=\point
\def\point#1,#2;{%
\oldpoint\vorkOmma#1.:.\nachkOmma#1..:,\vorkOmma#2.:.\nachkOmma#2..:;}%
\def\vorkOmma#1.#2:{#1}\def\nachkOmma#1.#2:{\vorkOmma#2:}%
