# Silly complex number question

1. Jun 28, 2008

### magda3227

If I were given a complex number, such as

12/(12+3i)

in order to find the real and imaginary parts of the number, I assume that I cannot just reduce the fraction and say the real part is 1 and the imaginary part is 4. I can almost guarantee that this will not calculate the correct answer.

So how would I find the real and imaginary parts of this number?

I'm sorry to ask such a stupid question, but I am rewriting MatLab code into ANSI C and need to separate such numbers into their real and imaginary parts.

2. Jun 28, 2008

### Integral

Staff Emeritus
Multiply the top and bottom of the complex conjugate (12-3i). This clears the denominator of the imaginary component.

3. Jun 28, 2008

### magda3227

Thank you.

Sadly, I didn't think of doing that.

4. Jun 29, 2008