From what I've read on Wikipedia, it looks like you want the magnitude and the argument of a complex number. Suppose the real part is stored in re and the imaginary part is stored in im (both doubles, presumably). Then
double amplitude = sqrt( re * re + im * im);
double phase = atan2( re, im);
Amplitude is the absolute value in the sense that it is the distance of the complex number from the origin.
What book is this?
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Offline 2,480 posts
since Jun 2005