I am trying to measure linear acceleration using the MPU6050.

i need to represent the orientation of my device in Euler form in order to calculate linear acceleration. I don't know how to convert the raw gyro values to euler angles.

I know jeff rowberg has supplied libraries that can do this but for my project i need to show the actual algorithm. Once i can convert the raw values to euler angles i can do the rest from there. Please help !