In mathematics, the dot product or scalar product is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number.
Thus, the scalar product of vectors a = [a1, a2, a3,…an] and b = [b1, b2, b3,…, bn] is given by:
a.b = a1b1 + a2b2 + a3b3 + …. + anbn