//overload simple arifmetic operators
 public static ComplexNumber operator +(ComplexNumber a, ComplexNumber b)
 {
     ComplexNumber Result = new ComplexNumber();
     Result.Re = a.Re + b.Re;
     Result.Im = a.Im + b.Im;
     return Result;
 }
 public static ComplexNumber operator *(ComplexNumber a, ComplexNumber b)
 {
     ComplexNumber Result = new ComplexNumber();
     Result.Re = a.Re * b.Re - a.Im * b.Im;
     Result.Im = a.Re * b.Im + a.Im * b.Re;
     return Result;
 }
 public ComplexNumber Divide(ComplexNumber a, ComplexNumber b)
 {
     if (b.Im != 0 || b.Re != 0)
     {
         return a / b;
     }
     else
     {
         throw new DivideByZeroException();
     }
 }
 public ComplexNumber Substract(ComplexNumber a, ComplexNumber b)
 {
     return a - b;
 }
 public ComplexNumber Multiply(ComplexNumber a, ComplexNumber b)
 {
     return a * b;
 }
 public ComplexNumber Add(ComplexNumber a, ComplexNumber b)
 {
     return a + b;
 }
 public static ComplexNumber operator /(ComplexNumber a, ComplexNumber b)
 {
     ComplexNumber Result = new ComplexNumber();
     Result.Re = (a.Re * b.Re + a.Im * b.Im) / (b.Re * b.Re + b.Im * b.Im);
     Result.Im = (a.Im * b.Re - a.Re * b.Im) / (b.Re * b.Re + b.Im * b.Im);
     return Result;
 }
 public static bool Equals(ComplexNumber obj1, ComplexNumber obj2)
 {
     if (obj1 != null || obj2 != null)
     {
         return (obj1.Re == obj2.Re || obj1.Im == obj2.Im);
     }
     else
     {
         throw new NullReferenceException();
     }
 }
 public ComplexNumber Multiply(ComplexNumber a, ComplexNumber b)
 {
     return(a * b);
 }
 public ComplexNumber Substract(ComplexNumber a, ComplexNumber b)
 {
     return(a - b);
 }
 public ComplexNumber Add(ComplexNumber a, ComplexNumber b)
 {
     return(a + b);
 }