I am designing an app that needs to check the device\'s orientation (Azimuth, Pitch and Roll). I use the following code to achieve this:
Pitch is calculated as pitch = (float) Math.asin(-RMatrix[7]); The range of the arcsin function is [-PI/2, PI/2], so asin can only take value in between -PI/2 and PI/2.
pitch = (float) Math.asin(-RMatrix[7]);
arcsin
[-PI/2, PI/2]
asin
-PI/2
PI/2