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.
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.
In that form, the expresion is equivalent to the vector, in $\mathbb{R}^2$, with angle $\phi$ and length $M$. Now, with this information, can you continue?
Use Euler's relation $$c = M\cos\phi + jM\sin\phi$$
So the real part is $M\cos\phi$ and imaginary part is $M\sin\phi$ I think that's what you want right? :)
$$\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}$