\def\setdefaults{\special{gr setdefaults}\ignorespaces}
\def\setunitlength#1{\special{gr setunitlength #1}\setlength{\unitlength}{#1}\ignorespaces}
\def\setlinecap#1{\special{gr setlinecap #1}\ignorespaces}
\def\setlinewidth#1{\special{gr setlinewidth #1}\ignorespaces}
\def\setarrowsize#1{\special{gr setarrowsize #1}\ignorespaces}
\def\setdotsize#1{\special{gr setdotsize #1}\ignorespaces}
\def\setpoint#1{\special{gr setpoint #1}\ignorespaces}
\def\spline#1{\special{gr spline #1}\ignorespaces}
\def\closedspline#1{\special{gr closedspline #1}\ignorespaces}
\def\hermitespline#1{\special{gr hermitespline #1}\ignorespaces}
\def\lefthermitespline#1{\special{gr lefthermitespline #1}\ignorespaces}
\def\righthermitespline#1{\special{gr righthermitespline #1}\ignorespaces}
\def\poly#1{\special{gr poly #1}\ignorespaces}
\def\closedpoly#1{\special{gr closedpoly #1}\ignorespaces}
\def\setdash#1{\special{gr setdash #1}\ignorespaces}
\def\defpattern#1{\special{gr defpattern #1}\ignorespaces}
\def\defclip{\special{gr defclip}\ignorespaces}
\def\clip{\special{gr clip}\ignorespaces}
\def\whiteclip{\special{gr whiteclip}\ignorespaces}
\def\patclip{\special{gr patclip}\ignorespaces}
\def\endclip{\special{gr endclip}\ignorespaces}
\def\circpoint#1{\setpoint{#1}\circle*{3}\ignorespaces}
\def\gdot#1{\special{gr dot #1}\ignorespaces}

\def\dhang#1{\setbox0\hbox{#1}\lower\ht0\hbox{\kern-0.5\wd0\box0}}
\def\uhang#1{\setbox0\hbox{#1}\raise\dp0\hbox{\kern-0.5\wd0\box0}}
\def\lhang#1{\setbox0\hbox{#1}\lower0.5\ht0\hbox{\kern-\wd0\box0}}
\def\rhang#1{\setbox0\hbox{#1}\lower0.5\ht0\hbox{\box0}}
\def\middle#1{\setbox0\hbox{#1}\lower0.5\ht0\hbox{\kern -0.5\wd0\raise\dp0\box0}}

\def\raute(#1,#2)#3{\setpoint{[#1/2,0] [#1,#2/2] [#1/2,#2] [0,#2/2]}
 \defclip\closedpoly{@4}\whiteclip\endclip\closedpoly{@4}
 \vbox to 0pt{\vss\vbox to #2\unitlength{\vss\nointerlineskip
 \hbox to #1\unitlength{\hss#3\hss}\nointerlineskip\vss}}\ignorespaces} 

\def\Rect(#1,#2)#3{\vbox to #2\unitlength{\vss
 \nointerlineskip\hbox to #1\unitlength{\hss#3\hss}\nointerlineskip\vss
 \vglue100pt\special{}\vglue-100pt\special{gr setpoint [0,0] [#1,0] 
 [#1,#2] [0,#2]; closedpoly @4}}\ignorespaces}

\def\Erect(#1)#2{\setbox0\vbox{\vglue#1\hbox{\hskip#1#2\hskip#1}%
 \vglue#1}\vbox{\offinterlineskip
 \hbox to \wd0{\setpoint3\hss\setpoint2}\vskip\ht0\vskip\dp0
 \hbox to \wd0{\setpoint0\hss\setpoint1}\defclip
 \closedpoly{0-3}\whiteclip\endclip\vbox to 0pt{\vss\box0\vglue0pt}}}

\def\CErect(#1)#2{\setbox0\vbox{\vglue#1\hbox{\hskip#1#2\hskip#1}\vglue#1}%
\lower0.5\ht0\hbox{\kern-0.5\wd0\raise0.5\dp0\vbox{\offinterlineskip
 \hbox to \wd0{\setpoint3\hss\setpoint2}\vskip\ht0\vskip\dp0
 \hbox to \wd0{\setpoint0\hss\setpoint1}\defclip
 \closedpoly{0-3}\whiteclip\endclip\vbox to 0pt{\vss\box0\vglue0pt}}}}

\def\Emrect(#1,#2)#3{\vbox to #2\unitlength{\vss
 \nointerlineskip\hbox to #1\unitlength{\hss#3\hss}\nointerlineskip\vss
 \special{gr setpoint [0,0] [#1,0] [#1,#2] [0,#2]}}\ignorespaces}

\def\Ellipse(#1,#2)[#3]#4{\special{gr def rx=(#1)/2; def ry=(#2)/2;
  setpoint t=0..2*pi*(1-1/(#3)):#3 [rx*sin(t)+rx,-ry*cos(t)+ry];
  defclip; closedspline @#3; whiteclip; endclip}\vbox 
  to 0pt{\vss\vbox to #2\unitlength{\vss\nointerlineskip
  \hbox to #1\unitlength{\hss#4\hss}\nointerlineskip\vss}}\ignorespaces}

\def\Xtick#1{\setpoint{0,1[0,-4pt]}\poly{@-2}\dhang{\vbox{\vglue6pt\hbox{#1}}}}
\def\Ytick#1{\setpoint{0,1[-4pt,0]}\poly{@-2}\lhang{#1\kern6pt}}

\def\grid(#1,#2){\special{gr setdash 1pt 2pt; setlinewidth 0pt; 
 setlinecap}\multiput(0,0)(1,0){#1}{\special{gr setpoint 0 1[0,#2]; 
 poly 0,1}}\multiput(0,0)(0,1){#2}{\special{gr setpoint 0 1[#1,0]; 
 poly 0,1}}\special{gr setlinewidth; setdash; 
 setpoint 0,[#1,0],[#1,#2],[0,#2]; closedpoly @-4}\ignorespaces}

\endinput


