That computes the so-called "taxicab distance" You take the largest of the vertical and horizontal distances.
Confusion
Isn't "taxicab distance" what I call Manhattan- or Taxi-distance, the shortest number of orthogonal king moves, thus the sum of abs rank- and file-distance?
Max of abs rank- and file-distance is simply called Distance or King-Distance also incorporating diagonal king moves. Right?
That computes the so-called "taxicab distance" You take the largest of the vertical and horizontal distances.
Confusion
Isn't "taxicab distance" what I call Manhattan- or Taxi-distance, the shortest number of orthogonal king moves, thus the sum of abs rank- and file-distance?
Max of abs rank- and file-distance is simply called Distance or King-Distance also incorporating diagonal king moves. Right?
That computes the so-called "taxicab distance" You take the largest of the vertical and horizontal distances.
Confusion
Isn't "taxicab distance" what I call Manhattan- or Taxi-distance, the shortest number of orthogonal king moves, thus the sum of abs rank- and file-distance?
Max of abs rank- and file-distance is simply called Distance or King-Distance also incorporating diagonal king moves. Right?
You are right. Don't know what I was thinking. It is a special case since the king can close in two directions at once.
That computes the so-called "taxicab distance" You take the largest of the vertical and horizontal distances.
Confusion
Isn't "taxicab distance" what I call Manhattan- or Taxi-distance, the shortest number of orthogonal king moves, thus the sum of abs rank- and file-distance?
Max of abs rank- and file-distance is simply called Distance or King-Distance also incorporating diagonal king moves. Right?
You are right. Don't know what I was thinking. It is a special case since the king can close in two directions at once.
I was also off in la-la land when I posted my king distance function .
Ah well, we gave a good summary of the different king distance methods.
Just FYI, it's sometimes referred to as "tropism" or "king tropism". That might help any searches you may want to do.
There's no official distance value, and some may apply a different distance function based on the piece type... I think I've seen engines that take min(verticalDistance, horizontalDistance) for tropism with rooks, etc.
This last comment has potential to create about the same confusion as before in this thread
1) The winner is indeed "chebyshev distance" (Max(rankDist, fileDist)).
2) Name and implementation of the function "manhattanDistance()" given above are correct since the function calculates the "manhattan distance" or "taxicab distance" (rankDist+fileDist), but this is not the distance that was requested.