Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:08

0001  
0002 C*********************************************************************
0003  
0004 C...PYANGL
0005 C...Reconstructs an angle from given x and y coordinates.
0006  
0007       FUNCTION PYANGL(X,Y)
0008  
0009 C...Double precision and integer declarations.
0010       IMPLICIT DOUBLE PRECISION(A-H, O-Z)
0011       IMPLICIT INTEGER(I-N)
0012       INTEGER PYK,PYCHGE,PYCOMP
0013 C...Commonblocks.
0014       COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
0015       SAVE /PYDAT1/
0016  
0017       PYANGL=0D0
0018       R=SQRT(X**2+Y**2)
0019       IF(R.LT.1D-20) RETURN
0020       IF(ABS(X)/R.LT.0.8D0) THEN
0021         PYANGL=SIGN(ACOS(X/R),Y)
0022       ELSE
0023         PYANGL=ASIN(Y/R)
0024         IF(X.LT.0D0.AND.PYANGL.GE.0D0) THEN
0025           PYANGL=PARU(1)-PYANGL
0026         ELSEIF(X.LT.0D0) THEN
0027           PYANGL=-PARU(1)-PYANGL
0028         ENDIF
0029       ENDIF
0030  
0031       RETURN
0032       END