Currently you can't get the destination coordinates in Lua scripts. There is no API call for it. It's one of the most requested features. I suggest you send a ticket to support about it.
Assuming we get it one day, then calculations are straight-forward. Everything in DU are in 3d world coordinates and the unit is meter. If you subtract your ship's world position from target, the result is vector pointing from ship to target and its length is the distance in meters.
Go into your game directory, game\data\lua and look around. There is e.g. cpml\vec3.lua for 3d vector calculations and very useful.
local target = vec3(1,2,3)
local ship = vec3(4,5,6)
local toTarget = target - ship
local distance = toTarget:len()
Your velocity is also a vector. If you are flying towards the target, then its length is your speed in m/s. If not, you need some math but vec3 has e.g. projections to do it.
There are actually two coordinate systems in use when sharing locations: world and planetary coordinates. World coordinates are the basis. Planetary coordinates are local polar lat/lon coordinates. Each planet is actually a huge sphere construct placed in fixed position in world coordinates. World z axis is their North pole and x is Greenwich line.
If you browse DU Discord's Lua channel, you should quite soon find sources to convert planetary lat/lon coordinates to world coordinates.