      DOUBLE PRECISION FUNCTION DARTNQ(Y,X)
      DOUBLE PRECISION X,Y
      IF (X) 1,2,5
    1 DARTNQ=DATAN(Y/X)+3.14159265358979323846264338328D0
      RETURN
    2 IF (Y) 3,8,4
    3 DARTNQ=4.71238898038468985769396507492D0
      RETURN
    4 DARTNQ=1.57079632679489661923132169164D0
      RETURN
    5 IF (Y) 6,8,7
    6 DARTNQ=DATAN(Y/X)+6.28318530717958647692528676656D0
      RETURN
    7 DARTNQ=DATAN(Y/X)
      RETURN
    8 DARTNQ=0.D0
      RETURN
      END
