/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{copy as t}from"../../core/libs/gl-matrix-2/math/mat4.js";import{h as e,d as n,n as o,f as r,g as i}from"../../chunks/vec32.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 v}from"./sphere.js";function m(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 g(t){return x(v,new p(0,0,0,a(t).radius))}const A=2**50;function b(){return x(f,l([0,0,0],[A,0,0],[0,A,0]))}function P(t,e,n){return t.operations.axisAt(t.value,e,2,n)}function R(t,e,n,o){return t.operations.axisAt(t.value,e,n,o)}function S(t,e,n){return t.operations.intersectRay(t.value,e,n)}function y(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 k(t,e,n){return t.operations.closestPointOnSilhouette(t.value,e,n)}function C(t,e){return t.operations.distanceToSilhouette(t.value,e)}function U(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{U as altitudeAt,R as axisAt,y as closestPoint,k as closestPointOnSilhouette,z as coordinateSystemFromOneAxisAndNormalVector,m as create,j as createFromOperations,g as createGlobal,b as createLocal,C as distanceToSilhouette,O as elevate,x as fromValues,h as getExtent,S as intersectRay,E as intersectRayClosestSilhouette,P as normalAt,B as renderSRFromViewSR,w as setAltitudeAt,G as setAltitudeOfTransformation,d as setExtent,q as vectorCoordinates};
