Crazy Horse
Newbie
- Joined
- Jul 14, 2006
- Messages
- 184
- Reaction score
- 0
What we have here is a graph that wraps around (like the map in the game Pacman).The point (90,80) is 20 units away from both (90,100) and (90,0), as well as from (90,60)... etc.
I am writing an algorithm that requires a single mathematical equation (for each dimension) to find the shortest distance between any two points (Ax,Ay), (Bx,By) on the graph. The distance can be split up into the 2 dimensions. You can use absolute value, modulus, *, /, -, +.
I gave up after about 15-20 minutes, but my brother managed to solve it for me. It's a neat problem, and I would like to see if anyone else is bored enough to give it a shot. I'm not exactly sure how hard it is (my brother said it was "easy" but it took him a bit longer than usual to solve it).
edit:
The domain is (0,0) to (100,100)

I am writing an algorithm that requires a single mathematical equation (for each dimension) to find the shortest distance between any two points (Ax,Ay), (Bx,By) on the graph. The distance can be split up into the 2 dimensions. You can use absolute value, modulus, *, /, -, +.
I gave up after about 15-20 minutes, but my brother managed to solve it for me. It's a neat problem, and I would like to see if anyone else is bored enough to give it a shot. I'm not exactly sure how hard it is (my brother said it was "easy" but it took him a bit longer than usual to solve it).
edit:
The domain is (0,0) to (100,100)