/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../core/mathUtils","./mat4","./mat4f64","./vec3","./vec3f64","../geometry/Extent","../geometry/projection","../views/3d/support/cameraUtilsInternal"],(function(e,t,o,r,i,n,a,c,l){"use strict";const T=n.fromValues(0,1,0),d=n.fromValues(0,0,1),u=r.create(),s=n.create(),f=n.create();function p(e,r,n,a=l.createDirectionUp()){const{direction:c,up:s}=a;return o.fromZRotation(u,-t.deg2rad(r)),o.rotateX(u,u,t.deg2rad(n)),i.transformMat4(c,d,u),i.scale(c,c,-1),i.transformMat4(s,T,u),a}function m(e,t,o,r){return l.directionToHeadingTilt(t,o,r,d,T)}function g(e,t,o,r){const a=p(e,o,r),c=n.create();return i.scale(c,a.direction,-t),i.add(c,c,e),{up:a.up,eye:c,heading:o,tilt:r}}function y(e){return t.rad2deg(e)}function x(e){return t.deg2rad(e)}function V(e,t,o,r,i){const n=e.renderSpatialReference,l=e.map&&e.spatialReference||t.spatialReference;return c.projectPointToVector(t,s,n),c.projectPointToVector(t,f,n),s[0]-=o/2,f[0]+=o/2,s[1]-=r/2,f[1]+=r/2,c.projectVectorToVector(s,n,s,l),c.projectVectorToVector(f,n,f,l),i?(i.xmin=s[0],i.ymin=s[1],i.xmax=f[0],i.ymax=f[1],i.spatialReference=l):i=new a(s[0],s[1],f[0],f[1],l),i}const j=Object.freeze(Object.defineProperty({__proto__:null,headingTiltToDirectionUp:p,directionToHeadingTilt:m,eyeForCenterWithHeadingTilt:g,lookAtTiltToEyeTilt:y,eyeTiltToLookAtTilt:x,toExtent:V},Symbol.toStringTag,{value:"Module"}));e.cameraUtilsPlanar=j,e.directionToHeadingTilt=m,e.eyeForCenterWithHeadingTilt=g,e.eyeTiltToLookAtTilt=x,e.headingTiltToDirectionUp=p,e.lookAtTiltToEyeTilt=y,e.toExtent=V}));
