From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5f5a48f21d7f7525 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!n8g2000prh.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Inferring array index type from array object Date: Wed, 30 Jun 2010 07:29:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <6b20ed09-efc1-4df7-90f9-5e141482e8d0@d37g2000yqm.googlegroups.com> <1305oqccr1h2t$.x33x4oxwd84d$.dlg@40tude.net> <88ec2vF3uqU1@mid.individual.net> <88f9osFmcmU1@mid.individual.net> <88sld2F9m8U1@mid.individual.net> <73a0af1d-7213-44af-90fa-ed6de4c64ce8@b4g2000pra.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1277908172 20825 127.0.0.1 (30 Jun 2010 14:29:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 30 Jun 2010 14:29:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n8g2000prh.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:13009 Date: 2010-06-30T07:29:32-07:00 List-Id: On Jun 29, 10:01=A0pm, Simon Wright wrote: > Adam Beneschan writes: > > By the way, I'm not sure that the error is the main reason for having > > this function. =A0The 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