define(["exports","./Cartographic-3309dd0d","./Check-7b2a090c","./when-b60132fc","./buildModuleUrl-9085faaa","./Cartesian2-db21342c","./Cartesian4-3ca25aab","./Rectangle-dee65d21","./IntersectionTests-0d6905a3","./FeatureDetection-806b12f0","./Plane-a3d8b3d2","./GeometryAttribute-c65394ac"],(function(e,n,t,i,a,r,s,o,c,m,l,u){"use strict";function d(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}d.fromPoints=function(e,t){if(i.defined(t)||(t=new d),!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,c=e[0].y,m=e[0].z,l=e.length,u=1;u0?a.Intersect.INSIDE:o+s<0?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.equals=function(e){return d.equals(this,e)};var h=new s.Cartesian4;function C(e,t){e=(t=i.defaultValue(t,o.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var a=u.Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.Cartesian3.fromCartesian4(m.Matrix4.getColumn(a,0,h)),this._yAxis=n.Cartesian3.fromCartesian4(m.Matrix4.getColumn(a,1,h));var r=n.Cartesian3.fromCartesian4(m.Matrix4.getColumn(a,2,h));this._plane=l.Plane.fromPointNormal(e,r)}Object.defineProperties(C.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 p=new d;C.fromPoints=function(e,n){return new C(d.fromPoints(e,p).center,n)};var x=new c.Ray,y=new n.Cartesian3;C.prototype.projectPointOntoPlane=function(e,t){var a=x;a.origin=e,n.Cartesian3.normalize(e,a.direction);var s=c.IntersectionTests.rayPlane(a,this._plane,y);if(i.defined(s)||(n.Cartesian3.negate(a.direction,a.direction),s=c.IntersectionTests.rayPlane(a,this._plane,y)),i.defined(s)){var o=n.Cartesian3.subtract(s,this._origin,s),m=n.Cartesian3.dot(this._xAxis,o),l=n.Cartesian3.dot(this._yAxis,o);return i.defined(t)?(t.x=m,t.y=l,t):new r.Cartesian2(m,l)}},C.prototype.projectPointsOntoPlane=function(e,n){i.defined(n)||(n=[]);for(var t=0,a=e.length,r=0;r