comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada 95 ARCTAN function
Date: Thu, 1 Mar 2007 20:43:20 +0100
Date: 2007-03-01T20:43:07+01:00	[thread overview]
Message-ID: <14xgo99a35l6$.1gbe878d71ue8$.dlg@40tude.net> (raw)
In-Reply-To: 1172775505.390886.213420@t69g2000cwt.googlegroups.com

On 1 Mar 2007 10:58:25 -0800, saag wrote:

> Does the ARCTAN(y,x) function in the ADA.NUMERICS package provide the
> same results an atan2 function call in c?  I'm trying to find out if
> Ada supplies an atan2 function (that gives an appropriate answer based
> on the quadrant the original point lies in)

A.5.1 (11) states that arctan (y, x) yields the result in the quadrant of
the point (x,y). I.e. (with circle=2pi)

       |    y>0    |    y<0
-------+-----------+----------
x>0    |  0..pi/2  | -pi/2..0
       |           |
x<0    |  pi/2..pi | -pi..-pi/2

When x is negative and y is approaches 0 changing its sign, it gets
instable (either pi or -pi). Argument_Error is propagated when x and y are
0.

(I cannot tell how this corresponds to the semantics of atan2)

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2007-03-01 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01 18:58 Ada 95 ARCTAN function saag
2007-03-01 19:38 ` Jacob Sparre Andersen
2007-03-01 20:03   ` Adam Beneschan
2007-03-04 21:16     ` Keith Thompson
2007-03-01 19:43 ` Dmitry A. Kazakov [this message]
2007-03-01 21:39   ` saag
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox