title: Android Convert device coordinate system to "user" coordinate system
body: <p>My question is similar to <a href="https://stackoverflow.com/questions/10762133/changing-sensor-coordinate-system-in-android">Changing sensor coordinate system in android</a></p>
  
  <p>I want to be able to compare a user's movements with each other regardless of device orientation. So that when the users holds out the phone in portrait orientation and bends his arm, acceleration readings are the same as when he holds out his phone in landscape and then bends his arm in the same direction.</p>
  
  <p>This is what I call the "user" coordinate system. It is different from the world coordinate system since it should not matter what wind direction the user is facing. It is different from device coordinates since it should not matter how the user holds his device.</p>
  
  <p>It is acceptable in my application to do a calibration step before each movement so the base/resting orientation matrices can be determined. Is it perhaps just a matter of multiplying the matrix of the first movement with the inverse of the second (and then with the new values?)</p>
  
  <p>The answer in the question mentioned seems about right, but I need a more concrete explanation, actual code samples would be ideal.</p>
  
  <p>Note remapCoordinateSystem won't suffice, it only accepts right angles. I need to be able to work with small deviations since the device is strapped to a wrist, which might not always be at right angles with the arm.</p>