Files
sics/difrac/cartc.f
2000-02-07 10:38:55 +00:00

18 lines
590 B
Fortran
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
C-----------------------------------------------------------------------
C This subroutine calculates the Cartesian coordinates of a reflection
C-----------------------------------------------------------------------
SUBROUTINE CARTC (XP,YP,ZP)
INCLUDE 'COMDIF'
CO = COS((OMEGA)/DEG)
SO = SIN((OMEGA)/DEG)
CC = COS((CHI)/DEG)
SC = SIN((CHI)/DEG)
CP = COS((PHI)/DEG)
SP = SIN((PHI)/DEG)
ENGTH = 2*SIN((THETA/2)/DEG)
XP = ENGTH*(CO*CC*CP - SO*SP)
YP = ENGTH*(CO*CC*SP + SO*CP)
ZP = ENGTH*CO*SC
RETURN
END