N is north , S south, E east, W west.
A country might have 4 kinds of coordinates : {N,E},{N,W},{S,E},{S,W}
There are some questions around this :
1. I can find distance between 2 points in x,y axis... but I couldn't calculate for different like {N,E} and {N,W}.
2. Convert from one kind to another ?
3. Find the best route : shortest length ?
Please help, thanks in advance.
Last edited on
Last edited on
@ne555,
You're right, I'm way overthinking this - OP doesn't need to use a path-finding algorithm.
To get the magnitude of a straight line AB you just need to calculate |AB|= sqrt((x2 - x1)2 + (y2 - y1)2. where "sqrt" is the square root.
(These forums could benefit from having jsMath).
Last edited on