/// <summary> /// Natural Logarithm of this <c>Complex</c> (Base E). /// </summary> /// <param name="complex">The <see cref="Complex"/> number to perfom this operation on.</param> /// <returns> /// The natural logarithm of this complex number. /// </returns> public static Complex NaturalLogarithm(this Complex complex) { if (complex.IsRealNonNegative()) { return(new Complex(Math.Log(complex.Real), 0.0)); } return(new Complex(0.5 * Math.Log(complex.MagnitudeSquared()), complex.Phase)); }
/// <summary> /// Returns a Norm of a value of this type, which is appropriate for measuring how /// close this value is to zero. /// </summary> /// <param name="complex">The <see cref="Complex"/> number to perfom this operation on.</param> /// <returns>A norm of this value.</returns> public static double Norm(this Complex complex) { return(complex.MagnitudeSquared()); }