The iPhones 3 axis accelerometer and 3 axis magnetic field sensor work in a fine harmony. I guess the accelerometer tells the compass what is down so it can project the 3D field to a 2D, you can put the iPhone flat or raise it vertical and the compass direction is still correct.
But why in the world will the compass flip around when you turn it upside down (glass down). Yes I do play with my iPhone when laying on my back 😉. Is there a glitch in the compass trig math.
Because when you flip it over the head/top (the end with the off switch) is now pointing in a different direction. At least that is how mine works.
For example if I'm facing south and lift the phone over my head -- like I was reclining back and holding it above my face at some point the head/top of the phone will be pointing north and it should flip.
Same thing if you flip it side to side. If it is facing totally north or south then it doesn't flip when I turn it over, but if it isn't lined up that way then the head will be reflected over the axis and it will be facing a different direction.
Mine still points north when upside down. Depending on which way you twist the case when inverting it, the dial may have to flip 180º to keep pointing north.
This thread has been closed by the system or the community team.
You may vote for any posts you find helpful, or search the Community for additional answers.
Compass flips when iPhone is upside down
Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.