code: public Complex dot(IVector b) {
          if ((b == null) || (size != b.size)) return new Complex(Double.NaN, Double.NaN);
  
          Complex result = new Complex(0d, 0d);
          int i;
          for (i = 0; i < size; i++) {
              result.real += realvector[i] * b.realvector[i] - imagvector[i] * b.imagvector[i];
              result.imag += realvector[i] * b.imagvector[i] + imagvector[i] * b.realvector[i];
          }
          return result;
      }
docs: Multiplication from two vectors