title: Calculate angle including reflex angles between two vectors
body: <p>I need to calculate the angle between two vectors. The vectors may be pointing in any direction, and have been normalized. I want the angle to be measured clockwise from vectorA to vectorB in some cases, and anticlockwise from vectorA to vectorB in other cases (in other words, I don't just want to know the smallest angle).</p>
  
  <p>Here's what I have</p>
  
  <pre><code>if (clockwise) angle = Math.atan2(vectorA.y, vectorA.x) - Math.atan2(vectorB.y, vectorB.x);
  else angle =  -1*(Math.atan2(vectorA.y, -vectorA.x) - Math.atan2(vectorB.y, -vectorB.x));
  </code></pre>
  
  <p>I guess this will never work for reflex angles? So how do I calculate an angle on the range 0->2pi?</p>