PRO trsk3,xp,yp,zp,alpha,az,el,rng ; Modelled on subroutine TRSK3.FOR in GEOLB.FOR ; Distances in km ; Angle computations in radians, input/output in degrees rng=SQRT(xp*xp+yp*yp+zp*zp) az=alpha*!DTOR-ATAN(yp,xp) negaz=WHERE(az LT 0.,nnegaz) IF nnegaz GT 0 THEN REPEAT BEGIN az(negaz)=az(negaz)+2.0D0*!PI negaz=WHERE(az LT 0.,nnegaz) ENDREP UNTIL nnegaz EQ 0 toobig=WHERE(az GT 2.D0*!PI,ntoobig) IF ntoobig GT 0 THEN REPEAT BEGIN az(toobig)=az(toobig)-2.0D0*!PI toobig=WHERE(az GT 2.D0*!PI,ntoobig) ENDREP UNTIL ntoobig EQ 0 el=ATAN(zp,SQRT(xp*xp+yp*yp))*!RADEG az=az*!RADEG RETURN END