I was pondering the topic of complex numbers and how we just look at the them and extract the real and imaginary parts because it's easy given that we write it like 4+2i. I was wondering if there was some mathematical formula, in which we could put any complex number, and it would output the real (or imaginary) part of that number.
EDIT: as fleablood pointed out in the comment of this post
Which maybe seems circular as $ \overline z==Re(z)−iIm(z)$. There's also $Re(z)=cos(arg(z))$ where $arg(z)$ is the argument angle of the complex number. Note: all of these take it as given that a complex number determined/defined by two factors and find $Re(z)$ is always a matter of taking the factor or manipulating a factor that was given.
What I'm asking is, whether there's an equation or set of operations in which you could take an imaginary number and put it through some that equation (not defined by $Re(z)$ or $Im(z)$) and have it return either the real or imaginary part. Sorry for any confusion and/or ignorance on my part.