I must add , the vector does not point north . it indicates the [ direction and magnitude ] of the magnet field relative to the device orientation.
the link I posted is for accelerometers but the math is the same . the big difference is that gravity always points to the centre of the planet so orientation can be established




Bookmarks