Extracting acceleration vector from rotated aircraft Suppose we have an aircraft with accelerometer measuring accelerations along each axis. It is mounted in a way so it is perpendicular to the plane in all axes (that should be obvious). We also have gyrometer sensor mounted on the plane - it can tell us how is the plane currently aligned (rotated) in air. 
1st case:
Suppose we have an aircraft on the ground. Then we can get our desired acceleration component just by reading the accelerometer's Z axis reading (Z axis is pointing from sky to the center of the earth).
2nd case:
The plane is in the air, doing some loops for example - now to get the desired reading as previously (acceleration towards earth) we would need to compensate the Z axis acceleration with current rotation and/or accelerations.
So, I have all the data but I don't know what physical/mathematical formulas I should use to extract the acceleration component pointing towards the earth. I would also be glad to see some tips about what literature I should read to be able to do this.
 A: Using this picture as the standard for pitch, roll and yaw

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(Roll)\right]+a_{x}\sin(Pitch)+a_{y}\sin(Roll)$$

Didn't I just answer it for you yesterday at the math stack exchange?
https://math.stackexchange.com/questions/201644/aircraft-attitude-mathematical-tool-to-extract-acceleration/201647#201647
A: The accelerometers always tell you the 3 components of acceleration - including gravity.
If the aircraft is on the ground, and the Z accelerometer is truly vertical, it will have an output equal to the value of gravity at that point on the earth.
If you know the value of gravity at that point, and subtract that from the Z accelerometer output, the result is zero. The outputs from the other 2 accelerometers will be zero.
So, allowing for local gravity, we have an acceleration vector of zero, which is correct since the aircraft is not accelerating w.r.t. the earth.
When the aircraft takes off, you need to integrate up the gyro outputs to calculate the angular orientation of the aircraft at any time. This is not trivial!
You can then use the angular orientation to calculate the acceleration vector at any time - again allowing for the value of local gravity.
This acceleration vector would usually be calculated in a reference frame that has a vertical Z axis, and can be integrated up to give velocity in that frame and position with respect to the starting point. The Z component tells you what you wanted to know.
The most complicated part of this process is using the gyro outputs to get the instantaneous angular orientation of the aircraft.
All accelerometers and gyros have errors which will affect your results.
For further details, I suggest you look for information on Inertial Navigation Systems (INS) - here or by Googling. Any decent reference on INS will cover what you need, including the integration of the gyro outputs and the errors involved.
