comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Inferring array index type from array object
Date: Wed, 30 Jun 2010 07:29:32 -0700 (PDT)
Date: 2010-06-30T07:29:32-07:00	[thread overview]
Message-ID: <ba3fb9f6-eb83-4918-8d69-c2694c9ac18d@n8g2000prh.googlegroups.com> (raw)
In-Reply-To: m26311yuyi.fsf@pushface.org

On Jun 29, 10:01 pm, Simon Wright <si...@pushface.org> wrote:
> Adam Beneschan <a...@irvine.com> writes:
> > By the way, I'm not sure that the error is the main reason for having
> > this function.  The result of the two-argument arctan function is in
> > the range -pi .. +pi, as opposed to -pi/2 .. +pi/2 for the one-
> > argument variation; this allows you to get a result in any of the four
> > quadrants (instead of just two), giving you the correct result when
> > you want to compute the angle corresponding to a point (x, y) on a
> > Cartesian graph.
>
> And avoiding problems with the extremes; arctan (y / x) is a Bad Idea!

I assume you mean because x could be 0.0 (or close to it)?  Yes,
that's another case where the two-argument arctan will give you the
result you probably want (i.e. +pi/2 or -pi/2).

                           -- Adam




  reply	other threads:[~2010-06-30 14:29 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23  7:30 Inferring array index type from array object Maciej Sobczak
2010-06-23  8:01 ` Dmitry A. Kazakov
2010-06-23  9:03   ` J-P. Rosen
2010-06-23 12:24     ` Georg Bauhaus
2010-06-23 12:52       ` J-P. Rosen
2010-06-23 19:09         ` Simon Wright
2010-06-24  7:25           ` Georg Bauhaus
2010-06-23 14:38     ` Robert A Duff
2010-06-23 15:17       ` J-P. Rosen
2010-06-23 17:17         ` Robert A Duff
2010-06-24  6:16           ` J-P. Rosen
2010-06-23 12:13   ` Niklas Holsti
2010-06-23 14:27     ` Peter C. Chapin
2010-06-23 20:24       ` Niklas Holsti
2010-06-23 16:33     ` Warren
2010-06-23 17:49       ` Dmitry A. Kazakov
2010-06-23 18:45         ` Warren
2010-06-23 20:39       ` Niklas Holsti
2010-06-28 13:44         ` Warren
2010-06-28 22:18           ` Niklas Holsti
2010-06-29  1:49             ` Adam Beneschan
2010-06-29  2:10               ` (see below)
2010-06-29 16:56             ` Warren
2010-06-29 17:50               ` John B. Matthews
2010-06-29 19:31                 ` Warren
2010-06-29 20:06                   ` Jeffrey R. Carter
2010-06-29 20:16                     ` Warren
2010-06-29 20:22                   ` Adam Beneschan
2010-06-29 20:39                     ` Dmitry A. Kazakov
2010-06-29 20:55                     ` Warren
2010-06-29 21:00                       ` Warren
2010-06-29 21:47                         ` John B. Matthews
2010-06-29 21:52                         ` Damien Carbonne
2010-06-29 22:22                         ` Adam Beneschan
2010-06-30 16:43                           ` Warren
2010-06-29 21:18                       ` Jeffrey R. Carter
2010-06-30  5:01                     ` Simon Wright
2010-06-30 14:29                       ` Adam Beneschan [this message]
2010-06-29 20:28                   ` Damien Carbonne
2010-06-29 21:20                   ` John B. Matthews
2010-06-23 13:12 ` Gautier write-only
replies disabled

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