/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{copy as t}from"../../core/libs/gl-matrix-2/math/mat4.js";import{set as e,copy as n,normalize as o,cross as r,dot as i}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as a}from"../ellipsoidUtils.js";import s from"../SpatialReference.js";import{getSphericalPCPF as c}from"../spatialReferenceEllipsoidUtils.js";import{f as l,b as f}from"../../chunks/boundedPlane.js";import{Sphere as p,sphereCSO as m}from"./sphere.js";function v(t){const{value:e,operations:n}=t;return{operations:n,value:n.create(e)}}function d(t,e,n){return t.operations.setExtent(t.value,e,n.value),n}function h(t,e){return t.operations.getExtent(t.value,e),e}function j(t){return{operations:t,value:t.create()}}function x(t,e,n=j(t)){return n.operations=t,t.copy(e,n.value),n}function b(t){return x(m,new p(0,0,0,a(t).radius))}const g=2**50;function A(){return x(f,l([0,0,0],[g,0,0],[0,g,0]))}function y(t,e,n){return t.operations.axisAt(t.value,e,2,n)}function P(t,e,n,o){return t.operations.axisAt(t.value,e,n,o)}function R(t,e,n){return t.operations.intersectRay(t.value,e,n)}function S(t,e,n){return t.operations.closestPoint(t.value,e,n)}function E(t,e,n){return t.operations.intersectRayClosestSilhouette(t.value,e,n)}function C(t,e,n){return t.operations.closestPointOnSilhouette(t.value,e,n)}function U(t,e){return t.operations.distanceToSilhouette(t.value,e)}function k(t,e){return t.operations.altitudeAt(t.value,e)}function w(t,e,n,o){return t.operations.setAltitudeAt(t.value,e,n,o)}function G(n,o,r,i){return o!==i&&t(i,o),e(T,i[12],i[13],i[14]),w(n,T,r,T),i[12]=T[0],i[13]=T[1],i[14]=T[2],i}function O(t,e,n){return t.operations.elevate(t.value,e,n.value)}const T=u();function q(t,e,n,o,r){return r[0]=i(t,e),r[1]=i(t,n),r[2]=i(t,o),r}function z(t,e,i,u,a){n(i,t),n(D,e),o(D,D),r(u,D,i),r(a,u,i)}function B(t,e){return t?c(e):e.isGeographic?s.PlateCarree:e}const D=u();export{k as altitudeAt,P as axisAt,S as closestPoint,C as closestPointOnSilhouette,z as coordinateSystemFromOneAxisAndNormalVector,v as create,j as createFromOperations,b as createGlobal,A as createLocal,U as distanceToSilhouette,O as elevate,x as fromValues,h as getExtent,R as intersectRay,E as intersectRayClosestSilhouette,y as normalAt,B as renderSRFromViewSR,w as setAltitudeAt,G as setAltitudeOfTransformation,d as setExtent,q as vectorCoordinates};
