Compensating for Accelerometer Misalignment

Hello

I am developing a programme in C that uses a Tri Axial Accelerometer and I have become bogged down with the maths for correcting cross axis misalignment errors and was wondering if someone could help me please.

I have two papers on the subject and I have worked my way through the axis offset and scaling. But I am finding this matrix inversion and transposition more than a handful.

The papers are to be found here:

This one is the general math

http://www.summitinstruments.com/kno.../pdf/TN413.pdf

This one is to an application note from the manufacture of the device I am

using (or similar)

http://www.st.com/stonline/products/...e/an/17289.pdf

From Page 9 on is the alignment error correction stuff.

I have created a Table 2 and written the software to do Equation 1 (I think it is correct). I have managed to write a Matrix Inversion function that I think is correct as I have compared it with the Determinant and Inverted Output from the Online Matrix calculator here; Online Matrix Calculator

But now I am stuck, help would really be appreciated.

Many thanks in advance.