      subroutine trigo (cel,co,si,cosq)                                 TRIG001
c ----------------------------------------------------------------------TRIG002
c     This program module is part of the author's X-ray Library         TRIG003
c     and may not be sold or reproduced for commercial purposes.        TRIG004
c     Although it has been tested carefully, there is no warranty       TRIG005
c     regarding accuracy or freedom from side-effects.                  TRIG006
c                   (C) 1986-1994 Bernhard Rupp                         TRIG007
c ----------------------------------------------------------------------TRIG008
c     TRIGO calculates trigonometrical data for storage & future use    TRIG009
c ----------------------------------------------------------------------TRIG010
      dimension cel(6),co(3),si(3),cosq(3)                              TRIG011
                                                                        TRIG012
      deg = 57.29577951                                                 TRIG013
                                                                        TRIG014
      do 1001 i=1,3                                                     TRIG015
         if (cel(i+3).eq.90.0) then                                     TRIG016
            co(i)=0.0                                                   TRIG017
            si(i)=1.0                                                   TRIG018
         else                                                           TRIG019
            co(i)=cos(cel(i+3)/deg)                                     TRIG020
            si(i)=sin(cel(i+3)/deg)                                     TRIG021
         end if                                                         TRIG022
         cosq(i)=co(i)**2                                               TRIG023
 1001 continue                                                          TRIG024
                                                                        TRIG025
      return                                                            TRIG026
      end                                                               TRIG027
