I believe that in my memory this is where it comes from
![](https://latex.codecogs.com/png.latex?\bg_white a\cdot{b}=|a||b|\cos{\theta})
.
This comes from the angle for vectors.
There, what you do is replace
![](https://latex.codecogs.com/png.latex?\bg_white a)
with
![](https://latex.codecogs.com/png.latex?\bg_white b)
and then what you will have is
![](https://latex.codecogs.com/png.latex?\bg_white b\cdot{b}=|b||b|\cos{\theta})
.
The interesting part is that since
![](https://latex.codecogs.com/png.latex?\bg_white b)
lies in the same direction of
![](https://latex.codecogs.com/png.latex?\bg_white b)
then
![](https://latex.codecogs.com/png.latex?\bg_white \theta=0)
which leads to
![](https://latex.codecogs.com/png.latex?\bg_white b\cdot{b}=|b|^{2})
beccause
![](https://latex.codecogs.com/png.latex?\bg_white |b|\times{|b|}=|b|^{2})
. Note this is for two vectors going in the same direction.
For vectors going in the opposite direction
![](https://latex.codecogs.com/png.latex?\bg_white b\cdot{-b}=|b||b|\cos{\pi})
.
Vectors in this case are parallel and collinear.