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))
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))
Posted by Matt Maxwell at 9:40 PM
No comments:
Post a Comment