      SUBROUTINE NUTATE_MATRIX( T, N )
C
C     OBTAIN THE 3 X 3 ROTATION MATRIX WHICH WILL APPLY THE NUTATION
C     IN LONGITUDE (DPSI) AND IN OBLIQUITY (DEPS) AT DYNAMIC TIME T
C     (JULIAN MILLENIA SINCE J2000) TO AN OBJECT WHOSE POSITION IS
C     EXPRESSED IN RECTANGULAR EQUATORIAL COORDINATES IN THE FK5
C     SYSTEM.
C
C     B. KNAPP, 1992-06-23, 1999-06-18
C
C     REFERENCE: P. K. SEIDELMANN, EXPLANATORY SUPPLEMENT TO THE ASTRO-
C     NOMICAL ALMANAC, UNIVERSITY SCIENCE BOOKS, 1992 (P. 115).
C
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      IMPLICIT NONE
C
C     INPUT
      REAL*8 T
C
C     OUTPUT
      REAL*8 N(3,3)
C
C     LOCAL
      REAL*8 DPSI, DEPS, DDPSI, DDEPS, EPS0, EPS1, SDP, CDP,
     &   SE0, CE0, SE1, CE1
C
C     FUNCTIONS AND SUBROUTINES
      REAL*8 OBLIQ
      EXTERNAL OBLIQ, NUTATE
C
C     GET DPSI, DEPS
      CALL NUTATE( T, DPSI, DEPS, DDPSI, DDEPS )
C
C     NEED THE OBLIQUITY OF THE ECLIPTIC WITH AND WITHOUT NUTATION
      EPS0 = OBLIQ( T )
      EPS1 = EPS0+DEPS
C
C     COMPUTE THE ROTATION MATRIX
      SDP = SIN(DPSI)
      CDP = COS(DPSI)
      SE0 = SIN(EPS0)
      CE0 = COS(EPS0)
      SE1 = SIN(EPS1)
      CE1 = COS(EPS1)
C
      N(1,1) =  CDP
      N(1,2) = -CE0*SDP
      N(1,3) = -SE0*SDP
      N(2,1) =  CE1*SDP
      N(2,2) =  CE0*CE1*CDP+SE0*SE1
      N(2,3) =  SE0*CE1*CDP-CE0*SE1
      N(3,1) =  SE1*SDP
      N(3,2) =  CE0*SE1*CDP-SE0*CE1
      N(3,3) =  SE0*SE1*CDP+CE0*CE1
C
      RETURN
      END
