      subroutine trigo2 (co,si,t,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     TRIGO2 calculates trigonometrical data and metric tensor T        TRIG009
c     for transformation into orthorgonal coord. system (principal axes)TRIG010
c ----------------------------------------------------------------------TRIG011
      dimension co(3),si(3),t(3,3),cosq(3)                              TRIG012
                                                                        TRIG013
      t(1,1)=1                                                          TRIG014
      t(2,1)=0                                                          TRIG015
      t(3,1)=0                                                          TRIG016
                                                                        TRIG017
      t(1,2)=co(3)                                                      TRIG018
      t(2,2)=si(3)                                                      TRIG019
      t(3,2)=0                                                          TRIG020
                                                                        TRIG021
      t(1,3)=co(2)                                                      TRIG022
      t(2,3)=(co(1)-co(2)*co(3))/si(3)                                  TRIG023
      t(3,3)=1-cosq(1)-cosq(2)-cosq(3)+2*co(1)*co(2)*co(3)              TRIG024
                                                                        TRIG025
      t(3,3)=sqrt(t(3,3))/si(3)                                         TRIG026
                                                                        TRIG027
      return                                                            TRIG028
      end                                                               TRIG029
                                                                        TRIG030
                                                                        TRIG031
