dotProduct

infix fun dotProduct(other: Vector): Double(source)

Calculates the dot product of this vector and the given vector. The dot product is the sum of the products of the corresponding elements of the two vectors.

Return

The dot product of the two vectors as a double.

Parameters

other

The vector to compute the dot product with. It must have the same dimension as this vector.

Throws

if the vectors have different dimensions.