GPS Trilateration: How Your Phone Knows Where You Are

simulator intermediate ~10 min
Loading simulation...
Position error ≈ 3-8 m — typical civilian GPS

With 4 satellites, 20ns clock error, and 5m signal noise, GPS achieves approximately 3-8 meter horizontal accuracy. Better satellite geometry (wider spread) and more satellites reduce this error.

Formula

d_i = c × (t_received - t_transmitted) = distance to satellite i
(x - x_i)² + (y - y_i)² + (z - z_i)² = (d_i + c × Δt_clock)²
HDOP = √(σ_x² + σ_y²) / σ_range

Finding Your Place from Space

Every time your phone shows a blue dot on a map, it is performing a remarkable feat of physics and mathematics. GPS satellites orbiting at 20,200 km altitude broadcast precise timing signals that travel at the speed of light. Your receiver measures the arrival time of signals from multiple satellites, calculates the distance to each, and finds the unique point in space where all those distance spheres intersect. This is trilateration — and it works to within a few meters.

The Geometry of Intersection

With one satellite, you know you are somewhere on a sphere of known radius centered on that satellite. Two satellites narrow your position to the circle where two spheres intersect. Three satellites reduce this to two points (one of which is usually in space and discarded). A fourth satellite is needed not for geometric reasons but to solve for the receiver's clock error — since even a one-microsecond timing error translates to 300 meters of range error.

Dilution of Precision

Not all satellite configurations are equal. If four satellites are clustered in one part of the sky, small measurement errors amplify into large position errors — like trying to pinpoint a location from nearly parallel sight lines. This effect is quantified by the Dilution of Precision (DOP). The ideal geometry has satellites spread evenly across the sky, with one directly overhead. This simulation lets you adjust satellite spread to see its dramatic effect on accuracy.

Error Sources and Mitigation

GPS errors come from several sources: atmospheric delays (ionosphere and troposphere bend and slow signals), multipath reflections off buildings, satellite orbit and clock errors, and receiver noise. Modern techniques like dual-frequency receivers, differential GPS, and satellite-based augmentation systems reduce these errors from meters to centimeters. This simulation models noise and clock error to show their impact on the final position fix.

FAQ

How does GPS trilateration work?

Each GPS satellite broadcasts its position and the time of transmission. The receiver measures how long each signal took to arrive and multiplies by the speed of light to get the distance to each satellite. With distances to at least 3 satellites, the receiver's position is where the corresponding spheres intersect. A 4th satellite is needed to correct the receiver's imperfect clock.

Why are 4 satellites needed for GPS?

Three distances would suffice if the receiver had a perfectly synchronized atomic clock. Since it doesn't, there are four unknowns: x, y, z position plus clock error. Four satellite measurements provide four equations to solve for four unknowns. Each additional satellite beyond 4 provides redundancy that improves accuracy.

What is dilution of precision (DOP)?

DOP quantifies how satellite geometry affects position accuracy. If satellites are clustered close together in the sky, small measurement errors cause large position errors (high DOP). If satellites are spread across the sky, the same errors cause smaller position errors (low DOP). HDOP values below 2 are considered excellent.

How accurate is civilian GPS?

Modern civilian GPS achieves 3-5 meter horizontal accuracy under good conditions. WAAS/EGNOS augmentation improves this to 1-2 meters. RTK differential GPS achieves centimeter-level accuracy. The main error sources are atmospheric delays, multipath reflections, and satellite geometry.

Sources

Embed

<iframe src="https://homo-deus.com/lab/cartography/gps-trilateration/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub