define(["exports","./Cartographic-67e73ef9","./Check-52a7d806","./when-92c6cf3c","./Intersect-b97e930a","./Cartesian2-6033fa5d","./Cartesian4-ad128b5d","./Rectangle-bab7abf0","./IntersectionTests-a42760d9","./PrimitiveType-cdfe443e","./Plane-f8d22530","./GeometryAttribute-ef657318"],(function(t,e,n,i,r,o,a,s,m,c,u,l){"use strict";function f(t,n,r){this.minimum=e.t.clone(i.u(t,e.t.ZERO)),this.maximum=e.t.clone(i.u(n,e.t.ZERO)),r=i.e(r)?e.t.clone(r):e.t.midpoint(this.minimum,this.maximum,new e.t),this.center=r}f.fromPoints=function(t,n){if(i.e(n)||(n=new f),!i.e(t)||0===t.length)return n.minimum=e.t.clone(e.t.ZERO,n.minimum),n.maximum=e.t.clone(e.t.ZERO,n.maximum),n.center=e.t.clone(e.t.ZERO,n.center),n;for(var r=t[0].x,o=t[0].y,a=t[0].z,s=t[0].x,m=t[0].y,c=t[0].z,u=t.length,l=1;l0?r.S.INSIDE:m+s<0?r.S.OUTSIDE:r.S.INTERSECTING},f.prototype.clone=function(t){return f.clone(this,t)},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.equals=function(t){return f.equals(this,t)};var d=new a.e;function p(t,r){if(n.o.defined("origin",t),t=(r=i.u(r,s.t.WGS84)).scaleToGeodeticSurface(t),!i.e(t))throw new n.t("origin must not be at the center of the ellipsoid.");var o=l.m.eastNorthUpToFixedFrame(t,r);this._ellipsoid=r,this._origin=t,this._xAxis=e.t.fromCartesian4(c.y.getColumn(o,0,d)),this._yAxis=e.t.fromCartesian4(c.y.getColumn(o,1,d));var a=e.t.fromCartesian4(c.y.getColumn(o,2,d));this._plane=u.o.fromPointNormal(t,a)}Object.defineProperties(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var x=new f;p.fromPoints=function(t,e){return n.o.defined("cartesians",t),new p(f.fromPoints(t,x).center,e)};var y=new m.f,g=new e.t;p.prototype.projectPointOntoPlane=function(t,r){n.o.defined("cartesian",t);var a=y;a.origin=t,e.t.normalize(t,a.direction);var s=m.g.rayPlane(a,this._plane,g);if(i.e(s)||(e.t.negate(a.direction,a.direction),s=m.g.rayPlane(a,this._plane,g)),i.e(s)){var c=e.t.subtract(s,this._origin,s),u=e.t.dot(this._xAxis,c),l=e.t.dot(this._yAxis,c);return i.e(r)?(r.x=u,r.y=l,r):new o.o(u,l)}},p.prototype.projectPointsOntoPlane=function(t,e){n.o.defined("cartesians",t),i.e(e)||(e=[]);for(var r=0,o=t.length,a=0;a