I was also thinking that maybe even using some kind of imaginary horizon line as well as manually pointing the direction which you point to, however there is already an application out there called Attitude (This application shows the pitch and roll of an accelerometer enabled device) that already could handle the horizon scenario, obviously the direction would have be done manually or based on identifying the markers, such as the sun and other stars, it certainly would be quite complex to implement and would not be perfect.