"e raised to the complex number" is handled by IDL's EXP function, which can take complex number input args with no further ado. For example,
IDL> mycomplex = complex(sqrt(2), sqrt(2))
IDL> result = exp(mycomplex)
IDL> print, result
;( 0.641436, 4.06293)
Am I correct in assuming that "the imaginary part of a complex number" can be recast as
IDL> imaginaryOnlyComplex = complex(0.0, imaginary(mycomplex))
? If yes, then the calculation below is the obvious solution to your second question:
IDL> result = exp(imaginaryOnlyComplex)
IDL> print, result
;( 0.155944, 0.987766)
(NOTE: The above calculations are single-precision floating point, but could have double-precision if I had created my initial argument with DCOMPLEX rather than COMPLEX.)
James Jones
|