define(["exports","./Cartographic-3309dd0d","./Check-7b2a090c","./when-b60132fc","./BoundingSphere-561b54d0","./Cartesian2-47311507","./Cartesian4-3ca25aab","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0"],(function(e,n,t,i,a,r,s,o,m,c){"use strict";function l(e,t,a){this.minimum=n.Cartesian3.clone(i.defaultValue(e,n.Cartesian3.ZERO)),this.maximum=n.Cartesian3.clone(i.defaultValue(t,n.Cartesian3.ZERO)),a=i.defined(a)?n.Cartesian3.clone(a):n.Cartesian3.midpoint(this.minimum,this.maximum,new n.Cartesian3),this.center=a}l.fromPoints=function(e,t){if(i.defined(t)||(t=new l),!i.defined(e)||0===e.length)return t.minimum=n.Cartesian3.clone(n.Cartesian3.ZERO,t.minimum),t.maximum=n.Cartesian3.clone(n.Cartesian3.ZERO,t.maximum),t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t;for(var a=e[0].x,r=e[0].y,s=e[0].z,o=e[0].x,m=e[0].y,c=e[0].z,u=e.length,d=1;d0?a.Intersect.INSIDE:o+s<0?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.equals=function(e){return l.equals(this,e)};var d=new s.Cartesian4;function f(e,t){e=(t=i.defaultValue(t,r.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var s=c.Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.Cartesian3.fromCartesian4(a.Matrix4.getColumn(s,0,d)),this._yAxis=n.Cartesian3.fromCartesian4(a.Matrix4.getColumn(s,1,d));var o=n.Cartesian3.fromCartesian4(a.Matrix4.getColumn(s,2,d));this._plane=m.Plane.fromPointNormal(e,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 h=new l;f.fromPoints=function(e,n){return new f(l.fromPoints(e,h).center,n)};var C=new o.Ray,p=new n.Cartesian3;f.prototype.projectPointOntoPlane=function(e,t){var a=C;a.origin=e,n.Cartesian3.normalize(e,a.direction);var s=o.IntersectionTests.rayPlane(a,this._plane,p);if(i.defined(s)||(n.Cartesian3.negate(a.direction,a.direction),s=o.IntersectionTests.rayPlane(a,this._plane,p)),i.defined(s)){var m=n.Cartesian3.subtract(s,this._origin,s),c=n.Cartesian3.dot(this._xAxis,m),l=n.Cartesian3.dot(this._yAxis,m);return i.defined(t)?(t.x=c,t.y=l,t):new r.Cartesian2(c,l)}},f.prototype.projectPointsOntoPlane=function(e,n){i.defined(n)||(n=[]);for(var t=0,a=e.length,r=0;r