dot(vector2) {
                if (Matrix.isMatrix(vector2)) vector2 = vector2.to1DArray();
                var vector1 = this.to1DArray();
                if (vector1.length !== vector2.length) {
                    throw new RangeError('vectors do not have the same size');
                }
                var dot = 0;
                for (var i = 0; i < vector1.length; i++) {
                    dot += vector1[i] * vector2[i];
                }
                return dot;
            }
Computes the dot (scalar) product between the matrix and another
@param {Matrix} vector2 vector
@return {number}