define(["exports","./AxisAlignedBoundingBox-60790181","./Matrix2-5b4a06aa","./RuntimeError-ffc802eb","./when-e3a49219","./IntersectionTests-f8dc50a9","./Plane-0ccccd91","./Transforms-c32992f8"],(function(t,e,n,i,r,a,o,s){"use strict";var l=new n.Cartesian4;function c(t,e){t=(e=r.defaultValue(e,n.Ellipsoid.WGS84)).scaleToGeodeticSurface(t);var i=s.Transforms.eastNorthUpToFixedFrame(t,e);this._ellipsoid=e,this._origin=t,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(t,a)}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 d=new e.AxisAlignedBoundingBox;c.fromPoints=function(t,n){return new c(e.AxisAlignedBoundingBox.fromPoints(t,d).center,n)};var f=new a.Ray,p=new n.Cartesian3;c.prototype.projectPointOntoPlane=function(t,e){var i=f;i.origin=t,n.Cartesian3.normalize(t,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),c=n.Cartesian3.dot(this._yAxis,s);return r.defined(e)?(e.x=l,e.y=c,e):new n.Cartesian2(l,c)}},c.prototype.projectPointsOntoPlane=function(t,e){r.defined(e)||(e=[]);for(var n=0,i=t.length,a=0;a