The Physics of GPS

An exploration of how GPS converts time into distance, utilizing atomic clocks and Einstein's theories of relativity to pinpoint locations with incredible precision.
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. If a signal takes
Why a ring?
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 Earth's surface. You are somewhere on this ring, because every point on it is the same distance from the satellite.
Note that this ring is only a perfect circle if the Earth is a perfect sphere. The Earth is slightly fatter at the equator (an oblate spheroid), so the ring is slightly warped. For the purposes of this guide, the difference is negligible.
Satellite A sends a signal to your phone at the speed of light.
Try pinging the satellite to see its signal reach Earth.
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. Each satellite gives you one equation:
Each satellite's ring passes through your location.
Try pinging the satellites one at a time.
Don't three spheres give two points, not one?
Technically, yes. Two spheres intersect to form a circle. The third sphere cuts through that circle at two points. But one of those two points is almost always an unusable location, either deep inside the Earth or thousands of kilometers out in space. The receiver discards it. So in practice, three satellites resolve to a single point on the surface.
The Clock Problem
There's a problem with the math above: it assumes your phone knows the travel time
Each GPS satellite carries an incredibly precise atomic clock, accurate to about
The fix is to add another satellite.
In simple terms: there is only one specific clock correction possible where all four spheres intersect at a single, perfect point. The 4th satellite gives the receiver enough information to find it. Once it does, it corrects every distance measurement at once, and the previously fuzzy answer snaps into focus. Conceptually, you can think about the system doing some math to figure out how to make the new red ring below perfectly intersect with the other three rings.
The math behind clock correction
Your phone's clock error (
The left side is the true geometric distance to satellite pseudorange, the distance your phone measured using its imperfect clock. It's called "pseudo" because it's wrong by the same constant offset for every satellite.
The receiver linearizes this system and iterates toward a solution for all four unknowns
This is also why your phone's clock is so accurate. It's constantly being synced to atomic clocks in space!
The Relativity Tax
Even with four satellites and a solved clock, we're not quite done yet.
To understand why, we have to think of time itself as a clock that can be sped up or slowed down by its surroundings. GPS has to account for two specific distortions:
- Special Relativity (speed): Einstein discovered that the faster an object moves, the slower time passes for it. GPS satellites move at roughly
- General Relativity (gravity): Gravity also warps time. The further you are from a massive object like Earth, the faster time ticks. The satellites orbit at
These two effects don't cancel out. The gravity gain is much stronger than the speed loss.
Without a correction, the satellite clocks would run
Engineers bake this correction into the hardware. The satellite clocks are built to tick slightly too slow on the ground, at
Without these corrections, GPS would become unusable within hours. The fact that your phone can pinpoint your location to within a few meters is, in addition to being a modern miracle, a quiet and continuous proof that Einstein was right.
A Joint Effort
In practice, your phone doesn't stop at four satellites. Modern receivers typically lock onto 8 to 12 at once, sometimes more. The extra signals don't change the core math, but they let the receiver average out errors and pick the best satellite geometry. More satellites means sharper intersections and a more stable fix.
And it's not just the American GPS constellation. Russia operates GLONASS, the EU has Galileo, and China has BeiDou. Your phone can listen to all of them simultaneously. That means over 100 atomic stopwatches orbiting overhead, built by different countries, all working together to tell you where you are.
Satellite placement also matters. If the satellites are clumped together in one part of the sky, their rings intersect at very shallow angles. This creates a wide, blurry area of uncertainty around the true position. GPS engineers call this Geometric Dilution of Precision (GDOP). Good geometry means satellites spread across the sky, so that their rings cross at sharp angles and produce a tight, high-confidence intersection point. Your phone's GPS chip automatically selects the best combination of visible satellites to minimize GDOP.
In cities, GPS signals can bounce off buildings before reaching your phone. This makes the stopwatch think you are further away than you actually are, because the signal took a longer path. This is called multipath error, and it's the main reason GPS gets less accurate in dense urban areas. Modern receivers use multiple techniques to detect and filter out these reflected signals, but it remains one of the hardest problems in GPS.
With all that said, I find it amazing that your phone can pinpoint your location to within a few meters using nothing more than the time it takes light to travel from a few satellites tens of thousands of kilometers away.
Source: Hacker News















