How to get full 360 sphere angle for accelerometer?

This is the most comprehensive and the clearest treatment I've seen. It deals with all the complications quite well. http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf