Let's say I hold a phone sideways like I'm watching a video. Does it calculate the compass angle based on the direction of the earpiece side, the home button side of the phone, or the way I'm facing (perpendicular to the length of the phone?).
Also, what's the number system used? Does it go clockwise from 0 to 359.9999 or does it have negative degrees up to 180 and positive up to 180?
I'm trying to make something move based on the direction of the phone and it's very perplexing.