Magnetic XYZ to Degrees and Direction

sangee

Member
Licensed User
Longtime User
Hello,

I am trying to use the magnetic XYZ from the sensor to find the direction the device is facing. The direction I want for my program is either N,NE,E,SE and so on.. the attached example screen is from an app called Swiss army knife..

I am using the code example "Orientation and accelerometer" by Erel to get the magnetic XYZ. I tried and Googled to find the method i could convert these coordinates to directions but could find any...

Can anyone please help me in converting the Magnetic XYZ to direction and degrees please...?

Assuring you that this is not one more compass program :)

Thanks,
Sangee
 

Attachments

  • example_direction.JPG
    example_direction.JPG
    13.8 KB · Views: 688
Top