If you keep if flat, it senses the magnetic north. No problem so far.The 'D' is deviation or declination and is the difference between the real north and the magnetic north. You could take that into account.If the HMC5883L sensor is tilted, you need an accelerometer to detect how much it is tilted and you have to correct it. Because of the 'I' (Inclination) the magnetism is pointing downward or upward causing a change in the direction if it is tilted.
http://www.jameco.com/Jameco/Products/ProdDS/2150248.pdfExplains declination adjustment, tilt compensation, etc.
If you keep if flat, it senses the magnetic north. No problem so far.
QuoteIf you keep if flat, it senses the magnetic north. No problem so far.That isn't really so. It is sensing the direction of the geomagnetic field at your location, which is neither "flat", nor is it pointing at magnetic north. It is a 3-D vector field.