Ok so i am stuck at this: I need to calculate distance between 2 points...
For example: I have 30x30 square and point1 is at X4,Y5 and point2 is at X30,Y23 now i need to get the shortest distance from point1 to point2. By wich way is the shortest North,East,West,South...
I know i have to do that by "pythagorean theorem" but problem is if point1 is (X4,Y5) and point2 is (X28,Y6) for example... now the shortest way would be to go East and then you come to the right side out and just go one squeare to South. And the shortest distance would be (5)squares.
I dont know exactly to say what i need, but you will probably see on image2 on the link!
Here is an example of 30x30 and here is a full image of what i am talking about
ADDED MORE EXAMPLES:
Here would the shortest be (6).
Here would the shortest be (3).
Here would the shortest be (21).
Here would the shortest be (5, something).
Here would the shortest be (4).

Thank you for any help people! :)
