code: public static double Magnitude(ComplexNumber z) {
          return Math.sqrt(z.real * z.real + z.imaginary * z.imaginary);
      }
docs: Magnitude of complex number.
  
  @param z Complex number.
  @return Magnitude of complex number.