示例#1
0
  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);
  }
示例#2
0
 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));
 }