I may have derived this from the travellermap API document or come up with it myself, I don't remember now, but it works.I have a mathematica method toMap[] which will take a vector of the x and y hex number and return a map-space value:toMap[vec_] := Module[{ix, iy, x, y},
ix = vec[[1]] - 0.5;
iy = If[ EvenQ[ vec[[1]] ], vec[[2]] - 0.5, vec[[2]] ];
x = ix Cos[\[Pi] 6^-1];
y = -iy;
{x, y}
];then just take the regular euclidean distance between them, e.g.,In[972]:= EuclideanDistance[ toMap[{01,01}], toMap[{08,10}] ]
Out[972]= 10.4403Asking mathematica for a general solution gives:In[973]:= EuclideanDistance[ toMap[{ax,ay}], toMap[{bx,by}] ]
Out[973]= Sqrt[Abs[1/2 Sqrt[3] (-0.5+ax)-1/2 Sqrt[3] (-0.5+bx)]^2+Abs[-ay+by]^2]where ax, ay are the hex coordinates of the first hex and bx, by are the coordinates of the secondOn Fri, Mar 27, 2020 at 3:33 PM Jeff Zeitlin <xxxxxx@freelancetraveller.com> wrote:Given a standard Traveller subsector, with coordinates 0101 to 0810,
alternate columns staggered, what's the formula/algorithm to calculate the
jump distance between two hexes?
®Traveller is a registered trademark of
Far Future Enterprises, 1977-2020. Use of
the trademark in this notice and in the
referenced materials is not intended to
infringe or devalue the trademark.
--
Jeff Zeitlin, Editor
Freelance Traveller
The Electronic Fan-Supported Traveller® Resource
xxxxxx@freelancetraveller.com
http://www.freelancetraveller.com
Freelance Traveller extends its thanks to the following
enterprises for hosting services:
onCloud/CyberWeb Enterprises (http://www.oncloud.io)
The Traveller Downport (http://www.downport.com)
-----
The Traveller Mailing List
Archives at http://archives.simplelists.com/tml
Report problems to xxxxxx@simplelists.com
To unsubscribe from this list please go to
http://www.simplelists.com/confirm.php?u=wkJZDVdDoS21PvuTrsXSMsmho7pwDsoN