/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@yandex/ymaps3-cartesian-projection@0.0.6/dist/esm/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
function cycleRestrict(t,s,e){return t-Math.floor((t-s)/(e-s))*(e-s)}export class Cartesian{constructor(t,s=[!1,!1]){this.type="cartesian",this._bounds=t,this._cycled=s,this._xRange=t[1][0]-t[0][0],this._yRange=t[1][1]-t[0][1],this._worldSize=2}toWorldCoordinates(t){const s=this._bounds,e=t[0],i=t[1];return{x:(e-s[0][0])/this._xRange*this._worldSize-1,y:(i-s[0][1])/this._yRange*this._worldSize-1}}fromWorldCoordinates(t){const s=this._bounds,e=[(t.x+1)/this._worldSize*this._xRange+s[0][0],(t.y+1)/this._worldSize*this._yRange+s[0][1]];return[this._cycled[0]?cycleRestrict(e[0],s[0][0],s[1][0]):e[0],this._cycled[1]?cycleRestrict(e[1],s[0][1],s[1][1]):e[1]]}}export*from"./types";
//# sourceMappingURL=/sm/bcc0e51c3d6a5f7e1bda440f2b38b5a16709c7f288ffeb6ad8e80076a7171f9e.map