The physics

How your phone knows where it is

Deep enough for an engineer, clear enough for a teenager. Ten short pieces, each with a simple version and, if you want it, the technical one.

01 Direction

Direction and position are two different things

Direction is which way you face: north, east, 40 degrees. Position is where you are: a point on the Earth.

  • A compass answers the first question and knows nothing about the second.
  • A satellite receiver answers the second and knows nothing about the first.

Tarrow needs both, and one more: where the place is. Two of those three come from the phone's own sensors. The third travels inside the link.

The technical version

Heading is measured clockwise from north, 0 to 360 degrees. Bearing is the direction from your position to a target, on the same scale. The arrow shows the difference: bearing minus heading. Facing 40° with the place at 75° puts the arrow 35° to your right.

Magnetic north and true north differ by the declination, which depends on where you are. Phones correct for it when they have a position, so the heading a browser reports is true north where the position is known.

N40°HEADING35°THE PLACEYOU

02 Heading

How the phone knows which way it faces

A classic compass is a magnetised needle that lines up with the Earth's magnetic field. The phone has the same thing as a chip: a magnetometer. On its own it is nervous: metal, magnets, a car body, a case with a clasp all pull on it.

So the phone does not trust it alone:

  • the magnetometer senses the field,
  • the gyroscope measures how fast the phone turns,
  • the accelerometer measures gravity and tilt,
  • the operating system fuses the three into one steady heading.

That is the number the arrow turns with.

The technical version

The browser hands over one heading per sensor tick. Tarrow keeps a short window of recent samples and takes their circular mean, weighted by age, so a single bad reading cannot jerk the arrow and crossing north does not spin it the long way round. A reading with a low accuracy figure counts less.

Calibration is the operating system's job: the figure-eight motion gives it a fresh view of the field. Tarrow shows a hint when the heading is unreliable rather than pretending.

MagnetometerGyroscopeAccelerometerSensor fusion→ 40°HEADING

03 Position

How the phone knows where it is

Satellites do not know where your phone is, and the phone does not ask them. Each satellite broadcasts, all the time, its exact position and the exact time. Your phone listens to several at once.

Radio travels at the speed of light, so a signal that left a satellite a tiny fraction of a second earlier has come from further away. From those differences the phone works out

  • its distance to each satellite,
  • and from several distances, its own position.

Nothing is sent. It only listens.

The technical version

The method is trilateration, not triangulation: distances, not angles. Four satellites are enough in principle, because the phone's clock is the fourth unknown. Today's phones listen to more than one constellation at once: GPS, Galileo, GLONASS, BeiDou.

Real phones also use assistance:

  • the network can deliver satellite orbits, so the first fix comes in seconds instead of minutes,
  • known Wi-Fi networks and cell towers give a rough position indoors.

That assistance improves speed and robustness. It is not what computes the position.

LISTENS ONLYNOTHING IS SENT

04 Not the same

GPS is not the internet

Satellite positioning and mobile data are two different systems. One is a radio the phone only listens to. The other is a network the phone talks to. A phone with no signal bars still hears the satellites.

Map apps need the internet for other reasons:

  • map tiles,
  • routes,
  • traffic,
  • search.

Position itself does not. That is why an arrow page keeps working in a field or at a festival where the network has given up.

The technical version

Tarrow's arrow page needs the network once, to load. After that it asks the phone for position and heading through the browser's own interfaces and computes everything on the device. There is no server that receives your position, because there is nothing for it to do with one.

Honest limits:

  • a first satellite fix indoors can take a while without assistance data,
  • looking up an address or a map link needs the network at the moment you do it.

Once the place is a pair of coordinates, it does not.

POSITIONA RADIO, HEARDMAPSROUTESSEARCHA NETWORK, TALKED TO

05 Privacy

Knowing where you are is not telling anyone

Location is the phone determining its own position. Tracking is a system recording that position over time and tying it to you. The first happens inside the device. The second needs someone to send it somewhere.

A phone can know exactly where it is while nobody else does.

Tarrow is built on that line: the arrow is computed on the phone, and your position never leaves it.

POSITION: KNOWNNOBODYSTAYS ON THE PHONE

06 One place

One place, many ways to write it

A point on the Earth has one position and many names for it. Decimal degrees, degrees and minutes, a Plus Code, an address, a map link: these are not different places. They are different spellings of the same one.

Tarrow reads all of them and keeps the one that never changes: the pair of numbers.

The technical version

Latitude runs from −90 at the south pole to +90 at the north pole, longitude from −180 to +180 either side of Greenwich. Five decimals are about one metre.

A Plus Code cuts the Earth into a grid and names a cell with letters, finer with each pair; a ten-character code is a 14 by 14 metre cell, and it works where streets have no names.

Decimal degrees
50.11047, 8.68166
Degrees, minutes, seconds
50°6′37.7″ N, 8°40′54.0″ E
Plus Code
9F2C4M6J+5M
Address
Römerberg 27, 60311 Frankfurt
Tarrow link
tarrow.dev/compass?lat=50.11047&lon=8.68166

07 Accuracy

Why the dot moves

A position is an estimate with a radius around it, not a mathematical point.

  • Open sky: a few metres.
  • Between tall buildings, under trees, indoors: tens of metres, because signals bounce.

The dot on a map wanders for the same reason.

Tarrow shows the distance to the metre but treats the last metres with care. Arrival is called at 20 metres, not at zero, because at zero the estimate is as likely to be behind you as in front.

The technical version

The app has four distance zones:

  • far,
  • near from 100 m,
  • close from 50 m,
  • here from 20 m.

Leaving a zone needs more distance than entering it, 125, 62 and 25 metres, so a position that jitters around a boundary cannot flicker the instrument. The same idea as a thermostat.

OPEN SKY · A FEW METRESBETWEEN BUILDINGS · TENS OF METRES020 m50 m100 mHERE

08 The arrow

Two coordinates become one arrow

Your position, the place's position: from those two pairs the phone computes the straight-line distance and the bearing to the place. Then it takes the heading from the sensors, subtracts it, and rotates the arrow by what is left. Six steps, all on the device, many times a second.

The line is straight. It does not know about roads, rivers, fences or stairs. That is not a shortcoming to be fixed; it is the idea.

Direction is not a route. The arrow shows where the place is; the path is yours.

The technical version

Distance is the great-circle distance on a sphere of radius 6,371 km, the haversine formula. Bearing is the initial bearing from the same two points: atan2 of the east component against the north component. Over a few kilometres a flat approximation would do; the spherical one costs nothing and is right everywhere.

The rotation is bearing minus heading, normalised to −180 to 180 so the arrow always turns the short way. The displayed rotation accumulates past ±180 so a transition never spins the long way when you cross north.

Your positionThe placeBearing + distanceHEADING−THE ARROW

09 Feeling it

Direction you can feel

In the app the phone can hand the direction to your hand. Turn on the spot:

  • while the place is off to the side, the phone is quiet,
  • within 20 degrees of it, slow pulses,
  • within 8 degrees, fast, strong pulses.

You stop turning where it locks, and you walk with your eyes on the world. It is the metal-detector feeling, applied to a direction.

The screen is still there. You just need it less.

10 All of it

In one drawing

  • Satellites give the phone its position.
  • Three sensors give it its heading.
  • The link gives it the place.

Inside the phone those three become a bearing and a distance, the bearing and the heading become an arrow, and the arrow can become a pulse in your hand. The network appears only where you look something up.

SatellitesSensorsThe linkINSIDE THE PHONEPOSITIONHEADINGTargetBearing + distanceTHE ARROWThe pulseNETWORKLOOK-UPS ONLY

In the end

Three questions

Where am I?Which way am I facing?Where is the place I want to reach?

That way. This far.

A few satellites, a few sensors, two coordinates, and one arrow pointing where you actually want to go.

Send someone a place

Free, in the browser. The vibration and the saved places are in the app.

Where am I?Which way am I facing?Where is the place?That way. This far.