/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{length as r}from"../../core/libs/gl-matrix-2/math/vec3.js";import{getProjectorClassification as t,invPlateCarreeScale as e}from"./projectors.js";import{earth as s}from"../support/Ellipsoid.js";import{equals as i}from"../support/spatialReferenceUtils.js";function o(o,n,f,c){const p=t(n,c);if(null==p)return!1;const u=p.source.spatialReferenceId,a=p.dest.spatialReferenceId;if(u===a&&0!==u||i(n,c))return f[0]=1,f[1]=1,f[2]=1,!0;if(1===u){const t=r(o),i=t/Math.sqrt(o[0]*o[0]+o[1]*o[1]),n=t/s.radius;if(3===a)return f[0]=i*n,f[1]=i*n,f[2]=1,!0;if(2===a||5===a){const r=e;return f[0]=r*i*n,f[1]=r*n,f[2]=1,!0}}else if(11===u){if(2===a||5===a)return f[0]=e,f[1]=e,f[2]=1,!0;if(3===a){const r=o[1]/s.radius;return f[0]=1,f[1]=1/Math.cos(r),f[2]=1,!0}}return!1}export{o as localLinearScaleFactors};
