define(["exports","./AxisAlignedBoundingBox-07c6b7f2","./Matrix2-9aa31791","./RuntimeError-346a3079","./when-4bbc8319","./IntersectionTests-96a04219","./Plane-318d6937","./Transforms-d13cc04e"],(function(t,e,n,i,r,a,o,s){"use strict";var l=new n.Cartesian4;function d(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(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 e.AxisAlignedBoundingBox;d.fromPoints=function(t,n){return new d(e.AxisAlignedBoundingBox.fromPoints(t,c).center,n)};var p=new a.Ray,u=new n.Cartesian3;d.prototype.projectPointOntoPlane=function(t,e){var i=p;i.origin=t,n.Cartesian3.normalize(t,i.direction);var o=a.IntersectionTests.rayPlane(i,this._plane,u);if(r.defined(o)||(n.Cartesian3.negate(i.direction,i.direction),o=a.IntersectionTests.rayPlane(i,this._plane,u)),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(e)?(e.x=l,e.y=d,e):new n.Cartesian2(l,d)}},d.prototype.projectPointsOntoPlane=function(t,e){r.defined(e)||(e=[]);for(var n=0,i=t.length,a=0;a