title: How to get compass direction
body: <p>I want to show the direction on the screen that phone is facing.  For example:</p>
  
  <pre><code>   0
     |- []
     |_
    South --- North
  </code></pre>
  
  <p>In the above diagram the phone would display "North".  Since the user (the stick with 0 for his head) is holding out the phone (the [] in the diagram) pointing north.</p>
  
  <p>I found <a href="http://www.netmite.com/android/mydroid/cupcake/development/samples/Compass/src/com/example/android/compass/CompassActivity.java" rel="noreferrer">this example</a>.  I understand what it's doing except it seems to calculate yaw, pitch, roll, and inclination.  What are those and how would I use them to simply find which way the phone is pointing?</p>
  
  <p>Also this <a href="http://developer.android.com/reference/android/hardware/SensorManager.html#getOrientation(float[],%20float[])" rel="noreferrer">android documentation</a> mentions X, Y, and Z axises but I don't see anywhere that says how those axises correspond to the phone?  Is Z going from the bottom of the phone to the top?</p>