/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/mat4f64","../../../../chunks/vec3f64","../../../../geometry/projection","../../../../geometry/projectionEllipsoid"],(function(t,o,e,n,a){"use strict";function r(t,e,a,r){const i=s(t,e,a),c=o.create();return n.computeTranslationToOriginAndRotation(a,i,c,r),c}const i=1,c=5-i;function s(t,o,n){const r=e.create(),s=t[3],u=2**(Math.ceil(Math.log(s)*Math.LOG2E/c)*c+i);if(n.isGeographic){const o=u/a.getReferenceEllipsoid(n).radius*180/Math.PI,e=Math.round(t[1]/o),i=Math.max(-90,Math.min(90,e*o)),c=o/Math.cos((Math.abs(i)-o/2)/180*Math.PI),s=Math.round(t[0]/c)*c;r[0]=s,r[1]=i}else{const o=Math.round(t[0]/u),e=Math.round(t[1]/u);r[0]=o*u,r[1]=e*u}const h=t[2]+o,l=Math.round(h/u);return r[2]=l*u,r}t.computeGlobalTransformation=r,t.getLocalOrigin=s,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
