comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Arctan: to use with single or with double arguments?
Date: Fri, 24 Sep 2010 14:55:49 -0700
Date: 2010-09-24T14:55:49-07:00	[thread overview]
Message-ID: <i7j7hm$dcv$1@tornado.tornevall.net> (raw)
In-Reply-To: <908e7aea-ed77-4dce-9f5d-e6341abc1303@s19g2000vbr.googlegroups.com>

On 09/24/2010 02:32 PM, Ada novice wrote:
>
> Now I know that Arctan(Y, X)  gives the result between -pi to pi while
> Arctan(Y / X)  gives the result between -pi/2 to pi/2.

There is no one-parameter Arctan defined in 
Ada.Numerics.Generic_Elementary_Functions; the parameter X has a default of 1.0, 
so what you're really calling is

Arctan (Y / X, 1.0);

Since the X parameter is positive, it's clear the result will be in quadrant I 
or IV, or -Pi/2 to Pi/2. Giving both parameters thus seems more accurate, as it 
correctly handles cases in all 4 quadrants. In addition, it is defined for X = 
0.0 (except when Y = 0.0).

HTH.

-- 
Jeff Carter
"We use a large, vibrating egg."
Annie Hall
44



  reply	other threads:[~2010-09-24 21:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 21:32 Arctan: to use with single or with double arguments? Ada novice
2010-09-24 21:55 ` Jeffrey Carter [this message]
2010-09-25  8:44   ` Ada novice
2010-09-25 17:31     ` Jeffrey Carter
2010-09-25 21:34       ` Ada novice
2010-09-26  4:02         ` jpwoodruff
2010-09-26  8:21           ` Ada novice
2010-09-26  7:31         ` Jeffrey Carter
2010-09-26  8:24           ` Ada novice
2012-02-11  0:26             ` Jack Mitchell
2012-02-11  1:11               ` Adam Beneschan
2012-02-11  8:53                 ` Simon Wright
2012-02-11 10:46                   ` AdaMagica
2012-02-11 15:29                     ` Simon Wright
2012-02-11 16:21                       ` Georg Bauhaus
2012-02-11 16:47                         ` Simon Wright
replies disabled

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