public static ComplexNumber Divide ( ComplexNumber z1 , ComplexNumber z2 ) { ComplexNumber conj = ComplexNumber . Conjugate ( z2 ) ; double a = z1 . real * conj . real + ( ( z1 . imaginary * conj . imaginary ) * - 1 ) ; double b = z1 . real * conj . imaginary + ( z1 . imaginary * conj . real ) ; double c = z2 . real * conj . real + ( ( z2 . imaginary * conj . imaginary ) * - 1 ) ; return new ComplexNumber ( a / c , b / c ) ; }
Divide two complex numbers .