public static ComplexNumber operator /(ComplexNumber numerator, ComplexNumber denominator) { ComplexNumber number = new ComplexNumber(); double divider = (denominator * getReversal(denominator)).getA(); number = numerator * getReversal(denominator); number.setA(number.getA() / divider); number.setB(number.getB() / divider); return(number); }
public static ComplexNumber getReversal(ComplexNumber number) { ComplexNumber result = new ComplexNumber(number.getA(), number.getB() * (-1)); return(result); }