Dot product of 2 vectors v1 and v2 is defined as |v1||v2|cos(θ). Or if the vectors are written as components v1=(v1x,v1y,v1z,...), v2=(v2x,v2y,v2z,...) then the dot product is just the sum of product of all the components, v1xv2x+v1yv2y+v1zv2z+...