title: Detecting the device upside down
body: <p>what are the correct values for detecting the device upside down?</p>
  
  <p>I have the following and it starts detecting when the user has titled the device on its back.</p>
  
  <p>I use the following values</p>
  
  <pre><code>float xx = -[acceleration x];
      float yy = [acceleration y];
      float angle = atan2(yy, xx);
  
      if(angle &gt;= 0.75 &amp;&amp; angle &lt;= 2.25)
      {
          NSLog(@"Upside down");
      }
  </code></pre>