/* 2020-9-22 15:23:25 | 版权所有 军懋国兴 */ define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-69007a69","./Cartesian2-43e3a3be","./Transforms-2d1ac5ec","./Plane-46b5436f","./EllipsoidTangentPlane-b5927ee3"],function(a,W,X,j,Z,N,G,Y){"use strict";function A(a,e){this.center=Z.Cartesian3.clone(W.defaultValue(a,Z.Cartesian3.ZERO)),this.halfAxes=N.Matrix3.clone(W.defaultValue(e,N.Matrix3.ZERO))}A.packedLength=Z.Cartesian3.packedLength+N.Matrix3.packedLength,A.pack=function(a,e,t){return X.Check.typeOf.object("value",a),X.Check.defined("array",e),t=W.defaultValue(t,0),Z.Cartesian3.pack(a.center,e,t),N.Matrix3.pack(a.halfAxes,e,t+Z.Cartesian3.packedLength),e},A.unpack=function(a,e,t){return X.Check.defined("array",a),e=W.defaultValue(e,0),W.defined(t)||(t=new A),Z.Cartesian3.unpack(a,e,t.center),N.Matrix3.unpack(a,e+Z.Cartesian3.packedLength,t.halfAxes),t};var T=new Z.Cartesian3,R=new Z.Cartesian3,I=new Z.Cartesian3,D=new Z.Cartesian3,L=new Z.Cartesian3,z=new Z.Cartesian3,S=new N.Matrix3,q={unitary:new N.Matrix3,diagonal:new N.Matrix3};A.fromPoints=function(a,e){if(W.defined(e)||(e=new A),!W.defined(a)||0===a.length)return e.halfAxes=N.Matrix3.ZERO,e.center=Z.Cartesian3.ZERO,e;for(var t=a.length,r=Z.Cartesian3.clone(a[0],T),n=1;nj.CesiumMath.TWO_PI)throw new X.DeveloperError("Rectangle width must be between 0 and 2*pi");if(a.height<0||a.height>j.CesiumMath.PI)throw new X.DeveloperError("Rectangle height must be between 0 and pi");if(W.defined(r)&&!j.CesiumMath.equalsEpsilon(r.radii.x,r.radii.y,j.CesiumMath.EPSILON15))throw new X.DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");if(e=W.defaultValue(e,0),t=W.defaultValue(t,0),r=W.defaultValue(r,Z.Ellipsoid.WGS84),a.width<=j.CesiumMath.PI){var i,s=Z.Rectangle.center(a,H),o=r.cartographicToCartesian(s,J),d=new Y.EllipsoidTangentPlane(o,r),C=d.plane,u=s.longitude,c=a.south<0&&0o&&(l+=(c=u.x-o)*c),u.y<-d?l+=(c=u.y+d)*c:u.y>d&&(l+=(c=u.y-d)*c),u.z<-C?l+=(c=u.z+C)*c:u.z>C&&(l+=(c=u.z-C)*c),l};var w=new Z.Cartesian3,g=new Z.Cartesian3;A.computePlaneDistances=function(a,e,t,r){if(!W.defined(a))throw new X.DeveloperError("box is required.");if(!W.defined(e))throw new X.DeveloperError("position is required.");if(!W.defined(t))throw new X.DeveloperError("direction is required.");W.defined(r)||(r=new N.Interval);var n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=a.center,o=a.halfAxes,d=N.Matrix3.getColumn(o,0,f),C=N.Matrix3.getColumn(o,1,p),u=N.Matrix3.getColumn(o,2,M),c=Z.Cartesian3.add(d,C,w);Z.Cartesian3.add(c,u,c),Z.Cartesian3.add(c,s,c);var l=Z.Cartesian3.subtract(c,e,g),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i);return Z.Cartesian3.add(s,d,c),Z.Cartesian3.add(c,C,c),Z.Cartesian3.subtract(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),Z.Cartesian3.add(s,d,c),Z.Cartesian3.subtract(c,C,c),Z.Cartesian3.add(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),Z.Cartesian3.add(s,d,c),Z.Cartesian3.subtract(c,C,c),Z.Cartesian3.subtract(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),Z.Cartesian3.subtract(s,d,c),Z.Cartesian3.add(c,C,c),Z.Cartesian3.add(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),Z.Cartesian3.subtract(s,d,c),Z.Cartesian3.add(c,C,c),Z.Cartesian3.subtract(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),Z.Cartesian3.subtract(s,d,c),Z.Cartesian3.subtract(c,C,c),Z.Cartesian3.add(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),Z.Cartesian3.subtract(s,d,c),Z.Cartesian3.subtract(c,C,c),Z.Cartesian3.subtract(c,u,c),Z.Cartesian3.subtract(c,e,l),h=Z.Cartesian3.dot(t,l),n=Math.min(h,n),i=Math.max(h,i),r.start=n,r.stop=i,r};var r=new N.BoundingSphere;A.isOccluded=function(a,e){if(!W.defined(a))throw new X.DeveloperError("box is required.");if(!W.defined(e))throw new X.DeveloperError("occluder is required.");var t=N.BoundingSphere.fromOrientedBoundingBox(a,r);return!e.isBoundingSphereVisible(t)},A.prototype.intersectPlane=function(a){return A.intersectPlane(this,a)},A.prototype.distanceSquaredTo=function(a){return A.distanceSquaredTo(this,a)},A.prototype.computePlaneDistances=function(a,e,t){return A.computePlaneDistances(this,a,e,t)},A.prototype.isOccluded=function(a){return A.isOccluded(this,a)},A.equals=function(a,e){return a===e||W.defined(a)&&W.defined(e)&&Z.Cartesian3.equals(a.center,e.center)&&N.Matrix3.equals(a.halfAxes,e.halfAxes)},A.prototype.clone=function(a){return A.clone(this,a)},A.prototype.equals=function(a){return A.equals(this,a)},a.OrientedBoundingBox=A});