You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
13 KiB
2 lines
13 KiB
12 months ago
|
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30"],function(a,q,t,z,T,U){"use strict";var W={};function C(a,t,e){var r=a+t;return z.CesiumMath.sign(a)!==z.CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(a),Math.abs(t)))<e?0:r}W.computeDiscriminant=function(a,t,e){return t*t-4*a*e},W.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),i=Math.abs(a);if(n<i&&n/i<z.CesiumMath.EPSILON14)return[0,0];if(i<n&&i/n<z.CesiumMath.EPSILON14)return[];if((r=-e/a)<0)return[];var s=Math.sqrt(r);return[-s,s]}if(0===e)return(r=-t/a)<0?[r,0]:[0,r];var o=C(t*t,-(4*a*e),z.CesiumMath.EPSILON14);if(o<0)return[];var u=-.5*C(t,z.CesiumMath.sign(t)*Math.sqrt(o),z.CesiumMath.EPSILON14);return 0<t?[u/a,e/u]:[e/u,u/a]};var N={};function o(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,v=4*f*d-m*m;if(v<0){var g,p,w,R=-((w=c*M<=h*l?-2*o*(p=f)+(g=s)*m:-(g=C)*m+2*u*(p=d))<0?-1:1)*Math.abs(g)*Math.sqrt(-v),S=(i=R-w)/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),c*M<=h*l?[(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(v),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=2*o<i+z?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]}N.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)},N.computeRealRoots=function(a,t,e,r){var n,i;if(0===a)return W.computeRealRoots(t,e,r);if(0!==t)return 0===e?0===r?(i=-t/a)<0?[i,0,0]:[0,0,i]:o(a,t,0,r):0===r?0===(n=W.computeRealRoots(a,t,e)).length?[0]:n[1]<=0?[n[0],n[1],0]:0<=n[0]?[0,n[0],n[1]]:[n[0],0,n[1]]:o(a,t,e,r);if(0!==e)return 0===r?0===(n=W.computeRealRoots(a,0,e)).Length?[0]:[n[0],0,n[1]]:o(a,0,e,r);if(0===r)return[0,0,0];var s=(i=-r/a)<0?-Math.pow(-i,1/3):Math.pow(i,1/3);return[s,s,s]};var B={};function c(a,t,e,r){var n=a*a,i=t-3*n/8,s=e-t*a/2+n*a/8,o=r-e*a/4+t*n/16-3*n*n/256,u=N.computeRealRoots(1,2*i,i*i-4*o,-s*s);if(0<u.length){var C=-a/4,c=u[u.length-1];if(Math.abs(c)<z.CesiumMath.EPSILON14){var l=W.computeRealRoots(1,i,o);if(2===l.length){var h,M=l[0],f=l[1];if(0<=M&&0<=f){var m=Math.sqrt(M),d=Math.sqrt(f);return[C-d,C-m,C+m,C+d]}if(0<=M&&f<0)return[C-(h=Math.sqrt(M)),C+h];if(M<0&&0<=f)return[C-(h=Math.sqrt(f)),C+h]}return[]}if(0<c){var v=Math.sqrt(c),g=(i+c-s/v)/2,p=(i+c+s/v)/2,w=W.computeRealRoots(1,v,g),R=W.computeRealRoots(1,-v,p);return 0!==w.length?(w[0]+=C,w[1]+=C,0!==R.length?(R[0]+=C,R[1]+=C,w[1]<=R[0]?[w[0],w[1],R[0],R[1]]:R[1]<=w[0]?[R[0],R[1],w[0],w[1]]:w[0]>=R[0]&&w[1]<=R[1]?[R[0],w[0],w[1],R[1]]:R[0]>=w[0]&&R[1]<=w[1]?[w[0],R[0],R[1],w[1]]:w[0]>R[0]&&w[0]<R[1]?[R[0],w[0],R[1],w[1]]:[w[0],R[0],w[1],R[1]]):w):0!==R.length?(R[0]+=C,R[1]+=C,R):[]}}return[]}function l(a,t,e,r){var n=a*a,i=-2*t,s=e*a+t*t-4*r,o=n*r-e*t*a+e*e,u=N.computeRealRoots(1,i,s,o);if(0<u.length){var C,c,l,h,M,f,m=u[0],d=t-m,v=d*d,g=a/2,p=d/2,w=v-4*r,R=v+4*Math.abs(r),S=n-4*m,O=n+4*Math.abs(m);if(m<0||w*O<S*R){var x=Math.sqrt(S);C=x/2,c=0===x?0:(a*p-e)/x}else{var y=Math.sqrt(w);C=0===y?0:(a*p-e)/y,c=y/2}0==g&&0===C?h=l=0:z.CesiumMath.sign(g)===z.CesiumMath.sign(C)?h=m/(l=g+C):l=m/(h=g-C),0==p&&0===c?f=M=0:z.CesiumMath.sign(p)===z.CesiumMath.sign(c)?f=r/(M=p+c):M=r/(f=p-c);var P=W.computeRealRoots(1,l,M),b=W.computeRealRoots(1,h,f);if(0!==P.length)return 0!==b.length?P[1]<=b[0]?[P[0],P[1],b[0],b[1]]:b[1]<=P[0]?[b[0],b[1],P[0],P[1]]:P[0]>=b[0]&&P[1]<=b[1]?[b[0],P[0],P[1],b[1]]:b[0]>=P[0]&&b[1]<=P[1]?[P[0],b[0],b[1],P[1]]:P[0]>b[0]&&P[0]<b[1]?[b[0],P[0],b[1],P[1]]:[P[0],b[0],P[1],b[1]]:P;if(0!==b.length)return b}return[]}function e(a,t){t=T.Cartesian3.clone(q.defaultValue(t,T.Cartesian3.ZERO)),T.Cartesian3.equals(t,T.Cartesian3.ZERO)||T.Cartesian3.no
|