If your phone is on, then somebody --- or at least something --- knows where you are. Whether for local business searches, geosocial networking, targeted marketing, or even emergency response, location-based mobile services have become so ubiquitous that now we mostly notice them only when they're absent. But have you ever wondered how those services work?
Where R U? (source: bdnooz.com)
Well, there are a few ways, but they all use the same basic principle. The key is that your phone, even when it's just sitting in your pocket, is in continual contact with the outside world. See those four little bars in the upper-righthand corner of your screen (unless you have AT&T)? Your phone can report its current signal strength because, well, it's getting signals. And sending them. You check your settings and notice that there are a bunch of WiFi hotspots within range? More signals. You have GPS enabled? Then you're getting updates via (freaking extraterrestrial!) signals. So many signals.
So many bars. (source: capmac.com)
The important thing about all these signals is that they take time to get where they're going. And if you know how much time it takes for signals to move between a phone and a tower/router/satellite, and if you know how fast that signal is moving, then you can figure out the distance between the devices.1 And once we have distances, we're in business.
Imagine that your phone is in currently in contact with one cell tower (let's call it Tower A), and that tower measures your distance at 4 miles. Tower A has no idea as to your direction, only that you're someplace 4 miles away. And "someplace 4 miles away from Tower A" is just another way to say that your phone must lie on a circle, centered at Tower A, with radius 4 miles. Now that's not particularly great, but it's an awful lot better than "somewhere in the world."
If you happen to be in a place with decent cell coverage, then your phone is not in an exclusive relationship with Tower A. In fact, several towers might have to negotiate which one is going to handle your calls, so they're also signal-swapping with you. That means more signals, more times, and more distances. Let's say that another cell tower, Tower B, measures your distance at 3 miles. That distance also defines a circle, but this time we get a lot more information, because your phone has to be on both circles simultaneously, which means, in general, your phone can be in one of only two locations.2 Not bad, but those two locations might still be pretty far apart, depending on the range of the towers. Might we do better?
Three circles intersecting at a unique point.
Of course. If, say, Tower C measures your distance at 5 miles, now we know that your phone is somewhere those three circles (again, all at the same time), and that can only happen in one place. So now we don't need any more circles; you have been located. This process of locating a point based on its distance from three fixed points is known as trilateration...so...you have been trilaterated.3,4
One thing that we haven't talked about yet is the fact that all this locating requires you to be within range of at least three cell towers. In an urban area, this isn't much of a problem; there are towers all over the place. But in more rural areas, where coverage is sparser, your calculated location will be far less accurate. One of the reasons is that there's an important tradeoff between coverage and locatability: having locations covered by multiple, redundant towers is expensive, especially if there aren't a lot of people in a particular area, and every time you add redundant coverage, you're not adding new coverage.
Adding more coverage (blue).
Adding more locatability (blue).
Something to think about next time you check in on Foursquare. People still do that, right?
Teachers: want to have this conversation in class? Check out the lesson materials on our website!
1. 2G phones using the GSM protocol measure distance with signal strength rather than time. Same idea, though.
2. There's a special case where two towers will give you enough information to locate your phone at a single, unique point. Can you think of it?
3. In practice, cell towers can't measure your distance with perfect precision, so they can really only narrow your location down to a small area rather than an actual point, but it's good enough for most location-based services. For increased accuracy, systems may use more than three towers, which is technically known as multilateration.
4. GPS works on the same principle, but with a few complications. For one thing, we've only been dealing with locations in 2D space; to get an accurate 3D location, you need a fourth satellite (why?). Also, satellites move fast enough for relativistic time effects to become an issue. How awesome is that?