Should take in a complex number then divide it by another complex number, then r
ID: 3641490 • Letter: S
Question
Should take in a complex number then divide it by another complex number, then return the final complex number result.
public ComplexNumber divide(ComplexNumber passedComplexNumber){
MyDouble denom = (this.real.multiply(this.real)).subtract(this.imag.multiply(this.imag));
return new ComplexNumber( (this.real.multiply(passedComplexNumber.real). subtract(this.imag.multiply(passedComplexNumber.imag))) .divide(denom), (((this.real.multiply(passedComplexNumber.imag)). subtract(this.imag.multiply(passedComplexNumber.real))).divide (denom)));
}