[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ATAN for [0,2PI] range
- Subject: Re: ATAN for [0,2PI] range
- From: John-David Smith <jdsmith(at)astro.cornell.edu>
- Date: Mon, 29 May 2000 10:43:37 -0400
- Newsgroups: comp.lang.idl-pvwave
- Organization: Cornell University
- References: <8gtfvs$2sj$1@peque.uv.es>
- Sender: verified_for_usenet(at)cornell.edu (jts11 on d5079.dialup.cornell.edu)
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:19817
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 |*|