When designing a hex map coordinate system for software, I had a few design criteria in mind.

1) Had to handle any point in space regardless of direction and distance from the origin point.

2) Easy to determine Horizontal direction and distance between two point. 

3) Easy to program.

The system that I like the most is the ABC system. It measures the distance from the origin point by counting the hexes in the A, B, and C directions.  For the directions opposite of A, B, and C, negative numbers are used.

The coordinate is written as (A,B,C). 

Here is the map from Coordinates on a Hex map, Part 1 with the hexagons labeled in the ABC system


An important concept in ABC is that a coordinate has to be valid. A valid coordinate follows the follow rules:

1) One of the numbers must be zero.

2) Numbers that are adjacent must be the same sign or zero

3) A and C have to have opposite signs or zero

If a coordinate isn't valid, perform the following transformations in any order until a valid coordinate is reached.

1) Add A to B. Subtract A from A and C.

2) Add C to B. Subtract C from A and C.

3) Add B to A and C. Subtract B from B.

In case you are wondering, this is pretty similar to the 120 vector consolidation in Attack Vector: Tactical and Squadron Strike

The downside to this system is that it is not quick or intuative for humans.  We don't handle negative numbers well and we have an inclination to put things in magnatude order (Large to Small).  This is why Pocket Avid converts to the AF system for human interaction while keeping the internal calculations in the ABC system.  It is fairly trivial to convert between the two systems as -A = F, -B = E, and -C = F.

The advantage to the ABC system is that it makes the math (and programming) much, much easier

To find the direction and distance between two objects subtract one from the other.

Source -> Target is determined by Target - Source

So from the Red Hex to the Blue Hex

(3,0,-10) - (0,2,5) = (3,-2,-15) = (1,0,-17) [Applying transformation #3 to get a valid coordinate]

Distance is the sum of the absolute values of the vector.

In the Red -> Blue example, the distance is 18.

Direction should be obvious. Mapping to the AF system (1,0,-17) becomes 1A, 17F.  If playing Attack Vector:Tactical or Squadron Strike, this means that the arc is F.

The reciprocal is just multiplying the vector by -1.

So, Blue -> Red is

-1 * (1,0,-17) = (-1,0,17)

Moving is just converting the AF directions to ABC and adding.

So if the Red Hex moves 3A, 5F

3A,5F = (3,0,-5)

(0,2,5) + (3,0,-5) = (3,2,0)

The code for testing a coordinate is as follows:

(A*B*C == 0) and (A*B >=0 ) and (B*C >=0) and (A*C <= 0 )