You haven't defined your axes.
Each axis should respond to the acceleration due to gravity as cos
(theta), where theta is the angle of _that axis_ from vertical (so you
really have theta_x, theta_y, theta_z).
You ought to be able to work backwards from there, after coiling yourself
in much trigonometry. It's best to do the math yourself -- that way you
know that it applies to your situation, and you're not depending on
someone else's competence or assumptions.
--
www.wescottdesign.com