C   27/06/79 C9073101   MEMBER NAME  RCOORD   (JADEGAMS)    FORTRAN
      SUBROUTINE RCOORD(X,PHI,STHETA)
C---  COMPUTE X- AND Y-COORDINATES WHEN Z, PHI, AND THETA OF TRACK ARE
C---  GIVEN (ALL DISTANCES IN MM, STARTING POINT IS ASSUMED TO BE 0)
C---  ROTATE X- AND Y- COORDINATES BY 45 DEGREES
C
C     H.WRIEDT      27.06.79         04:45
C     LAST MODIFICATION      30.07.79     20:10
C
      DIMENSION X(3)
C
      DATA FAKTOR/0.7071068/
C
      COMMON /CGGVRN/ NVRSN(20)
      DATA NVCODE/279073020/
C
      NVRSN(17) = NVCODE
      THESIN = X(3)*STHETA
      X(1) = THESIN*COS(PHI)
      X(2) = THESIN*SIN(PHI)
C
C---  ROTATE COORDINATES BY 45 DEGREES
      XR = (X(2)+X(1))*FAKTOR
      YR = (X(2)-X(1))*FAKTOR
      X(1) = XR
      X(2) = YR
C
      RETURN
      END
