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