/// <summary> /// complex power - complex exponent /// </summary> /// <param name="basis">basis</param> /// <param name="exponent">exponent</param> /// <returns>complex number exp(log(basis) * exponent).</returns> /// <remarks>The result will be the complex number exp(log(basis) * exponent). </remarks> public static complex Pow(complex basis, complex exponent) { complex ret = (basis.Log() * exponent); return ret.Exp(); }
/// <summary> /// complex power for real exponent /// </summary> /// <param name="input">basis </param> /// <param name="exponent">exponent</param> /// <returns>result of input power exponent</returns> /// <remarks>the computation will be carried out by /// <para>exp(log(input) * exponent)</para></remarks> public static complex Pow(complex input, double exponent) { complex ret = input.Log(); ret.imag *= exponent; ret.real *= exponent; return ret.Exp(); }