Why Your Phone Compass Can Point the Wrong Way
A maps app can know where you are yet show your direction incorrectly. The location marker may be on the right street while its direction indicator points sideways, rotates while you stand still, or seems to face the wrong way. That is possible because location and direction are different measurements. A phone can estimate its position from satellite navigation, Wi-Fi, mobile networks, and other information, while its compass heading depends heavily on sensing the magnetic field around the device.