HMC5883L for heliostat orientation determination

jremington:
It turns out that if you do the rotations in a different order (unrotate by psi then unrotate by theta, see equation 9 of the Freescale application note) the resulting equations are easy to solve. I'll post the full solution and code a bit later, after I have a chance to make sure I didn't make any algebraic mistakes.

Edit: derivation attached as PDF file

that will be absolutely brilliant, thanks in advance!!

In the meanwhile am working away to try and understand this sensor better, in particular to calibrate and get the readings in-line with what should be for my geographic location (limited success so far), but will keep at it!!