Re: no backwards compatibility in IDL 5.6 [message #34244 is a reply to message #34233] |
Thu, 27 February 2003 12:03   |
notspecified
Messages: 14 Registered: February 2002
|
Junior Member |
|
|
On Fri, 28 Feb 2003 08:00:08 +1300, "Mark Hadfield"
<m.hadfield@niwa.cri.nz> wrote:
> 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))."
>
I think this explains it adequately. In older versions, ATAN with a
complex argument returned a useful number --but the number it
returned didn't happen to be the arctangent of a complex argument!
Perhaps people should take a close look at Abramowitz and Stegun,
equation 4.4.39.
FWIW, if you write a program that uses incorrect, undocumented
behavior, you are asking for trouble. RSI can be blamed for not
providing a fast ARG or PHASE function, but this is a venial sin, at
worst. IMHO.
Matt Feinstein does not include his email address
in the text of usenet postings.
--------
Harvard Law of Automotive Repair: Anything that goes away
by itself will come back by itself.
|
|
|