Compute the winding number
ES6, 83 bytes

a=&gt;a.map(([x,y])=&gt;r+=Math.atan2(y*b-x*c,y*c+x*b,b=x,c=y),b=c=r=0)&amp;&amp;r/Math.PI/2


Takes as input an array of pairs of points which are interpreted as complex numbers. Rather than converting each point into an angle, the points are divided by the previous point, which Math.atan2 then converts into an angle between -π and π, thus automatically determining which way the path is winding. The sum of the angles is then 2π times the winding number.

Since Math.atan2 doesn't care about the scale of its arguments I don't actually perform the full division z / w = (z * w*) / (w * w*) instead I just multiply each point by the complex conjugate of the previous point.

Edit: Saved 4 bytes thanks to @edc65.