%%
%% This is file `coordsys.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% coordsys.dtx  (with options: `coordsys')
%% 
%% 
%%  This is the coordsys and logsys packages
%%  Copyright 2000-06 by Mogens Lemvig Hansen,
%%                       mlhansen@uniserve.com
%% 
%% This program may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version. The latest
%% version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%% 
%% This program consists of the files coordsys.dtx and coordsys.ins
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{coordsys}[2006/02/03 version 1.4]
\newcommand{\ticklength}{\relax}
\newcommand{\vtickmark}{\relax}
\newcommand{\htickmark}{\relax}
\DeclareOption{centred}{%
   \def\vtickmark{\makebox(0,0){\rule{\@wholewidth}{\ticklength}}}%
   \def\htickmark{\makebox(0,0){\rule{\ticklength}{\@wholewidth}}}%
   \def\ticklength{6\p@}%
}
\DeclareOption{outside}{%
   \def\vtickmark{\makebox(0,0)[t]{\rule{\@wholewidth}{\ticklength}}}%
   \def\htickmark{\makebox(0,0)[r]{\rule{\ticklength}{\@wholewidth}}}%
   \def\ticklength{3\p@}%
}
\DeclareOption{inside}{%
   \def\vtickmark{\makebox(0,0)[b]{\rule{\@wholewidth}{\ticklength}}}%
   \def\htickmark{\makebox(0,0)[l]{\rule{\ticklength}{\@wholewidth}}}%
   \def\ticklength{3\p@}%
}
\ExecuteOptions{centred}
\ProcessOptions
\newcommand{\vgridfromto}[2]{%
   \vbox to \z@{\vskip -#2\unitlength
               \leaders\vbox to \coordsys@w{\vss\hbox{\picsquare}\vss}
                  \vfill
               \vskip #1\unitlength}}
\newcommand{\hgridfromto}[2]{%
   \hbox to \z@{\hskip #1\unitlength
            \leaders\hbox to \coordsys@w{\hss\picsquare\hss}\hfill
            \hskip-#2\unitlength}}
\newcommand{\vgridlength}[1]{\line(0,1){#1}}
\newcommand{\hgridlength}[1]{\line(1,0){#1}}
\@ifpackageloaded{color}{%
   \newcommand{\setvlabel}[2][r]{%
      \makebox(0,0)[#1]{\colorbox{white}{$#2$}\hspace{5pt}}}
   \newcommand{\sethlabel}[2][t]{%
      \makebox(0,0)[#1]{%
         \setlength{\@tempdimc}{3pt}%
         \addtolength{\@tempdimc}{\baselineskip}%
         \rule{0pt}{\@tempdimc}\colorbox{white}{$#2$}}}%
}{% no colour
   \newcommand{\setvlabel}[2][r]{%
      \makebox(0,0)[#1]{$#2$\hspace{5\p@}}}
   \newcommand{\sethlabel}[2][t]{%
      \makebox(0,0)[#1]{%
         \setlength{\@tempdimc}{3\p@}%
         \addtolength{\@tempdimc}{\baselineskip}%
         \rule{\z@}{\@tempdimc}$#2$}}%
}% end if color package
\newcommand{\hlabel}[1]{#1}%
\newcommand{\vlabel}[1]{#1}%
\newcommand{\rescaleby}[4][]{\renewcommand{#4}[1]{{%
   \count@=##1\relax
   \ifnum\count@=0\relax
      \@tempcntb=1\relax
   \else
      \multiply\count@ #2\relax
      \ifnum\count@<0\count@=-\count@\fi
      \@EuclidGCD{\count@}{#3}%
      \count@=##1\relax
      \multiply\count@ #2\relax
      \divide\count@\@tempcnta
      \@tempcntb=#3\relax
      \divide\@tempcntb\@tempcnta
   \fi
   \ifnum\count@<0\relax
      -%
      \count@=-\count@
   \fi
   \def\coordsys@a{#1}%
   \ifx\coordsys@a\@empty\relax
      \ifnum\@tempcntb=1\relax
         \the\count@
      \else
         \frac{\the\count@}{\the\@tempcntb}%
      \fi
   \else
      \ifnum\@tempcntb=1\relax
         \ifnum\count@=1\relax
            \coordsys@a
         \else
            \the\count@\coordsys@a
         \fi
      \else
         \ifnum\count@=1\relax
            \frac{\coordsys@a}{\the\@tempcntb}%
         \else
            \frac{\the\count@}{\the\@tempcntb}\coordsys@a
         \fi
      \fi
   \fi
}}}
\newcommand{\hthickratio}{5}
\newcommand{\vthickratio}{5}
\providecommand{\text}[1]{\mbox{\scriptsize #1}}
\providecommand{\picsquare}{%
   \makebox(0,0){\rule{\@wholewidth}{\@wholewidth}}}
\let\c@@coord\count@
\newif\if@numbline
\newcommand{\tickstyle}[2]{%
   \def\thin@ticks{#1}%
   \def\thick@ticks{#2}}
\tickstyle{\thinlines}{\thicklines}
\newcommand{\@set@ticks}[6]{%
   \thin@ticks
   \edef\coordsys@c{#2}%
   \@tempcnta=#3\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta \coordsys@c\relax
   \ifnum #3>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta \coordsys@c\relax
   \edef\coordsys@a{\the\@tempcnta}%
   \@tempcntb=#4\relax
   \advance\@tempcntb -\@tempcnta\relax
   \setlength{\@tempdima}{\@tempcntb\unitlength}%
   \addtolength{\@tempdima}{-#5}%
   \ifdim\@tempdima<\z@\relax
      \def\coordsys@b{0}%
   \else
      \divide\@tempdima\unitlength\relax
      \divide\@tempdima\coordsys@c\relax
      \@tempcntb=\@tempdima%
      \advance\@tempcntb 1\relax%
      \edef\coordsys@b{\the\@tempcntb}%
   \fi
   #6%
   \thick@ticks
   \@tempcntb=#1\relax
   \multiply\@tempcntb \coordsys@c\relax
   \edef\coordsys@c{\the\@tempcntb}%
   \@tempcnta=#3\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta \coordsys@c\relax
   \ifnum #3>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta \coordsys@c\relax
   \edef\coordsys@a{\the\@tempcnta}%
   \@tempcntb=#4\relax
   \advance\@tempcntb -\@tempcnta\relax
   \setlength{\@tempdima}{\@tempcntb\unitlength}%
   \addtolength{\@tempdima}{-#5}%
   \ifdim\@tempdima<\z@\relax
      \def\coordsys@b{0}%
   \else
      \divide\@tempdima\unitlength\relax
      \divide\@tempdima#2\relax
      \@tempcntb=\@tempdima%
      \divide\@tempcntb #1\relax
      \advance\@tempcntb 1\relax
      \edef\coordsys@b{\the\@tempcntb}%
   \fi
   #6%
}
\newcommand{\numbline}{%
   \@ifstar{\@numblinefalse\hnumbline@i}
           {\@numblinetrue \hnumbline@i}}
\newcommand{\hnumbline@i}[1][10]{\leavevmode\hnumbline@ii{#1}}
\newcommand{\hnumbline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#2,0){\vector(1,0){\coordsys@w}}%
   \@set@ticks{\hthickratio}{#1}{#2}{#3}{6\p@}{
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}
   \fi
   \color@endgroup}%
   \def\coordsys@w{0}%
}
\newcommand{\vnumbline}{%
   \@ifstar{\@numblinefalse\vnumbline@i}
           {\@numblinetrue \vnumbline@i}}
\newcommand{\vnumbline@i}[1][10]{\leavevmode\vnumbline@ii{#1}}
\newcommand{\vnumbline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(0,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\vthickratio}{#1}{#2}{#3}{6\p@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}
   \fi
   \color@endgroup}%
   \def\coordsys@h{0}%
}
\newcommand{\coordsys}{%
   \def\coordsys@c{\coordsys@i}%
   \@ifstar{\@numblinefalse\coordsys@args@i}
           {\@numblinetrue \coordsys@args@i}}
\newcommand{\coordsys@args@i}[1][10]{\leavevmode
   \def\@hticksep{#1}%
   \coordsys@args@ii}
\newcommand{\coordsys@args@ii}[1][\@hticksep]{%
   \def\@vticksep{#1}%
   \coordsys@args@iii}
\def\coordsys@args@iii(#1,#2)#3{\coordsys@c{#1}{#2}(}
\def\coordsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,0){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(0,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{6\p@}{%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b{%
         \ifnum\value{@coord}=0\relax\else
            \edef\coordsys@a{\arabic{@coord}}%
            \sethlabel{\hlabel{\coordsys@a}}%
         \fi
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{6\p@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \ifnum\value{@coord}=0\relax\else
            \edef\coordsys@a{\arabic{@coord}}%
            \setvlabel{\vlabel{\coordsys@a}}%
         \fi
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@w{0}%
   \def\coordsys@h{0}%
}
\newcommand{\fcoordsys}{%
   \def\coordsys@c{\fcoordsys@i}%
   \@ifstar{\@numblinefalse\coordsys@args@i}
           {\@numblinetrue \coordsys@args@i}}
\def\fcoordsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{6\p@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{6\p@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
\newcommand{\bcoordsys}{%
   \def\coordsys@c{\bcoordsys@i}%
   \@ifstar{\@numblinefalse\coordsys@args@i}
           {\@numblinetrue \coordsys@args@i}}
\def\bcoordsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\line(1,0){\coordsys@w}}%
   \put(#1,#4){\line(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\line(0,1){\coordsys@h}}%
   \put(#3,#2){\line(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
\newcommand{\window}{%
   \def\coordsys@c{\window@i}%
   \@ifstar{\let\coordsys@a\phantom\coordsys@args@i}
           {\let\coordsys@a\relax  \coordsys@args@i}}
\def\window@i#1#2(#3,#4){{%
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta-#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta-#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\line(1,0){\coordsys@w}}%
   \put(#1,#2){\line(0,1){\coordsys@h}}%
   \put(#3,#4){\line(-1,0){\coordsys@w}}%
   \put(#3,#4){\line(0,-1){\coordsys@h}}%
   \put(#1,#2){\sethlabel[tl]%
      {\ensuremath{x_{\text{min}}=\coordsys@a{#1}}}}%
   \put(#3,#2){\sethlabel[tr]%
      {\ensuremath{x_{\text{max}}=\coordsys@a{#3}}}}%
   \put(#1,#2){\setvlabel[rb]%
      {\ensuremath{y_{\text{min}}=\coordsys@a{#2}}}}%
   \put(#1,#4){\setvlabel[rt]%
      {\ensuremath{y_{\text{max}}=\coordsys@a{#4}}}}%
   \ifnum #1<0\relax\ifnum #3>0\relax
      \vnumbline*[\@vticksep]{#2}{#4}%
   \fi\fi
   \ifnum #2<0\relax\ifnum #4>0\relax
      \numbline*[\@hticksep]{#1}{#3}%
   \fi\fi
   }%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
\newcommand{\gridstyle}[2]{\def\grid@style{\tickstyle{#1}{#2}}}
\newcommand{\grid@style}{\relax}
\newcommand{\coordgrid}{%
   \@ifstar{\def\coordsys@c{\coordgrid@ii}\coordsys@args@i}
           {\def\coordsys@c{\coordgrid@i}\coordsys@args@i}}
\def\coordgrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b
         {\vgridfromto{#2}{#4}}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridfromto{#1}{#3}}}%
   \color@endgroup}}
\def\coordgrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b
         {\vgridlength{\coordsys@h}}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridlength{\coordsys@w}}}%
   \color@endgroup}}
\newcommand{\coordgrid@calc}{%
   \@EuclidGCD{\@vticksep}{\@hticksep}%
   \@tempdima=\unitlength
   \multiply\@tempdima\@tempcnta
   \@tempdimb=2\p@\relax
   \ifdim\@tempdima<\@tempdimb
      \PackageWarning{coordsys}{The tick marks are too
         close\MessageBreak for a pretty grid}%
   \else
      \divide\@tempdima \@tempdimb\relax
      \@tempdimb=\unitlength
      \multiply\@tempdimb\@tempcnta
      \divide\@tempdimb\@tempdima
   \fi
   \edef\coordsys@w{\the\@tempdimb}%
}
\newcommand{\interval}{}
\def\interval#1#2,{%
   \def\coordsys@a{#1}%
   \def\coordsys@b{#2}%
   \def\coordsys@c{}%
   \if\coordsys@a]\def\coordsys@a{(}\fi
   \if\coordsys@a[%
      \def\coordsys@a{%
         \makebox[0.5\width][l]{\@circlefnt\char'163}}%
   \else\if\coordsys@a(%
      \def\coordsys@a{%
         \makebox[0.5\width][l]{\@circlefnt\char'143}}%
   \else\if\coordsys@a<%
      \def\coordsys@a{%
         \raisebox{-\fontdimen22\textfont2}{%
            \makebox[\z@]{$<$}}}%
   \else
      \PackageError{coordsys}
         {Bad delimiter}
         {\string\interval\space expects [, (, <, or ] %
          but got \coordsys@a}%
      \def\coordsys@a{}%
   \fi\fi\fi
   \afterassignment\interv@l\count@=}
\newcommand{\interv@l}[1]{%
   \if#1.%
      \edef\coordsys@c{\the\count@.}%
      \def\next{\afterassignment\interv@l\count@=}%
   \else
      \edef\coordsys@c{\coordsys@c\the\count@}%
      \setlength{\@tempdima}{\coordsys@b\unitlength}%
      \setlength{\@tempdima}{-\@tempdima}%
      \addtolength{\@tempdima}{\coordsys@c\unitlength}%
      \def\coordsys@c{#1}%
      \if\coordsys@c[\def\coordsys@c{)}\fi
      \if\coordsys@c]%
         \def\coordsys@c{\mbox{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'163}%
            \hskip 0.5\@tempdima
            \char'163%
            \hskip -\@tempdima}%
         }%
      \else\if\coordsys@c)%
         \def\coordsys@c{\mbox{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'143}%
            \hskip 0.5\@tempdima
            \char'143%
            \hskip -\@tempdima}%
         }%
      \else\if\coordsys@c>%
         \def\coordsys@c{%
            \raisebox{-\fontdimen22\textfont2}{%
               \makebox[\z@]{$>$}}}%
      \else
         \PackageError{coordsys}
            {Bad delimiter}
            {\string\interval\space expects ], ), <, or [ %
             but got \coordsys@c}%
         \def\coordsys@c{}%
      \fi\fi\fi
      \put(\coordsys@b,\coordsys@w){\makebox[\@tempdima][s]{%
         \coordsys@a
         \interval@line
         \coordsys@c
      }}%
      \let\next=\ignorespaces
   \fi
   \next}
\newcommand{\vinterval}{}
\def\vinterval#1#2,{%
   \def\coordsys@a{#1}%
   \def\coordsys@b{#2}%
   \def\coordsys@c{}%
   \if\coordsys@a]\def\coordsys@a{(}\fi
   \if\coordsys@a[%
      \def\coordsys@a{\hbox to\z@{%
         \@circlefnt
         \settowidth{\@tempdima}{\char'163}%
         \hskip 0.5\@tempdima minus 1fil
         \char'163%
         \hskip -0.5\@tempdima minus 1fil
         \vrule width \z@ depth \z@ height 0.5\@tempdima
      }}%
   \else\if\coordsys@a(%
      \def\coordsys@a{\hbox to\z@{%
         \@circlefnt
         \settowidth{\@tempdima}{\char'143}%
         \hskip 0.5\@tempdima minus 1fil
         \char'143%
         \hskip -0.5\@tempdima minus 1fil
         \vrule width \z@ depth \z@ height 0.5\@tempdima
      }}%
   \else\if\coordsys@a<%
      \def\coordsys@a{\hbox to\z@{\hss
         \raisebox{-\fontdimen22\textfont2}[\z@][\z@]{%
            $\vee$}\hss}}%
   \else
      \PackageError{coordsys}
         {Bad delimiter}
         {\string\vinterval\space expects [, (, <, or ] %
          but got \coordsys@a}%
      \def\coordsys@a{}%
   \fi\fi\fi
   \afterassignment\vinterv@l\count@=}
\newcommand{\vinterv@l}[1]{%
   \if#1.%
      \edef\coordsys@c{\the\count@.}%
      \def\next{\afterassignment\interv@l\count@=}%
   \else
      \edef\coordsys@c{\coordsys@c\the\count@}%
      \setlength{\@tempdima}{\coordsys@b\unitlength}%
      \setlength{\@tempdima}{-\@tempdima}%
      \addtolength{\@tempdima}{\coordsys@c\unitlength}%
      \def\coordsys@c{#1}%
      \if\coordsys@c[\def\coordsys@c{)}\fi
      \if\coordsys@c]%
         \def\coordsys@c{\hbox to\z@{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'163}%
            \hskip 0.5\@tempdima minus 1fil
            \char'163%
            \hskip -0.5\@tempdima minus 1fil
            \vrule width \z@ depth 0.5\@tempdima height \z@
         }}%
      \else\if\coordsys@c)%
         \def\coordsys@c{\hbox to\z@{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'143}%
            \hskip 0.5\@tempdima minus 1fil
            \char'143%
            \hskip -0.5\@tempdima minus 1fil
            \vrule width \z@ depth 0.5\@tempdima height \z@
         }}%
      \else\if\coordsys@c>%
         \def\coordsys@c{\hbox to\z@{\hss%
            \raisebox{-\fontdimen22\textfont2}[\z@][\z@]{%
               $\wedge$}\hss}}%
      \else
         \PackageError{coordsys}
            {Bad delimiter}
            {\string\vinterval\space expects ], ), <, or [ %
             but got \coordsys@c}%
         \def\coordsys@c{}%
      \fi\fi\fi
      \put(\coordsys@h,\coordsys@b){\vbox{%
         \setlength{\baselineskip}{\z@}%
         \setlength{\lineskip}{\z@}%
         \settoheight{\@tempdimb}{\coordsys@a}%
         \addtolength{\@tempdima}{-\@tempdimb}%
         \settodepth {\@tempdimb}{\coordsys@c}%
         \addtolength{\@tempdima}{-\@tempdimb}%
         \coordsys@c
         \vinterval@line
         \coordsys@a
      }}%
      \let\next=\ignorespaces
   \fi
   \next}
\newcommand{\intervalthickness}[2][\z@]{%
   \setlength{\@tempdima}{#2}%
   \setlength{\@tempdima}{0.5\@tempdima}%
   \setlength{\@tempdimb}{-\@tempdima}%
   \addtolength{\@tempdima}{#1}%
   \addtolength{\@tempdimb}{#1}%
   \edef\coordsys@a{\the\@tempdima}%
   \edef\coordsys@b{-\the\@tempdimb}%
   \edef\interval@line{%
      \leaders\hrule depth \coordsys@b height \coordsys@a\hss}%
   \setlength{\@tempdima}{#2}%
   \setlength{\@tempdima}{-0.5\@tempdima}%
   \addtolength{\@tempdima}{#1}%
   \edef\coordsys@a{\the\@tempdima}%
   \edef\vinterval@line{%
      \hbox to\z@{%
         \hskip \coordsys@a
         \vrule height\@tempdima width #2%
         \hss
      }%
   }%
}
\intervalthickness{1.6\p@}
\def\coordsys@w{0}
\def\coordsys@h{0}
\newcommand{\@EuclidGCD}[2]{%
   \@tempcnta=#1\relax
   \@tempcntb=#2\relax
   \loop
      \count@=\@tempcntb
      \divide\count@\@tempcnta
      \multiply\count@\@tempcnta
      \advance\count@ -\@tempcntb
      \ifnum\count@<0\relax
         \@tempcntb=\@tempcnta
         \@tempcnta=-\count@
         \repeat
}
\endinput
%%
%% End of file `coordsys.sty'.
