define(["exports","./AxisAlignedBoundingBox-1feb0c48","./Matrix2-f2da41d4","./RuntimeError-ffe03243","./when-229515d6","./IntersectionTests-1b8a3cb9","./Plane-0421a8be","./Transforms-7cd3197b"],(function(e,t,n,i,r,a,o,s){"use strict";var l=new n.Cartesian4;function d(e,t){e=(t=r.defaultValue(t,n.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var i=s.Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(i,0,l)),this._yAxis=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(i,1,l));var a=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(i,2,l));this._plane=o.Plane.fromPointNormal(e,a)}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 t.AxisAlignedBoundingBox;d.fromPoints=function(e,n){return new d(t.AxisAlignedBoundingBox.fromPoints(e,c).center,n)};var f=new a.Ray,p=new n.Cartesian3;d.prototype.projectPointOntoPlane=function(e,t){var i=f;i.origin=e,n.Cartesian3.normalize(e,i.direction);var o=a.IntersectionTests.rayPlane(i,this._plane,p);if(r.defined(o)||(n.Cartesian3.negate(i.direction,i.direction),o=a.IntersectionTests.rayPlane(i,this._plane,p)),r.defined(o)){var s=n.Cartesian3.subtract(o,this._origin,o),l=n.Cartesian3.dot(this._xAxis,s),d=n.Cartesian3.dot(this._yAxis,s);return r.defined(t)?(t.x=l,t.y=d,t):new n.Cartesian2(l,d)}},d.prototype.projectPointsOntoPlane=function(e,t){r.defined(t)||(t=[]);for(var n=0,i=e.length,a=0;a