Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ulangl.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ulangl.f
1 
2 C*********************************************************************
3 
4  FUNCTION ulangl(X,Y)
5 
6 C...Purpose: to reconstruct an angle from given x and y coordinates.
7  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
8  SAVE /ludat1/
9 
10  ulangl=0.
11  r=sqrt(x**2+y**2)
12  IF(r.LT.1e-20) RETURN
13  IF(abs(x)/r.LT.0.8) THEN
14  ulangl=sign(acos(x/r),y)
15  ELSE
16  ulangl=asin(y/r)
17  IF(x.LT.0..AND.ulangl.GE.0.) THEN
18  ulangl=paru(1)-ulangl
19  ELSEIF(x.LT.0.) THEN
20  ulangl=-paru(1)-ulangl
21  ENDIF
22  ENDIF
23 
24  RETURN
25  END