Home
Home
Apps
Apps
Ask
Ask
Manual
Manual
Share
Share

Problem with real and imaginary parts of complex numbers


#1

There is a problem when calling the functions re, im, RealPart and ImaginaryPart on a complex number in polar form:

Clear(a)
z = exp(@i a)
im(z) // returns: -@i*@e^(@i a) + @i 
re(z) // return: 1

re(z) should return cos(a) or at least if a is considered a complex number then @e^(-im(a))*cos(re(a)).


#2

Well, sort of. The difficulty is the form that it is in. MS IM & RE really need explicit terms, so if you do a ExpConvert ir will convert it to â…ˆsin(a)+cos(a). Then IM/Re will pick out the parts as expected.