Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: ker2x on December 08, 2010, 12:32:35 AM




Title: Multiply the conjugate of 2 complex Number
Post by: ker2x on December 08, 2010, 12:32:35 AM
I'm in doubt, can you tell me of i'm doing it right please ?

Code:
        public static ComplexF ConjugateAndMultiply(ComplexF c1, ComplexF c2)
        {
            return new ComplexF(
                (c1.Real * c1.Real) + (c2.Imaginary * c2.Imaginary),
                (c1.Real * c1.Imaginary) - (c2.Real * c2.Imaginary)
                );
        }


Title: Re: Multiply the conjugate of 2 complex Number
Post by: Jesse on December 08, 2010, 01:38:58 AM
Just multiply the components out, the complex multiplication is:

c1(x,y) * c2(x,y) = (x1+iy1) * (x2+iy2)
 = x1*x2 + x1*iy2 + iy1*x2 + iy1*iy2
 = x1*x2 + x1*iy2 + iy1*x2 - y1*y2      // remember: i*i = -1
 = c(x1*x2 - y1*y2, x1*y2 + y1*x2)

( Mandelbrot: c(x,y)^2 = c(x*x - y*y, x*y + y*x = 2*x*y) )

With both conjugated:

/c1(x,y) * /c2(x,y) = (x1-iy1) * (x2-iy2)
 = x1*x2 - x1*iy2 - iy1*x2 + iy1*iy2
 = x1*x2 - x1*iy2 - iy1*x2 - y1*y2
 = c(x1*x2 - y1*y2, -x1*y2 - y1*x2)

With one conjugated you may get yourself now.

x1=c1.real
x2=c2.real
y1=c1.imaginary
y2=c2.imaginary
of course  :)