360 degree heading from raw magnetometer readings