The vector becomes negative when it changes the direction. If a and b are in the same direction, the angle between them is zero. cos(0) = 1. soa.b= ab. whenaandbare in the opposirte direction, the angle between them is 180 degrees. And cos(180) = -1. Soa.b= abcos(180) = -ab.