Re: no backwards compatibility in IDL 5.6 [message #34251 is a reply to message #34248] |
Thu, 27 February 2003 11:00   |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
So, as I understand it, the situation is this:
- For real x & y, ATAN(x) returns the inverse tangent of x and
ATAN(x,y) returns the inverse tangent of y/x.
- In versions 5.4 and earlier, ATAN also accepted a complex
argument: ATAN(COMPLEX(x,y)) returns the inverse tangent of
y/x. Looking at the version 5.4 documentation, one would have to say
that this is undocumented, but it was supported over several
versions and used by many people.
- In version 5.5, ATAN was overhauled. The IDL 5.5 "What's New"
makes interesting reading:
"In IDL 5.5, new support has been added allowing complex input to
ACOS, ASIN, and ATAN. Previously, the inverse transcendental
functions ACOS and ASIN did not accept complex input. The ATAN
function accepted complex input, Z=X+iY, but incorrectly converted
the complex number into the 2-argument ATAN(y, x) form and
returned a real result. For ATAN, support has been added for input
of two complex arguments....The ATAN function now computes the
complex arctangent for complex input. Previously, for a complex
number Z=X+iY , internally ATAN(Z) would split Z into its real and
imaginary components and compute ATAN(Y, X). IDL code that uses
this undocumented behavior should be changed by replacing calls to
ATAN(Z) with ATAN(IMAGINARY(Z), REAL_PART(Z))."
- In version 5.6, RSI responded to user feedback by introducing the
/PHASE keyword to recover the old, allegedly incorrect behaviour.
So yes, the critics are right: backwards incompatibility has been
impaired. But the damage was done in 5.5 and the changes in 5.6
represent an attempt to restore the old behaviour (but you have to add
a keyword).
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|