Don't find anything like that in the wiki. So I take it this doesn't exist yet?

Moderators: winston, another_commander
If a javascript has access to the galactic coordinates , e.g. (20,173) for Lave, then distances could be calculated independently, sqrt(Delta_x^2 + Delta_y^2)*4/10 where the Delta_y has to use the difference in y coordinates divided by 2 and rounded towards zero. Rounding errors can be a pain, see# 7. Lave (20,173), {39,46,55,129,147,255} within 7.0 LY.
Code: Select all
OOINLINE double distanceBetweenPlanetPositions ( int x1, int y1, int x2, int y2)
{
int dx = x1 - x2;
int dy = (y1 - y2)/2;
int dist = sqrtf(dx*dx + dy*dy); // here's where the rounding errors come in!
return 0.4 * dist;
}