Skip to content

ManhattanDistance

ManhattanDistance(u, v)

returns the Manhattan distance between u and v, which is the number of horizontal or vertical moves in the grid like Manhattan city layout to get from u to v.

See:

Examples

>> ManhattanDistance({-1, -1}, {1, 1})
4

FindClusters, BinaryDistance, BrayCurtisDistance, ChessboardDistance, CanberraDistance, CosineDistance, EuclideanDistance, SquaredEuclideanDistance

Implementation status

  • ✅ - full supported

Github