title: Robust atan(y,x) on GLSL for converting XY coordinate to angle
body: <p>In GLSL (specifically 3.00 that I'm using), there are two versions of 
  <code>atan()</code>: <code>atan(y_over_x)</code> can only return angles between -PI/2, PI/2, while <code>atan(y/x)</code> can take all 4 quadrants into account so the angle range covers everything from -PI, PI, much like <code>atan2()</code> in C++. </p>
  
  <p>I would like to use the second <code>atan</code> to convert XY coordinates to angle.
  However, <code>atan()</code> in GLSL, besides not able to handle when <code>x = 0</code>, is not very stable. Especially where <code>x</code> is close to zero, the division can overflow resulting in an opposite resulting angle (you get something close to -PI/2 where you suppose to get approximately PI/2).</p>
  
  <p>What is a good, simple implementation that we can build on top of GLSL <code>atan(y,x)</code> to make it more robust?</p>