code: public static ComplexNumber Pow(ComplexNumber z1, double n) {
  
          double norm = Math.pow(z1.getMagnitude(), n);
          double angle = 360 - Math.abs(Math.toDegrees(Math.atan(z1.imaginary / z1.real)));
  
          double common = n * angle;
  
          double r = norm * Math.cos(Math.toRadians(common));
          double i = norm * Math.sin(Math.toRadians(common));
  
          return new ComplexNumber(r, i);
  
      }
docs: Calculate power of a complex number.
  
  @param z1 Complex Number.
  @param n  Power.
  @return Returns a new complex number containing the power of a specified number.