title: Determine the general orientation of a 2D vector
body: <p>I have a rather simple question for you..
  I feel like I should have found the answer a long time ago but somehow I can't wrap my head around this trivial problem.</p>
  
  <p>Given a vector v = (x,y) , I would like to know it's 'general' orientation. That is either 'Up', 'Down', 'Left' or 'Right'</p>
  
  <p>A vector's general orientation is 'Up' if a Vector's orientation is between 45 and 135 degrees. 'Left' is between 135 and 225 degrees. 'Down' is between 225 and 315 degrees. 'Right' is between 315 and 45 degrees.</p>
  
  <p>I don't really care for the cases where the angle is exactly 45, 135, 225 or 315 degrees.</p>
  
  <p>The catch is, I don't want to use trigonometry. I'm pretty sure there's a simple solution.</p>
  
  <p>I think a solution could split the whole circle in eight. Here's what I have so far.</p>
  
  <pre><code>if(x &gt; 0 &amp;&amp; y &gt; x)
      return Up
  if(x &gt; 0 &amp;&amp; y &gt; 0 &amp;&amp; y &lt; x )
      return Right
  
  ... etc ...
  </code></pre>
  
  <p>Basically, I know I could find a solution. I'm more interested in your own approach to this problem.</p>
  
  <p>Thanks !</p>
  
  <p><strong>EDIT</strong> : The vector used is not normalized. You can represent any vector using a pair of points. Simply pretend the origin of the vector is (0,0).</p>