OK, so I'm stuck, I've tried a combination of what I can find in terms of atan, atan2.
I have a Yost Labs sensor. In the 3D Test Suite it's showing a heading of $\sim234$ magnetic degrees which seems about right. Going to terminal mode I get this raw data:
$$0.10613,-0.41741,-0.07403$$
Description of raw data:
Sensor settings
In no way have I been able to get that raw data to $\sim234$.
Looking for a formula to convert these gaussian vectors to magnetic heading.