/// <summary> /// Create a complex number based on an existing complex number /// </summary> /// <param name = "c"></param> public ComplexF(ComplexF c) { Re = c.Re; Im = c.Im; }
//----------------------------------------------------------------------------------- //----------------------------------------------------------------------------------- /// <summary> /// Determine whether two complex numbers are almost (i.e. within the tolerance) equivalent. /// </summary> /// <param name = "a"></param> /// <param name = "b"></param> /// <param name = "tolerance"></param> /// <returns></returns> public static bool IsEqual(ComplexF a, ComplexF b, float tolerance) { return ((Math.Abs(a.Re - b.Re) < tolerance) && (Math.Abs(a.Im - b.Im) < tolerance)); }