This is my first post, so forgive me if I'm in the wrong place!
I know this topic has come up before, but I haven't seen quite what I need. I am basically looking for the math behind de-rotating the 3-D vectors (x,y,z) that I read out of an accelerometer, in order to compensate for gravity...