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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!g6g2000pro.googlegroups.com!not-for-mail From: jpwoodruff Newsgroups: comp.lang.ada Subject: Re: Arctan: to use with single or with double arguments? Date: Sat, 25 Sep 2010 21:02:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <908e7aea-ed77-4dce-9f5d-e6341abc1303@s19g2000vbr.googlegroups.com> <53a2a6fa-9d48-4486-b5c7-aea81a026a82@x18g2000pro.googlegroups.com> NNTP-Posting-Host: 24.4.0.129 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285473740 17777 127.0.0.1 (26 Sep 2010 04:02:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Sep 2010 04:02:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g6g2000pro.googlegroups.com; posting-host=24.4.0.129; posting-account=eLk0BgoAAAA-yA75xm1L7heSizMaESVg 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,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14259 Date: 2010-09-25T21:02:19-07:00 List-Id: On Sep 25, 2:34=A0pm, Ada novice wrote: > On Sep 25, 7:31=A0pm, Jeffrey Carter > > > > wrote: > > On 09/25/2010 01:44 AM, Ada novice wrote: > > > > 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. > > > OK. I can talk about what Ada provides, but I can't help you with domai= n questions. > > > -- > > Jeff Carter > > "We'll make Rock Ridge think it's a chicken > > that got caught in a tractor's nuts!" > > Blazing Saddles > > 87 > > It's ok. There's a good article on Arctan and Arctan2 at: > > http://en.wikipedia.org/wiki/Atan2 > > After reading that article, I decided to use Arctan2. I don't really > know why Arctan exists in the first place :). > > Cheers > YC I concur with your choice for atan2. My argument (which I just now finished, too late to be interesting) is to consider the physical situation. I presume that you are integrating physical differential equations. If that's true then "Force" has a physical meaning as a vector quantity and its direction is preserved in the terms you're computing. If my presumption is right, the vector expression of each Jacobian term also has a direction and might be in any quadrant. Of course your specification - your particular domain - might be more constrained, but even so the equations probably make sense in each quadrant. So my suggestion is to use two-parameter arctan, and interpret the quadrant of the result, and thus the sign of the sine, in the physical sense. If there is no mistake, your differential operator works even outside the particular domain where you are solving your problem. Best wishes John