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