      SUBROUTINE trigset

C  SETS CONSTANTS AND TABLE NEEDED FOR INLINE APPROXIMATIONS TO SINE
C  AND COSINE
      INTEGER NTRIG
      PARAMETER (NTRIG = 4)
      COMMON / TRIGCOM / NTRIGS, TRIGCON, TRIGTAB
      REAL ANGDEG
      REAL HCCOS
      REAL COSONE
      REAL COSTAB
      INTEGER N
      INTEGER NSUBSC
      INTEGER NTRIGS
      REAL SINDEL
      REAL SINONE
      REAL SINTAB
      REAL SSIN
      REAL SUBSCR
      REAL TRIGCON
      REAL TRIGTAB (450 * NTRIG + 1)
C  TO USE THE IN-LINE SINE AND COSINE APPROXIMATIONS, PASS NTRIGS,
C  TRIGCON, AND TRIGTAB ( DIMENSIONED TRIGTAB(450*NTRIGS+1) ) TO
C  YOUR ROUTINE AND INCLUDE THE FOLLOWING BLOCK OF STATEMENT FUNCTIONS.
C     ANGDEG MUST BE BETWEEN -180.0 AND +180.0, OVER THIS ENTIRE RANGE
C     THE APPROXIMATIONS HAVE THE FOLLOWING ABSOLUTE ACCURACY: THEY ARE
C     EXACT FOR ANGLES WHICH ARE MULTIPLES OF ( 1.0 / NTRIGS ) DEGREES.
C     NTRIGS     COSTAB       HCCOS          SINTAB       SSIN
C
C       1       0.872E-02  0.381E-04       0.872E-02  0.381E-04
C       2       0.436E-02  0.109E-04       0.436E-02  0.113E-04
C       3       0.291E-02  0.924E-05       0.291E-02  0.900E-05
C       4       0.218E-02  0.787E-05       0.217E-02  0.721E-05
C       5       0.174E-02  0.555E-05       0.174E-02  0.507E-05
C       6       0.145E-02  0.596E-05       0.145E-02  0.560E-05
C  SET ENTRIES IN COMMON BLOCK /TRIGCOM/
      subscr(angdeg) = ntrigs * (angdeg + 180.0) + 1.5
      nsubsc(angdeg) = ifix(subscr(angdeg))
      sindel(angdeg) = (subscr(angdeg) - nsubsc(angdeg) - 0.5) * trigcon
      sintab(angdeg) = trigtab(nsubsc(angdeg))
      costab(angdeg) = trigtab(nsubsc(angdeg) + 90 * ntrigs)
      ssin(angdeg) = sintab(angdeg) + costab(angdeg) * sindel(angdeg)
      hccos(angdeg) = costab(angdeg) - sintab(angdeg) * sindel(angdeg)
      ntrigs = ntrig
      trigcon = 4.0 * atan(1.0) / (180.0 * ntrigs)
      do n=1,450 * ntrigs + 1
        trigtab(n) = -sin((n - 1) * trigcon)
      end do
C  EXERCISE THE STATEMENT FUNCTIONS
      cosone = hccos(1.0)
      sinone = ssin(1.0)
      RETURN
      END
