define(["exports","./Cartographic-1bbcab04","./Check-3aa71481","./when-515d5295","./Intersect-53434a77","./Cartesian2-1b9b0d8a","./Cartesian4-034d54d5","./Rectangle-e170be8b","./IntersectionTests-5fa33dbd","./PrimitiveType-b38a4004","./Plane-92c15089","./GeometryAttribute-9bc31a7f"],(function(t,n,e,i,a,r,o,s,m,c,u,l){"use strict";function h(t,e,a){this.minimum=n.a.clone(i.e(t,n.a.ZERO)),this.maximum=n.a.clone(i.e(e,n.a.ZERO)),a=i.t(a)?n.a.clone(a):n.a.midpoint(this.minimum,this.maximum,new n.a),this.center=a}h.fromPoints=function(t,e){if(i.t(e)||(e=new h),!i.t(t)||0===t.length)return e.minimum=n.a.clone(n.a.ZERO,e.minimum),e.maximum=n.a.clone(n.a.ZERO,e.maximum),e.center=n.a.clone(n.a.ZERO,e.center),e;for(var a=t[0].x,r=t[0].y,o=t[0].z,s=t[0].x,m=t[0].y,c=t[0].z,u=t.length,l=1;l0?a.S.INSIDE:m+s<0?a.S.OUTSIDE:a.S.INTERSECTING},h.prototype.clone=function(t){return h.clone(this,t)},h.prototype.intersectPlane=function(t){return h.intersectPlane(this,t)},h.prototype.equals=function(t){return h.equals(this,t)};var d=new o.a;function f(t,a){if(e.n.defined("origin",t),t=(a=i.e(a,s.n.WGS84)).scaleToGeodeticSurface(t),!i.t(t))throw new e.t("origin must not be at the center of the ellipsoid.");var r=l.m.eastNorthUpToFixedFrame(t,a);this._ellipsoid=a,this._origin=t,this._xAxis=n.a.fromCartesian4(c.c.getColumn(r,0,d)),this._yAxis=n.a.fromCartesian4(c.c.getColumn(r,1,d));var o=n.a.fromCartesian4(c.c.getColumn(r,2,d));this._plane=u.n.fromPointNormal(t,o)}Object.defineProperties(f.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 h;f.fromPoints=function(t,n){return e.n.defined("cartesians",t),new f(h.fromPoints(t,x).center,n)};var y=new m.n,g=new n.a;f.prototype.projectPointOntoPlane=function(t,a){e.n.defined("cartesian",t);var o=y;o.origin=t,n.a.normalize(t,o.direction);var s=m.h.rayPlane(o,this._plane,g);if(i.t(s)||(n.a.negate(o.direction,o.direction),s=m.h.rayPlane(o,this._plane,g)),i.t(s)){var c=n.a.subtract(s,this._origin,s),u=n.a.dot(this._xAxis,c),l=n.a.dot(this._yAxis,c);return i.t(a)?(a.x=u,a.y=l,a):new r.r(u,l)}},f.prototype.projectPointsOntoPlane=function(t,n){e.n.defined("cartesians",t),i.t(n)||(n=[]);for(var a=0,r=t.length,o=0;o