/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{asinClamped as t}from"../../core/mathUtils.js";import{length as o,set as a}from"../../core/libs/gl-matrix-2/math/vec3.js";function n(n,r){const s=o(n),c=t(n[2]/s),i=Math.atan2(n[1]/s,n[0]/s);return a(r,s,c,i),r}function r(t,o){const n=t[0],r=t[1],s=t[2],c=Math.cos(r);a(o,n*c*Math.cos(s),n*c*Math.sin(s),n*Math.sin(r))}export{n as cartesianToSpherical,r as sphericalToCartesian};
