## What is Manhattan Distance

Manhattan distance, also known as taxicab distance or L1 distance, is a term that describes the shortest path that a wire can take when it is restricted to being routed orthogonally, or in the X and Y axis only. It is named after the grid-like street layout of Manhattan, where only horizontal and vertical movements are allowed.

In the context of the PCB industry, the Manhattan distance is particularly relevant when measuring the distance between two points that are not aligned in the same axis. While the direct measurement of a diagonal path would be the shortest distance between the two points, wires in PCB design are typically routed along the grid pattern of the PCB, limiting their movement to the X and Y axis. As a result, the orthogonal path, following the grid pattern, will be longer than the direct diagonal path.

To calculate the Manhattan distance between two points, the absolute differences between the X coordinates and the absolute differences between the Y coordinates are added together. This provides a measure of the total distance traveled along the X and Y axis, representing the Manhattan distance between the two points.