The dot product between two vectors is based on the projection of one vector onto another. Let's imagine we have two vectors a and b, and we want to calculate how much of a is pointing in the same direction as the vector b. We want a quantity that would be positive if the two vectors are pointing in similar directions, zero if they are perpendicular, and negative if the two vectors are pointing in nearly opposite directions. We will define the dot product between the vectors to capture these quantities.
so for projection angle between two vectors is considered and from there cos comes.