# Aircraft attitude - mathematical tool to extract acceleration

I am a junior aerospace engineer and what I am trying to do is getting the acceleration component which is perpendicular to the earth - no matter how the plane is oriented or rotated.

If the plane would always be horizontal (for e.g. on a road) I would just read the Z component of sensor readings and that'd be it. But when the plane is in the air it is different because obviously it can rotate in all directions. What I do know about the aircraft in every moment is it's attitude (roll angle, pitch angle and yaw angle - basically the angles around each axis) and accelerations (X,Y and Z axis). What I need now is a mathematical tool that would take this data and return the acceleration towards the earth.

What do you suggest?

-

and let x be the forward direction, y be the side, and z be vertical, then geometrically, it looks like the true vertical acceleartion is $$a_{z}\left[\cos(Pitch)+\cos(Row)\right]+a_{x}\sin(Pitch)+a_{y}\sin(Roll)$$