TITLE: How to get the complex number out of the polar form
QUESTION [5 upvotes]: How does one get the complex number out of this equation?

$$\Large{c = M e^{j \phi}}$$

I would like to write a function for this in C but I don't see how I can get the real and imaginary parts out of this equation to store it in a C structure.

REPLY [2 votes]: $$\mathcal{R}(c)=M\cdot\cos{\phi}$$
$$\mathcal{I}(c)=M\cdot\sin{\phi}$$
Assuming that $j^2=-1$ (Physics notation). If we follow a math notational convention where $i^2=-1$ and $j=e^{{2i\pi\over 3}}$ is a complex root of unity we just replace in the above $\phi$ by $\phi+{2i\pi\over 3}$