How exactly does the sign of the dot product determine the angle between two vectors?

The dot product between two vectors $\vec v$ and $\vec w$ is given by: $$ \vec v \cdot \vec w = |\vec v||\vec w| \cos \theta $$ where $\theta$ is the angle ($0\le\theta\le \pi$) between the two vectors, so it is positive if $\cos \theta >0 \iff 0\le \theta < \pi/2$ and it is negative if $\cos \theta <0 \iff \pi/2 < \theta \le \pi$  

So, if $r$ is a straight line orthogonal to $\vec v$ and passing through its origin that divide the plane in two semiplanes, than the dot product is positive if $\vec w$ is in the same semiplane as $\vec v$ and is negative if $\vec w$ is in the other semiplane. And this is what is illustrated by the figure.