Search code examples
androidcompass-geolocation

Android - Calculate Compass Angle in Degrees


I have a basic app, which tells the user to point to certain angle for example 55. Now I have a compass which gets the azimuth, pitch and roll, I followed this tutorial http://android-coding.blogspot.ca/2012/03/create-our-android-compass.html.

I want to know whether just displaying the azimuth is correct, or would I need to use the pitch and roll as well to get an angle in degree to which the compass is point to.


Solution

  • The azimuth is all you need. Pitch and roll might be interesting if you will display a 3d modell of a ship compass. Most apps display a flat compass, for that you need only azimuth.
    On the screen shot in the link you posted, you see that the red arrow points to azimut (about 44-45 degrees if I remebmer correctly)