public static WWDecimalComplex Sub(WWDecimalComplex a, WWDecimalComplex b) { var r = new WWDecimalComplex(a); r.Sub(b); return(r); }
public static decimal AverageDistance(WWDecimalComplex[] a, WWDecimalComplex[] b) { if (a.Length != b.Length) { throw new ArgumentException("input array length mismatch"); } decimal d = 0M; for (int i = 0; i < a.Length; ++i) { var s = WWDecimalComplex.Sub(a[i], b[i]); d += s.Magnitude(); } d /= a.Length; return(d); }
public static WWDecimalComplex Sub(WWDecimalComplex a, WWDecimalComplex b) { var r = new WWDecimalComplex(a); r.Sub(b); return r; }