Sunday, February 18, 2007

Distance Between Two Points (3d)

GEN_get3DDistance = function (ax, ay, az, bx, by, bz) {
dx = ax-bx;
dy = ay-by;
dz = az-bz;
theDistance = Math.sqrt(dx*dx+dy*dy+dz*dz);
return theDistance;
};
trace(GEN_get3DDistance(5,0,0,10,0,0))

No comments: