protected GNumber pow(GComplex x) { GNumber argument = argument(); GNumber factor = modulus().pow(x.re).divide(x.im.multiply(argument).exp()); GNumber angle = argument.multiply(x.re).add(modulus().ln().multiply(x.im)); return GComplex.polar(factor, angle); }
private GNumber divide(GComplex b) { GNumber x = re.multiply(b.re).add(im.multiply(b.im)); GNumber y = im.multiply(b.re).subtract(re.multiply(b.im)); GNumber z = b.modulusSquared(); return new GComplex(x.divide(z), y.divide(z)); }