Measuring angle on platform over long periods of time

Thank you all for the hints!

PeterH:
If the moving platform was only moving a little bit then you could just average the nett acceleration vector over a long enough time to average out the movements. The result would be the acceleration due to gravity, and from that you could work out the orientation of the platform.

What is the formula to use for average the movements?