Thanks for this, what you could do for calculating the distances would be to stick the planet data into a table and then use a for k,v in pairs.
function getPlanetData()
local planets = {}
planets[1] = { ["name"] = "Alioth", x = -4.000, y = -4.000, z = -60534.000, grav = 9.891}
planets[2] = { ["name"] = "Ion", x = 2865536.000, y = -99034464.000, z = -934464.000, grav = 3.5325}
planets[3] = { ["name"] = "Symeon", x = 14165536.000, y = -85634464.000, z = -934464.000, grav = 3.8465}
planets[4] = { ["name"] = "Talemai", x = -13234464.000, y = 55765536.000, z = 465536.000, grav = 4.553}
planets[5] = { ["name"] = "Teoma", x = 80865536.000, y = 54665536.000, z = -934464.000, grav = 4.7885}
planets[6] = { ["name"] = "Lacobus", x = 98865536.000, y = -13534464.000, z = -934464.000, grav = 4.4745}
planets[7] = { ["name"] = "Feli", x = -43534464.000, y = 22565536.000, z = -48934464.000, grav = 4.71}
planets[8] = { ["name"] = "Thades", x = 29165536.000, y = 10865536.000, z = 65536.000, grav = 4.867}
planets[9] = { ["name"] = "Madis", x = 17465536.000, y = 22665536.000, z = -34464.000, grav = 3.5325}
planets[10] = { ["name"] = "Jago", x = -94134464.000, y = 12765536.000, z = -3634464.000, grav = 4.9455}
planets[11] = { ["name"] = "Sicari", x = 52765536.000, y = 27165536.000, z = 52065536.000, grav = 4.0035}
planets[12] = { ["name"] = "Sinnen", x = 58665536.000, y = 29665536.000, z = 58165536.000, grav = 4.3175}
return planets
end
pos = core.getConstructWorldPos()
planet = getPlanetData()
for k,v in pairs(planet) do
dist = string.format("%.2f", math.sqrt((planet[k].x - pos[1])^2+(planet[k].y - pos[2])^2+(planet[k].z - pos[3])^2)/200000)
mapdata = mapdata .. [[
<tr><td>]]..planet[k].name..[[</td><td>]]..dist..[[</td></tr>
]]
end