Agriculture-front-end/public/Cesium/Workers/IntersectionTests-0c6d0a14.js

2 lines
13 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["exports","./Cartographic-3309dd0d","./when-b60132fc","./Check-7b2a090c","./BoundingSphere-561b54d0","./Math-119be1a3"],(function(a,t,e,r,n,i){"use strict";var s={};function o(a,t,e){var r=a+t;return i.CesiumMath.sign(a)!==i.CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(a),Math.abs(t)))<e?0:r}s.computeDiscriminant=function(a,t,e){return t*t-4*a*e},s.computeRealRoots=function(a,t,e){var r;if(0===a)return 0===t?[]:[-e/t];if(0===t){if(0===e)return[0,0];var n=Math.abs(e),s=Math.abs(a);if(n<s&&n/s<i.CesiumMath.EPSILON14)return[0,0];if(n>s&&s/n<i.CesiumMath.EPSILON14)return[];if((r=-e/a)<0)return[];var u=Math.sqrt(r);return[-u,u]}if(0===e)return(r=-t/a)<0?[r,0]:[0,r];var C=o(t*t,-(4*a*e),i.CesiumMath.EPSILON14);if(C<0)return[];var c=-.5*o(t,i.CesiumMath.sign(t)*Math.sqrt(C),i.CesiumMath.EPSILON14);return t>0?[c/a,e/c]:[e/c,c/a]};var u={};function C(a,t,e,r){var n,i,s=a,o=t/3,u=e/3,C=r,c=s*u,l=o*C,h=o*o,M=u*u,f=s*u-h,m=s*C-o*u,d=o*C-M,g=4*f*d-m*m;if(g<0){var v,p,w;h*l>=c*M?(v=s,p=f,w=-2*o*f+s*m):(v=C,p=d,w=-C*m+2*u*d);var R=-(w<0?-1:1)*Math.abs(v)*Math.sqrt(-g),S=(i=-w+R)/2,O=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),x=i===R?-O:-p/O;return n=p<=0?O+x:-w/(O*O+x*x+p),h*l>=c*M?[(n-o)/s]:[-C/(n+u)]}var y=f,P=-2*o*f+s*m,b=d,N=-C*m+2*u*d,q=Math.sqrt(g),L=Math.sqrt(3)/2,I=Math.abs(Math.atan2(s*q,-P)/3);n=2*Math.sqrt(-y);var E=Math.cos(I);i=n*E;var z=n*(-E/2-L*Math.sin(I)),T=i+z>2*o?i-o:z-o,U=s,W=T/U;I=Math.abs(Math.atan2(C*q,-N)/3);var B=-C,V=(i=(n=2*Math.sqrt(-b))*(E=Math.cos(I)))+(z=n*(-E/2-L*Math.sin(I)))<2*u?i+u:z+u,Z=B/V,A=-T*V-U*B,D=(u*A-o*(T*B))/(-o*A+u*(U*V));return W<=D?W<=Z?D<=Z?[W,D,Z]:[W,Z,D]:[Z,W,D]:W<=Z?[D,W,Z]:D<=Z?[D,Z,W]:[Z,D,W]}u.computeDiscriminant=function(a,t,e,r){var n=t*t,i=e*e;return 18*a*t*e*r+n*i-27*(a*a)*(r*r)-4*(a*i*e+n*t*r)},u.computeRealRoots=function(a,t,e,r){var n,i;if(0===a)return s.computeRealRoots(t,e,r);if(0===t){if(0===e){if(0===r)return[0,0,0];var o=(i=-r/a)<0?-Math.pow(-i,1/3):Math.pow(i,1/3);return[o,o,o]}return 0===r?0===(n=s.computeRealRoots(a,0,e)).Length?[0]:[n[0],0,n[1]]:C(a,0,e,r)}return 0===e?0===r?(i=-t/a)<0?[i,0,0]:[0,0,i]:C(a,t,0,r):0===r?0===(n=s.computeRealRoots(a,t,e)).length?[0]:n[1]<=0?[n[0],n[1],0]:n[0]>=0?[0,n[0],n[1]]:[n[0],0,n[1]]:C(a,t,e,r)};var c={};function l(a,t,e,r){var n=a*a,o=t-3*n/8,C=e-t*a/2+n*a/8,c=r-e*a/4+t*n/16-3*n*n/256,l=u.computeRealRoots(1,2*o,o*o-4*c,-C*C);if(l.length>0){var h=-a/4,M=l[l.length-1];if(Math.abs(M)<i.CesiumMath.EPSILON14){var f=s.computeRealRoots(1,o,c);if(2===f.length){var m,d=f[0],g=f[1];if(d>=0&&g>=0){var v=Math.sqrt(d),p=Math.sqrt(g);return[h-p,h-v,h+v,h+p]}if(d>=0&&g<0)return[h-(m=Math.sqrt(d)),h+m];if(d<0&&g>=0)return[h-(m=Math.sqrt(g)),h+m]}return[]}if(M>0){var w=Math.sqrt(M),R=(o+M-C/w)/2,S=(o+M+C/w)/2,O=s.computeRealRoots(1,w,R),x=s.computeRealRoots(1,-w,S);return 0!==O.length?(O[0]+=h,O[1]+=h,0!==x.length?(x[0]+=h,x[1]+=h,O[1]<=x[0]?[O[0],O[1],x[0],x[1]]:x[1]<=O[0]?[x[0],x[1],O[0],O[1]]:O[0]>=x[0]&&O[1]<=x[1]?[x[0],O[0],O[1],x[1]]:x[0]>=O[0]&&x[1]<=O[1]?[O[0],x[0],x[1],O[1]]:O[0]>x[0]&&O[0]<x[1]?[x[0],O[0],x[1],O[1]]:[O[0],x[0],O[1],x[1]]):O):0!==x.length?(x[0]+=h,x[1]+=h,x):[]}}return[]}function h(a,t,e,r){var n=a*a,o=-2*t,C=e*a+t*t-4*r,c=n*r-e*t*a+e*e,l=u.computeRealRoots(1,o,C,c);if(l.length>0){var h,M,f,m,d,g,v=l[0],p=t-v,w=p*p,R=a/2,S=p/2,O=w-4*r,x=w+4*Math.abs(r),y=n-4*v,P=n+4*Math.abs(v);if(v<0||O*P<y*x){var b=Math.sqrt(y);h=b/2,M=0===b?0:(a*S-e)/b}else{var N=Math.sqrt(O);h=0===N?0:(a*S-e)/N,M=N/2}0===R&&0===h?(f=0,m=0):i.CesiumMath.sign(R)===i.CesiumMath.sign(h)?m=v/(f=R+h):f=v/(m=R-h),0===S&&0===M?(d=0,g=0):i.CesiumMath.sign(S)===i.CesiumMath.sign(M)?g=r/(d=S+M):d=r/(g=S-M);var q=s.computeRealRoots(1,f,d),L=s.computeRealRoots(1,m,g);if(0!==q.length)return 0!==L.length?q[1]<=L[0]?[q[0],q[1],L[0],L[1]]:L[1]<=q[0]?[L[0],L[1],q[0],q[1]]:q[0]>=L[0]&&q[1]<=L[1]?[L[0],q[0],q[1],L[1]]:L[0]>=q[0]&&L[1]<=q[1]?[q[0],L[0],L[1],q[1]]:q[0]>L[0]&&q[0]<L[1]?[L[0],q[0],L[1],q[1]]:[q[0],L[0],q[1],L[1]]:q;if(0!==L.length)return L}return[]}function M(a,r){r=t.Cartesian3.clone(e.defaultValue(r,t.Cartesian3.ZERO)),t.Cartesian3.equals(r,t.Car