Rotary encoder together with arduino for measuring angle

Absoloute rotary encoders are expensive, I would suggest what you need here are three simple tilt switches mounted at the appropriate orientation.
Otherwise go for an accelerometer.