What does x,y,z values obtained from accelerometer in Android indicate?
android
Solution
After obtaining the values from accelerometer into mValuesAccel[3] and gravity values into mValuesMagnet[3],am executing the following methods.
enter code here
SensorManager.getRotationMatrix(mRotationMatrix, null, mValuesAccel,ValuesMagnet);
SensorManager.getOrientation(mRotationMatrix, mValuesOrientation);
After executing above methods, the values obtained in mValuesOrientation are:
mValuesOrientation[0]: i)if -ve X-axis faces west,then 0 degrees; ii)faces south, then -90 degrees; iii)faces north, then -180 or 180degrees; iv)faces east, then 90 degrees; So, it lies between -180 degrees to 180 degrees NOTE: 1)After converting the X value obtained into degrees, you will get the above values. 2)X-axis wil be from origin to right side,where your origin will be at bottom left of your phone.
mValuesOrientation[1]: if you lift your phone(which is lying on table) such that the top of phone faces sky, then you get -ve values, and +ve values in vice versa mValuesOrientation[2]: if you move your phone(which is lying on table), like turning a paper in a book, to left side it gives -ve values and right side it gives +ve values.
Problem
At first I thought: - x - tilting the phone from left - right and vice versa - y - upside down and vice versa - z - lifting the phone up and down But it doesn't seem like that. Can anyone correct me if I am wrong. I want to know these values in-order to know the angle of the phone. Is it possible to know it using these values?