Re: ATAN for [0,2PI] range [message #20237] |
Tue, 30 May 2000 00:00 |
Mark Elliott
Messages: 10 Registered: February 1998
|
Junior Member |
|
|
try phi = (atan(y,x) + !PI) mod (2*!PI)
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 =)
--
Mark Elliott |
Dept of Radiology | Voice: (215) 898-9357
University of Pennsylvania | FAX : (215) 573-2113
Philadelphia, PA 19104 USA | Email: mark@mail.mmrrcc.upenn.edu
|
|
|
Re: ATAN for [0,2PI] range [message #20243 is a reply to message #20237] |
Mon, 29 May 2000 00:00  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
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 |*|
|
|
|