How the Heck Does GPS Work?

GPS is fundamentally a translation tool that converts time into distance using satellites, atomic clocks, and Einstein's theories of relativity to pinpoint your location.
If you're like me, you might be entirely dependent on GPS to navigate the world. At some point, you may have caught yourself wondering during those panicked moments when an exit is coming up and your phone is recalibrating: how does my phone even know where I am?
The answer is in some ways simpler than you'd expect, and in other ways more complex. GPS is fundamentally a translation tool: it converts time into distance. A satellite sends a signal, your phone catches it, and the delay between those two events tells the phone exactly how far away the satellite is. Everything else is about making that measurement precise enough to be useful: accounting for bad clocks, satellite geometry, and eventually, Einstein's theories.
The Ruler
Every GPS measurement starts with a stopwatch. A satellite broadcasts a signal at the speed of light. Your phone receives it and checks how long the trip took. Multiply the travel time by the speed of light, and you get the distance. This is the fundamental building block of GPS.
One Satellite, One Ring
Measuring a single satellite gives you a distance, but not a direction. To visualize where you might be on Earth's surface, think of two soap bubbles touching. Where they overlap, they share a perfect circle. The satellite's signal is one sphere, and the Earth is the other. Where they intersect, you get a ring on the surface. You are somewhere on this ring, because every point on it is the same distance from the satellite.
Three Satellites, One Point
One ring isn't enough since you could be anywhere along it. A second satellite produces a second ring which crosses the first one at exactly two points. A third satellite produces a third ring, which passes through only one of those two points. This process is called trilateration. Technically, three spheres intersect at two points, but one is usually deep inside Earth or far in space, so the receiver discards it.
The Clock Problem
Each GPS satellite carries an incredibly precise atomic clock. However, your phone's clock is not atomic. The fix is to add a fourth satellite. There is only one specific clock correction possible where all four spheres intersect at a single, perfect point. This allows the phone to sync with atomic time and correct its distance measurements.
The Relativity Tax
GPS must account for two distortions from Einstein's theories:
- Special Relativity: Faster objects experience slower time. Satellites move fast enough that their clocks lose 7 microseconds/day.
- General Relativity: Gravity warps time. Being further from Earth's mass makes clocks tick faster by 45 microseconds/day. Combined, satellite clocks run 38 microseconds fast per day. Without correction, GPS would be off by kilometers within hours.
A Joint Effort
Modern receivers lock onto 8 to 12 satellites from various constellations (GPS, GLONASS, Galileo, BeiDou). Extra signals help average out errors and handle Geometric Dilution of Precision (GDOP). In cities, signals can bounce off buildings (multipath error), which remains one of the hardest challenges for accuracy. It is a modern miracle that your phone pinpoints your location using light-speed signals from tens of thousands of kilometers away.
Source: Hacker News















