"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../utils/mix/number.mjs.js");const n=.9999,t=1.0001,e=-.01,a=.01;function o(i){return i.max-i.min}function r(r,s,x){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;r.origin=c,r.originPoint=i.mixNumber(s.min,s.max,r.origin),r.scale=o(x)/o(s),r.translate=i.mixNumber(x.min,x.max,r.origin)-r.originPoint,(r.scale>=n&&r.scale<=t||isNaN(r.scale))&&(r.scale=1),(r.translate>=e&&r.translate<=a||isNaN(r.translate))&&(r.translate=0)}function s(n,t,e){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=a?i.mixNumber(e.min,e.max,a):e.min;n.min=r+t.min,n.max=n.min+o(t)}function x(n,t,e){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=a?i.mixNumber(e.min,e.max,a):e.min;n.min=t.min-r,n.max=n.min+o(t)}exports.calcAxisDelta=r,exports.calcBoxDelta=function(i,n,t,e){r(i.x,n.x,t.x,e?e.originX:void 0),r(i.y,n.y,t.y,e?e.originY:void 0)},exports.calcLength=o,exports.calcRelativeAxis=s,exports.calcRelativeAxisPosition=x,exports.calcRelativeBox=function(i,n,t,e){s(i.x,n.x,t.x,e?.x),s(i.y,n.y,t.y,e?.y)},exports.calcRelativePosition=function(i,n,t,e){x(i.x,n.x,t.x,e?.x),x(i.y,n.y,t.y,e?.y)},exports.isNear=function(i,n,t){return Math.abs(i-n)<=t};
//# sourceMappingURL=delta-calc.mjs.js.map
