Thanks.
Example with 2 Systems:
G. Caeli',80.90625,-83.53125,-30.8125,
Geminorum',19.78125,3.5625,-153.8125,
D=162.636
What unity is that result? LY?
If you want to get the exact result that ED shows you need to use single precision floating point for the calculation. In Javascript you can do that by using fround:
Code:
// p1 and p2 are objects with x, y, and z properties
function eddist(p1, p2) {
var x=p1.x-p2.x;
var y=p1.y-p2.y;
var z=p1.z-p2.z;
var d = Math.fround(Math.sqrt(Math.fround(Math.fround(x*x) + Math.fround(y*y) + Math.fround(z*z))));
return round(d,2);
}