comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: ATAN for [0,2PI] range
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: ATAN for [0,2PI] range [message #20237] Tue, 30 May 2000 00:00
Mark Elliott is currently offline  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 Go to previous message
John-David T. Smith is currently offline  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 |*|
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem with shade_volume and the [XYZ]RANGE Keyword
Next Topic: Re: widget_table bug?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 22:56:42 PDT 2025

Total time taken to generate the page: 0.78315 seconds