define(["exports","./AxisAlignedBoundingBox-7a3018c0","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./Transforms-3ac41eb6"],(function(e,t,n,i,o,r,s,a){"use strict";const c=new n.Cartesian4;function l(e,t){if(i.Check.defined("origin",e),t=o.defaultValue(t,n.Ellipsoid.WGS84),e=t.scaleToGeodeticSurface(e),!o.defined(e))throw new i.DeveloperError("origin must not be at the center of the ellipsoid.");const r=a.Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(r,0,c)),this._yAxis=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(r,1,c));const l=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(r,2,c));this._plane=s.Plane.fromPointNormal(e,l)}Object.defineProperties(l.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}}});const d=new t.AxisAlignedBoundingBox;l.fromPoints=function(e,n){i.Check.defined("cartesians",e);const o=t.AxisAlignedBoundingBox.fromPoints(e,d);return new l(o.center,n)};const f=new r.Ray,p=new n.Cartesian3;l.prototype.projectPointOntoPlane=function(e,t){i.Check.defined("cartesian",e);const s=f;s.origin=e,n.Cartesian3.normalize(e,s.direction);let a=r.IntersectionTests.rayPlane(s,this._plane,p);if(o.defined(a)||(n.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,p)),o.defined(a)){const e=n.Cartesian3.subtract(a,this._origin,a),i=n.Cartesian3.dot(this._xAxis,e),r=n.Cartesian3.dot(this._yAxis,e);return o.defined(t)?(t.x=i,t.y=r,t):new n.Cartesian2(i,r)}},l.prototype.projectPointsOntoPlane=function(e,t){i.Check.defined("cartesians",e),o.defined(t)||(t=[]);let n=0;const r=e.length;for(let i=0;i