mma 7260q and arduino for roll and pitch angle

i am able to interface MMA7260q to arduino. i have connected x y z to a0,a1,a2 analog inputs and proceesed to display as x=520 y=340 z=170 on lcd display. now i need help to proceed further to calculate roll and pitch angles and display on lcd. please any one help me by providing a good solution. how to convert raw output from analog ie., x=355 etc to angle