COSMOS v7.655  COSMOSv7655
(AirShowerMC)
kdir2deg.f
Go to the documentation of this file.
1 ! real*8 x, y, z, t, f
2 ! real*8 pi,
3 ! * Todeg
4 ! parameter(pi = 3.141592653589793238d0,
5 ! * Todeg = 180.d0/pi)c
6 
7 ! do while(.true.)
8 ! read(*, *) t, f
9 ! if(f .gt. 500.) stop
10 ! x = sin(t/Todeg) * cos(f/Todeg)
11 ! y = sin(t/Todeg) * sin(f/Todeg)
12 ! z = cos(t/Todeg)
13 ! call kdir2deg(x, y, z, t, f)
14 ! write(*, *) ' t, f=', t, f
15 ! enddo
16 ! end
17 
18  subroutine kdir2deg(dx, dy, dz, theta, fai)
19  implicit none
20  real*8 dx ! input direction cos x comp.
21  real*8 dy ! input // y comp.
22  real*8 dz ! input // z comp.
23 
24  real*8 theta ! output. zenith angle in deg. 0 to 180
25  real*8 fai ! output. azimuthal angle in deg. 0 to 360
26 
27 ! constants thru Cosmos
28  real*8 pi,
29  * todeg
30  parameter(pi = 3.141592653589793238d0,
31  * todeg = 180.d0/pi)
32 
33  theta = acos(dz)*todeg
34  if(dx .eq. 0) then
35  fai = 0.
36  else
37  fai = atan2(dy, dx)*todeg
38  if(fai .lt. 0.) then
39  fai = fai + 360.
40  endif
41  endif
42  end
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine kdir2deg(dx, dy, dz, theta, fai)
Definition: kdir2deg.f:19