[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

atan/atan2 -- possible changes.



Here's how things stand at the present:

There presently are two functions for taking arctangents,
"atan" and "atan2".

The difference between them is that atan returns a value
in the range 0 to 2*pi, whereas atan2 returns a value in
the range -pi to pi.
(ie  atan:(RxR)  [0,2]
    atan2:(RxR)  [-,])

atan is defined the way it is mainly for maclisp compatibility --
nearly everybody else in the computer languages world (*including
common lisp*) believes that a function called "atan" should return
what the lisp machine's atan2 returns.

So, the $64000 question is:
 Would anybody like to vote on whether the definition of atan
 should change to be what atan2 is now???

Such a change would not take place immediately, and in the meantime
the compiler could generate a warning saying to use atan2, whose
definition will not change.

Thanks.