"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const isPoint = require("./is-point.js");
const isPoint3d = require("./is-point-3d.js");
const inc = require("./inc.js");
const distance1D = (a, b) => Math.abs(a - b);
function distance(a, b) {
  if (inc.isNum(a) && inc.isNum(b)) {
    return distance1D(a, b);
  } else if (isPoint.isPoint(a) && isPoint.isPoint(b)) {
    const xDelta = distance1D(a.x, b.x);
    const yDelta = distance1D(a.y, b.y);
    const zDelta = isPoint3d.isPoint3D(a) && isPoint3d.isPoint3D(b) ? distance1D(a.z, b.z) : 0;
    return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2));
  }
}
exports.distance = distance;
//# sourceMappingURL=distance.js.map
