public SComplex Minus(SComplex x) { SComplex y; y.re = this.re - x.re; y.im = this.im - x.im; return(y); }
/* Probably wrong * public SComplex Multi(SComplex x) * { * SComplex y; * y.im = this.im * x.im + this.re * x.im; * y.re = this.re * x.im - this.im * x.re; * return y; * } */ public SComplex Multi(SComplex x) { SComplex y; y.im = re * x.im + im * x.re; y.re = re * x.re - im * x.im; return(y); }
public SComplex Plus(SComplex x) { SComplex y; y.re = this.re + x.re; y.im = this.im + x.im; return(y); }