title: Obtaining orientation using gyroscope and accelerometer
body: <ul>
  <li>I want to monitor the orientation of a device on 2 axis: very simply: which way is down.</li>
  <li>It must maintain accuracy over extended time period (12 hours)</li>
  <li>It will be subject to rotations and accelerations about all axes</li>
  </ul>
  
  <p>The device will be an Android phone with standard gyroscope / accelerometer. With those two sensor types, <strong>is it possible to satisfy the above requirements?</strong></p>
  
  <p><strong>My thoughts so far:</strong> An accelerometer alone cannot achieve this, since given any set of values for an instant in time, it is not possible to separate the gravitational and spacial acceleration components. And I can't get my head round how a gyroscope could help resolve that. Are there any clever formulas / algorithms which would manage this?</p>
  
  <p>Thanks</p>