The direction of the magnetism is flat at the equator, and pointing down at the poles.
http://geokov.com/education/magnetic-declination-inclination.aspx
Magnetic dip - Wikipedia
This site tells how much the inclination is, http://magnetic-declination.com/ (if you type your location, click on the location marker).
This site tells even more, World Magnetic Model Calculator (click on the map to place the marker).
Ok thanks Erdin..
Thats not really correct. That is spurious wooly thinking which comes from the days of 2-axis magnetometers, maybe. A 3-axis magnetometer DOES NOT need to be held flat to function properly. It is always going to correctly show you the direction of the geomagnetic field ( or any other magnetic field which is present ), relative to its own current orientation. Apart from scaling and offset calibration for the different axial directions ( which will be an issue whether you are holding it flat and level, or not ), the assertion that the reading will be more inaccurate the further the compass is tilted, is simply not correct.
If you know the orientation of the device, you can always determine the projection of the magnetic field vector into a plane parallel to the ground. If you don't know the orientation of the device, you can compare the measured magnetic field vector to the expected magnetic field vector in your region, to determine the correct which needs to be made to the modelled orientation of the device.
Ok, so the 3 axis magnetometer give us magnetic field in three axis, X, Y and Z. From my program that i have posted before, I successfully get magnetic field value in all 3 axis vector. Then, i want to know where we are heading (degree from north pole) by using this data . And
according to this site:
https://www.loveelectronics.co.uk/Tutorials/8/hmc5883l-tutorial-and-arduino-library
To Calculate heading of magnetometer, we can use this formulation:
heading = arc tan (magnetic filed on Y Axis/magnetic filed on X Axis)
And finally i get the heading degrees, pretty nice when magnetometer keep flat. But, when i tilt the magnetometer (Pitch or Roll), the degrees value is change. And so far, I still not found a way to maintain the value of degree when the magnetometer tilted. Is there something wrong with my calculations?
Oh, and i found this video:
i look up for his code and he use something called Quaternion..