comp.lang.ada
 help / color / mirror / Atom feed
From: jpwoodruff <jpwoodruff@gmail.com>
Subject: Re: Arctan: to use with single or with double arguments?
Date: Sat, 25 Sep 2010 21:02:19 -0700 (PDT)
Date: 2010-09-25T21:02:19-07:00	[thread overview]
Message-ID: <bef37b39-006c-4102-a04e-c7cce0d4be58@g6g2000pro.googlegroups.com> (raw)
In-Reply-To: b46080eb-8039-4155-be8a-fce86ebf0db6@f25g2000yqc.googlegroups.com

On Sep 25, 2:34 pm, Ada novice <ycalleecha...@gmx.com> wrote:
> On Sep 25, 7:31 pm, Jeffrey Carter
>
>
>
> <spam.jrcarter....@spam.not.acm.org> wrote:
> > On 09/25/2010 01:44 AM, Ada novice wrote:
>
> > > In my expression: Z = 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 domain 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



  reply	other threads:[~2010-09-26  4:02 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
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 [this message]
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