define(["exports","./AxisAlignedBoundingBox-122de82b","./Cartesian2-b4b7b0b3","./Transforms-73e77b72","./Check-5e798bbf","./when-208fe5b0","./IntersectionTests-40db2afa","./Plane-b91bfb59"],function(e,n,s,i,t,l,r,a){"use strict";var o=new i.Cartesian4;function d(e,t){e=(t=l.defaultValue(t,s.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var n=i.Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=s.Cartesian3.fromCartesian4(i.Matrix4.getColumn(n,0,o)),this._yAxis=s.Cartesian3.fromCartesian4(i.Matrix4.getColumn(n,1,o));n=s.Cartesian3.fromCartesian4(i.Matrix4.getColumn(n,2,o));this._plane=a.Plane.fromPointNormal(e,n)}Object.defineProperties(d.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 n.AxisAlignedBoundingBox;d.fromPoints=function(e,t){return new d(n.AxisAlignedBoundingBox.fromPoints(e,c).center,t)};var f=new r.Ray,p=new s.Cartesian3;d.prototype.projectPointOntoPlane=function(e,t){var n=f;n.origin=e,s.Cartesian3.normalize(e,n.direction);e=r.IntersectionTests.rayPlane(n,this._plane,p);if(l.defined(e)||(s.Cartesian3.negate(n.direction,n.direction),e=r.IntersectionTests.rayPlane(n,this._plane,p)),l.defined(e)){n=s.Cartesian3.subtract(e,this._origin,e),e=s.Cartesian3.dot(this._xAxis,n),n=s.Cartesian3.dot(this._yAxis,n);return l.defined(t)?(t.x=e,t.y=n,t):new s.Cartesian2(e,n)}},d.prototype.projectPointsOntoPlane=function(e,t){l.defined(t)||(t=[]);for(var n=0,i=e.length,r=0;r