## Why GPS needs at least four satellites

I found that whenever Global Positioning System (GPS) is explained, is is mentioned that a GPS receiver needs to be able to “see” at least four GPS satellites. And that is that. The explanations continue on to other GPS related things and no one seems to bother to explain why a GPS receiver (the gadget in your car or the program in your smartphone) needs line of sight to at least four GPS satellites, in order to calculate its (and inadvertently your) position.

To me, it is obvious why a GPS receiver need to see at least four satellites, but none of my friends can understand this “magic” number four. Whenever I explain this topic to my friends, they like my explanation, and when I tell them that I plan to make a blog post about it, they immediately agree and urge me to it. It is high time I wrote this blog post and here it is.

Let us say that we are in a two dimensional flat surface, and that we can (somehow, with a device or through other means) calculate our distance from a known point. In this case, all we know is that we are somewhere along the circumference of a circle, that has its center at the known point. This is because we only know our distance from this known point.

In the previous image, we the known point is denoted by red color. We know our distance from this known point. If we draw a circle that has its center in this known point and a radius equal to our distance from this known point, we are somewhere along the circumference of this circle.

So, knowing our distance from one single known point is not enough. Now let us say that we know our distance from two known points. If we draw a second circle with its center in the second known point and a radius equal to our distance form this second point, then we have the situation depicted in the following image:

We can see our two known points denoted by red color. We can only be in the intersection of the two circumferences. Thus, we narrowed things down a lot. We can be in one or a second point, pointed by the arrows.

So, if we add a third known point and we calculate our distance from it, then we have found our position. this situation is depicted in the following image:

Here, our position is in the intersection of the three circumferences and pointed by the arrow. Great! So we need to know our distance from at least three known points in order to calculate our position in a two dimensional flat surface. I write “at least three”, because the more known points we add, the more measurements we will have in order to pinpoint our position. If we have more data, we can make statistical calculations like finding an average. In any case, knowing our distance from three known points lets us know our position in two dimensions.

But this is not enough in a three dimensional space. And we need to work in 3D in order to calculate our position. If we would make 2D approximations, those approximations would be very far off the real values. Also, we need to know depth or altitude as well. For many reasons, we need to forgo the 2D approximation of a flat surface and deal with 3D geometry, in order to be adequately accurate when calculating our position.

Now, in three dimensions, when we know our position from a known point, this means that we are somewhere on the surface of a sphere, whose center is in the known point and whose radius is our distance from it. Thus, if we know our distance from a single point, the only thing we can say is that we are somewhere on the surface of a sphere. This situation is depicted in the following image:

So, if we know our distance from only one known point, we are somewhere on the surface of a sphere, whose center is the known point. So, we are somewhere on the surface this yellow sphere.

OK, what if we add another known point? Then we have two spheres. Let us see how they intersect:

We have the yellow sphere and the red sphere. Their centers are the known points. We see that the intersection of the two spheres is the circumference of a circle. Part of the red sphere is inside the yellow sphere and part of the yellow sphere is inside the red sphere. The two spheres touch, intersect along the circumference of a circle. I tell my friends to imagine stuffing a golf ball half way a baseball. Then they can visualize that the intersection of two spheres is the circumference of a circle.

OK, by knowing our distance from two known points, we know that we are on the circumference of a circle. Now let us add another known point. We have the following situation:

The black circle denotes the circumference of the yellow and red spheres, thus denotes our knowledge of our possible positions. The green sphere has as its center the third known point and its radius is our distance from this third known point. Now we can see that the sphere and the circumference of the circle intersect at two points. I tell my friends to imagine stuffing a ring half way an orange. Then they can visualize that a circle and a sphere have two points of intersection. These two points are denoted with the blue arrows in the following image:

Thus, with three known points, we come down to two possible points that can be our position. That is why we need a fourth known point. We need it in order to find (by drawing a fourth sphere) which of these two points is our position.

Thus, in three dimensions, we need to know our distance from at least four known points in order to calculate our position. These known points are the GPS satellites.

Appendix

I made the 2D drawings using Microsoft PowerPoint. I made the three dimensional drawings using POV-Ray.

I created the following pov file for the yellow sphere:

```
#include "colors.inc"

camera
{
location <0,0,-3>
look_at <0,0,0>
}

light_source
{
<0,0,-3> White
}

background
{
White
}

sphere
{
<0, 0, 0>, 1

pigment
{
color Yellow
}
}

```

I created the following pov file for the yellow sphere and the red sphere:

```
#include "colors.inc"

camera
{
location <0,0,-3>
look_at <0,0,0>
}

light_source
{
<0,0,-3> White
}

background
{
White
}

sphere
{
<0, 0, 0>, 1

pigment
{
color Yellow
}
}

sphere
{
<0.7, 0.5, -0.7>, 0.5

pigment
{
color Red
}
}

```

I created the following pov file for the black circle and the green sphere:

```
#include "colors.inc"

camera
{
location <0,0,-3>
look_at <0,0,0>
}

light_source
{
<0,0,-3> White
}

background
{
White
}

sphere
{
<0, 0, 0>, 1

pigment
{
Green
}
}

torus
{
0.4, 0.01

translate <0,0.5,-1>
rotate  <-20,-20,-20>

pigment
{
Black
}
}

```