I am trying to understand how getRotationMatrix()and work getOrientation().
Until now, I knew that in function, getRotationMatrix()it crosses the gravity vector with the magnetic vector to get a new vector pointing to the East. And then he crosses the east vector with the gravity vector to get a vector pointing to magnetic north. According to this article , we now have three orthogonal vectors, and we can form a rotation matrix.
Here is my first question . Why should we reorient the east vector with the gravity vector again to get a vector pointing to magnetic north? Isn't that the original magnetic vector pointing to magnetic north? What is the difference between the new vector and the original magnetic vector?
Speaking of getOrientation(), here is my second question : how do azimuth, roll and height come out? Are there any equations or formulas to explain?
you can go to this website to see the code
really appreciate your attention. Many thanks!
source
share