When given 4 coordinates, finds shortest logical distance