      SUBROUTINE DANG(A1,A2,B1,B2,RCOS)
      IMPLICIT REAL (A-H,O-Z)
       PI=2.0D0* ASIN(1.0D00)
       CONV = PI / 180.0D0
      ZERO=1.0D-6
      IF( ABS(A1).LT.ZERO.AND. ABS(A2).LT.ZERO) GO TO 1
      IF( ABS(B1).LT.ZERO.AND. ABS(B2).LT.ZERO) GO TO 1
      ANORM=1.0D0/ SQRT(A1**2+A2**2)
      BNORM=1.0D0/ SQRT(B1**2+B2**2)
      A1=A1*ANORM
      A2=A2*ANORM
      B1=B1*BNORM
      B2=B2*BNORM
      SINTH=(A1*B2)-(A2*B1)
      COSTH=A1*B1+A2*B2
      IF(COSTH.GT.1.0D0) COSTH=1.0D0
      IF(COSTH.LT.-1.0D0) COSTH=-1.0D0
      RCOS= ACOS(COSTH) / CONV
      IF( ABS(RCOS).LT.4.0D-4) GO TO 1
      IF(SINTH.GT.0.D0) RCOS=360.D0-RCOS
      RETURN
    1 RCOS=0.0D0
      RETURN
      END

