comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Arctan: to use with single or with double arguments?
Date: Sat, 11 Feb 2012 02:46:02 -0800 (PST)
Date: 2012-02-11T02:46:02-08:00	[thread overview]
Message-ID: <e687953c-d5a3-42e5-9b7b-1529ed38153c@n12g2000yqb.googlegroups.com> (raw)
In-Reply-To: m21uq14uq5.fsf@pushface.org

On 11 Feb., 09:53, Simon Wright <si...@pushface.org> wrote:
> Adam Beneschan <a...@irvine.com> writes:
> > Yep, the arguments to Arctan in Ada (and I believe the arguments to
> > ATAN2 in Fortran) are (Y, X).
>
> Which presents a fine opportunity for confusion when you're dealing with
> Bearing (zero at North, positive clockwise); you say Arctan (X, Y).

In this case, you always should use named associations to make the
coordinate system clear - that's what named association is for.

In code reviews, I wouldn't let Arctan (a, b) pass, but always force
Arctan (Y => ..., X => ...).

It's a severe bug to use positional association for Arctan!



  reply	other threads:[~2012-02-11 10:46 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
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 [this message]
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