X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 04 Feb 2007 03:22 PM by  anon
Math Function Question
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
04 Feb 2007 03:22 PM
    Is there "e raised to the complex number" or " e raised to the imaginary part of a complex number" ( "e" being a natural log base ) math function available in IDL ?

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Feb 2007 03:22 PM
    "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

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Feb 2007 03:22 PM
    James, you assumed right, it is a complex number with its real part equal to zero. I have a follow up, I need to use these "exp(complex)" numbers as elements in a matrix. Can you please advise if that would work ? Thank you so much, Alex
    You are not authorized to post a reply.