Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Mathematica and Lisp
Replies: 16   Last Post: Mar 7, 2013 3:58 AM

 Messages: [ Previous | Next ]
 Murray Eisenberg Posts: 2,105 Registered: 12/6/04
Re: Mathematica and Lisp
Posted: Mar 7, 2013 3:58 AM

The order of arguments of the 2-argument ArcTan seems to me merely an arbitrary choice.

I cannot imagine why anybody would make the slightest fuss about it. Unless, that is, he's just determined to find things in Mathematica to carp about.

On Mar 6, 2013, at 5:55 AM, Richard Fateman <fateman@eecs.berkeley.edu> wrote:

> On 3/5/2013 7:54 PM, djmpark wrote:
>> Reverse the order of what? ArcTan of one argument has only one argument and
>> how can that be reversed? What has two arguments is the coordinate
>> specification {x, y} and they are not reversed in ArcTan[x, y].
>>
>> It is the one argument form ArcTan[y/x] that seems poorly designed and would
>> probably only be used when one knows the quotient and not x and y - so there
>> wouldn't be anything to reverse.
>>
>>
>> From: Richard Fateman [mailto:fateman@cs.berkeley.edu]
>>
>> (simple example: why does Mathematica reverse the order of arguments to
>> arctan of 2 args?)
>>
>>

> ArcTan[x,y] in Mathematica gives the ArcTan[y/x] but in the correct
> atan2 (y,x) in FORTRAN gives the arctangent of y/x). Note the order of
> arguments.
> in C++
> in Pascal
> in Java
> in Lisp (atan y x)
> in PHP
> in Python v 3.3.0
> in Ruby
>
>
>
> I was able to find just one programming language that agrees with the
> order in Mathematica.
> That is Microsoft's Excel. Now it could be that compatibility with Excel is
> more important than compatibility with those other languages. Google
> docs has to
> use the same order as Excel, but I think it is generally recognized as being
> compatible with an error.
> Just sayin'.

---
Murray Eisenberg murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2838 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

Date Subject Author
3/3/13 Richard Fateman
3/5/13 David Bailey
3/5/13 Richard Fateman
3/6/13 David Bailey
3/7/13 Richard Fateman
3/5/13 Bill Rowe
3/5/13 Richard Fateman
3/6/13 David Park
3/6/13 Richard Fateman
3/7/13 Christoph Lhotka
3/7/13 Murray Eisenberg
3/7/13 Noqsi