Home / Ciencia y Espacio / Behind GPS: the mathematics that pins you down to three meters

Behind GPS: the mathematics that pins you down to three meters

You open the maps app, and in under a second you know exactly where you are. The system that makes this possible does not depend on a giant antenna or your carrier: it depends on 31 satellites about 20,200 kilometers overhead, on atomic clocks, and on an equation with four unknowns that your phone solves silently.

First, forget the “triangulation” myth. GPS does not triangulate: it trilaterates. Triangulation measures angles; trilateration measures distances. Each satellite broadcasts a continuous signal containing its exact position and the precise time it was transmitted. Your receiver measures how long the signal takes to arrive and, knowing it travels at the speed of light (about 299,792 km/s), converts that time into distance: d = c × t.

A single distance tells you that you are somewhere on a sphere centered on the satellite. Two distances narrow the region to a circle (the intersection of two spheres). Three distances bound it to two points. And the fourth signal breaks the tie and, along the way, solves the system’s biggest problem: your phone’s clock.

The cheap clock and the four unknowns

The satellites carry cesium atomic clocks that drift no more than a few nanoseconds a day. Your phone does not: its quartz clock is millions of times less accurate, and a one-microsecond drift already means 300 meters of error. Instead of fixing the clock, GPS treats it as one more unknown. That is why we talk about four unknowns (x, y, z and the clock offset Δt) and why a fourth signal is needed. The real equation is not d = c·t but d = c·(t_received − t_sent − Δt), where Δt is the clock error the receiver infers by solving the system.

Einstein works here too

If the atomic clocks were perfectly accurate, GPS would not work: relativity shifts them in a measurable way. Under special relativity, moving at about 3.9 km/s makes the satellite clocks lose about 7 microseconds a day. But under general relativity, being in a weaker gravitational field than Earth’s surface makes them gain about 45 microseconds. The net balance is that they run ahead by about 38 microseconds per day, and engineers compensate on purpose by adjusting the oscillator frequency. Without that relativistic correction, the accumulated error would be about 10 km per day. Yes: your position depends on Einstein.

The signal: a transmission built to survive

Each satellite transmits in the L1 band at 1575.42 MHz. So that a receiver can pick out a weak, noisy signal (it arrives with less power than a pacemaker), it is modulated with a pseudorandom code called the C/A code (Coarse/Acquisition), a sequence of 1023 chips repeated every millisecond. That code acts as a signature: the receiver generates the same sequence locally and slides it until it finds maximum correlation, which gives the propagation time to nanosecond accuracy.

Several errors add noise to the accuracy: ionospheric delay (estimated with a model called Klobuchar and, in dual-frequency receivers, measured directly by comparing the L1 and L2 bands), multipath (the signal bouncing off buildings before it arrives), and the satellite geometry, summarized in an indicator called DOP (Dilution of Precision). The more satellites in view and the better spread across the sky, the lower the DOP and the better the fix.

From ten meters to a centimeter

With the C/A code and a clear view, a commercial receiver places you within about 5 to 10 meters. Assists fine-tune it: network-assisted GPS (AGPS) cuts the time to first fix, and satellite-based augmentation systems such as WAAS or EGNOS correct ionospheric and orbital errors. But if you need centimeter accuracy, you have to measure the carrier phase, not just the code: each cycle of the L1 signal is about 19 centimeters, and by comparing the received phase with that of a fixed base station (the RTK, Real-Time Kinematic, technique), the cycle ambiguities are resolved and you reach the centimeter level. It is the technique used by surveyors and autonomous tractors.

So next time the map pins you to the right door, remember what just happened: four satellites twenty thousand kilometers away, a relativistic clock correction, a correlation of pseudorandom codes, and a system of four equations solved in milliseconds. GPS is not magic: it is mathematics, physics, and a lot of clock.