import { isPoint } from "./is-point.js";
import { isPoint3D } from "./is-point-3d.js";
import { isNum } from "./inc.js";
const distance1D = (a, b) => Math.abs(a - b);
function distance(a, b) {
  if (isNum(a) && isNum(b)) {
    return distance1D(a, b);
  } else if (isPoint(a) && isPoint(b)) {
    const xDelta = distance1D(a.x, b.x);
    const yDelta = distance1D(a.y, b.y);
    const zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0;
    return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2));
  }
}
export {
  distance
};
//# sourceMappingURL=distance.js.map
