      SUBROUTINE RTOFF(X1,Y1,X2,Y2,DELX,DELY)
C
C   THIS SUBROUTINE CALCULATES THE (DELX,DELY) PERPENDICULAR OFFSET
C     FROM LINE (X1,Y1), (X2,Y2), GIVEN THE END PTS OF THE LINE & THE
C     OFFSET DELTA DISTANCE DOFF (IN PLOT UNITS).
C
$INCLUDE:'pxz99.cmn'
C
      IF(Y1.NE.Y2) GO TO 10
C
C   OFFSET ONLY IN THE Y-DIRECTION.
C
      DELX=0.0
      DELY=DOFF*YRASP
      RETURN
C
C   OFFSET NORMAL (X-DIRECTION, OR OBLIQUE ANGLE).
C
   10 TA=(X1-X2)*YRASP/((Y2-Y1)*XRASP)
      DX=SQRT(DOFF*DOFF/(1.0+TA*TA))
      DY=DX*TA
      DELX=DX*XRASP
      DELY=DY*YRASP
      RETURN
      END


