/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/vec2f64","../../../../chunks/vec4","../../../../chunks/vec4f64"],(function(t,n,r,e){"use strict";const o=e.create();let a=function(){function t(t){this.message=t}return t.prototype.toString=function(){return`AssertException: ${this.message}`},t}();function s(t,n){if(!t)throw n=n||"assert",console.log(new Error(n).stack),new a(n)}function i(t,n){t||(n=n||"",console.warn("Verify failed: "+n+"\n"+new Error("verify").stack))}function f(t,n,r,e){let o,a=(r[0]-t[0])/n[0],s=(e[0]-t[0])/n[0];a>s&&(o=a,a=s,s=o);let i=(r[1]-t[1])/n[1],f=(e[1]-t[1])/n[1];if(i>f&&(o=i,i=f,f=o),a>f||i>s)return!1;i>a&&(a=i),f<s&&(s=f);let u=(r[2]-t[2])/n[2],c=(e[2]-t[2])/n[2];return u>c&&(o=u,u=c,c=o),!(a>c||u>s)&&(c<s&&(s=c),!(s<0))}function u(t,r,e,o,a,s=n.create()){const i=(o[a]-e[a])*(r[0]-t[0])-(o[0]-e[0])*(r[a]-t[a]),f=(o[0]-e[0])*(t[a]-e[a])-(o[a]-e[a])*(t[0]-e[0]);if(0===i)return!1;const u=f/i;return s[0]=t[0]+u*(r[0]-t[0]),s[1]=t[a]+u*(r[a]-t[a]),!0}function c(t,n,e,a,i){i||(i=t),o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=1,r.transformMat4(o,o,n),i.length>2&&(i[2]=-o[2]),r.transformMat4(o,o,e),s(0!==o[3]),i[0]=o[0]/o[3],i[1]=o[1]/o[3],i[2]=o[2]/o[3],i[0]=(.5*i[0]+.5)*a[2]+a[0],i[1]=(.5*i[1]+.5)*a[3]+a[1]}function h(t,n){return Math.log(t)/Math.log(n)}function M(t,n,r,e){t[12]=n,t[13]=r,t[14]=e}function l(t){return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&1===t[15]}function v(t,n,r){return 2*Math.atan(Math.sqrt(n*n+r*r)*Math.tan(.5*t)/n)}function g(t,n,r){return 2*Math.atan(Math.sqrt(n*n+r*r)*Math.tan(.5*t)/r)}function y(t,n,r){return 2*Math.atan(n*Math.tan(.5*t)/Math.sqrt(n*n+r*r))}function d(t,n,r){return 2*Math.atan(r*Math.tan(.5*t)/Math.sqrt(n*n+r*r))}t.assert=s,t.fovd2fovx=y,t.fovd2fovy=d,t.fovx2fovd=v,t.fovy2fovd=g,t.isTranslationMatrix=l,t.logWithBase=h,t.project=c,t.rayBoxTest=f,t.rayRay2D=u,t.setMatrixTranslation3=M,t.verify=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
