Calculates the dot product between two vectors.