[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ATAN for [0,2PI] range



Luis Alonso wrote:
> 
> i need for some calculations the ATAN function solved on the [0, 2PI]
> interval
> is there any direct way to do it?
> 
> thanks
>                         Luis  =)

ang=atan(Y,X)+(Y lt 0.?2*!PI:0.)

Or if you can live with [-PI,PI] then the regular atan(Y,X) will suffice.  Note
that if you have only one argument (Y/X precomputed), you cannot recover the
quadrant.

JD

-- 
 J.D. Smith                             |*|      WORK: (607) 255-5842    
 Cornell University Dept. of Astronomy  |*|            (607) 255-6263
 304 Space Sciences Bldg.               |*|       FAX: (607) 255-5875 
 Ithaca, NY 14853                       |*|