To calculate A⋅B, pair up corresponding coordinates, multiply
pairs, and add together. [1,2]⋅[3,4]=1⋅3+2⋅4=3+8=11
To visualise A⋅B, project one onto the other and multiply
their lengths together i.e. project A onto B and multiply
∥A2∥×∥B∥. If they point in a similar direction the value
will be positive, if they are perpendicular to each other it will be zero, and
if they are pointing away from each other it must be negative.
For normalised vectors the dot product can be seen as a measure of similarity
because, for two normals, the magnitudes will both be 1, meaning A⋅B=∥A∥×∥B∥×cosθ
will be A⋅B=1×1×cosθ
which means A⋅B=cosθ
and cosθ=1 at θ=0°,
decreases to cosθ=0 at θ=90°,
continues to cosθ=−1 at θ=180°,
heads back to cosθ=0 at θ=270° (−90°),
and finally back up to cosθ=1 as θ approaches 360° which
is also 0°.