Theory:
In order to find out the telephone orientation, including azimuth, you need to turn to the plane in the real world. This plane is calculated from two non-linear vectors: gravity (accelerometer) and magnetic field. These DO GET vectors are colinear in two โplacesโ on earth, but, fortunately, it is close to the poles of the Earth.
Practice:
With a magnetic and an accelerometer you can get orientation. Unfortunately, if you send your phone to any linear acceleration or if there is magnetic interference, then the measures become noisy. Using a gyroscope significantly improves response time / accuracy (since this is a compromise), but this is not important for all applications.
nunojpg
source share