which well what is it magnetometer it measures the earth magnetic field so earth magnetic field you might think of it as North but it's actually if you measure it in 3d it's not really north it's roughly north but it actually also points into Earth but it's known which direction at point since you are measuring in the frame of your sensor where is the magnetic field pointing and that gives you information about the orientation of the system that you have some tricky things that of course if you have something that generates its own