THE MANHATTAN distance by city blocks — |dx| + |dy|, a different geometry
Not all distance is a straight line. Manhattan (taxicab) distance is |Δx| + |Δy| — how far a taxi drives on a grid of streets, unable to cut diagonally. It is the L1 metric to the Euclidean L2, and it changes the shape of geometry: a “circle” (all points at equal distance) becomes a diamond, not a ring. It is faster to compute (adds, not squares and roots), and it is the right metric for grid worlds — chip routing, warehouse robots, chessboard rooks, A* on a lattice. From (1,2) to (4,6): taxicab 7, straight-line 5.
THE TECHNIQUE |Δx| + |Δy| — the L1 metric; its circle is a diamond
The demo compares Manhattan and Euclidean distance from (1,2) to (4,6): taxicab 7, straight-line 5: live demo
HISTORY & CREDIT taxicab / L1 metric · Minkowski
“Distance is the straight line.” — on a grid it is the sum of the sides; the shortest path is a staircase, and there are many. cited
the metric · |Δx| + |Δy| — the L1 distance; add, no square root. the shape · its unit circle is a diamond; many shortest paths, not one. the uses · grid worlds — chip routing, warehouse robots, A* on a lattice, the rook’s move.
Distance measured in city blocks — a different metric, a diamond for a circle, a staircase for a line. metric
RECOMMEND FOR I-13 taxicab vs straight-line, on the compiler
On the canonical compiler, from (1,2) to (4,6) the Manhattan distance is 7 and the Euclidean is 5 (3-4-5):
Recommend as the batch’s close — a NULL, a different geometry. Manhattan distance is a metric — a computed value under a different norm (B39/B44); cheaper than Euclidean (adds, not roots: a resource note, B40), and it reshapes geometry (circle → diamond). No new axis. NULL — and a fitting end: geometry is not one thing, and the compass points many ways.