Formula For Shortest Distance