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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9fe315ab08ea9576 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!postnews.google.com!x18g2000pro.googlegroups.com!not-for-mail From: Ada novice Newsgroups: comp.lang.ada Subject: Re: Arctan: to use with single or with double arguments? Date: Sat, 25 Sep 2010 01:44:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <53a2a6fa-9d48-4486-b5c7-aea81a026a82@x18g2000pro.googlegroups.com> References: <908e7aea-ed77-4dce-9f5d-e6341abc1303@s19g2000vbr.googlegroups.com> NNTP-Posting-Host: 193.11.22.91 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285404255 27437 127.0.0.1 (25 Sep 2010 08:44:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 25 Sep 2010 08:44:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x18g2000pro.googlegroups.com; posting-host=193.11.22.91; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 (.NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14250 Date: 2010-09-25T01:44:15-07:00 List-Id: On Sep 24, 11:55=A0pm, Jeffrey Carter wrote: > On 09/24/2010 02:32 PM, Ada novice wrote: > > > > > Now I know that Arctan(Y, X) =A0gives the result between -pi to pi whil= e > > Arctan(Y / X) =A0gives 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); > Thanks. This is true. The default value is 1.0 . > Since the X parameter is positive, it's clear the result will be in quadr= ant 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 fo= r X =3D > 0.0 (except when Y =3D 0.0). > > HTH. I understand that using Arctan (Y, X) gives the right quadrant. And the sine of the Arctan result will depend on the quadrant location of (X, Y). The case with Arctan (Y/X, 1.0) gives the principal value of the Arctan function i.e. between -pi/2 and pi/ 2. In my expression: Z =3D Force * Sin (A) then it was unclear to me if A in Sin (A) should be limited to -pi/2 to pi/2 or can can it from to -pi to pi.