import{aasP}from"./chunk-VYMAIP2A.js";import{aasj,basd}from"./chunk-V7XARCCV.js";import{aasO}from"./chunk-SACP225T.js";import{aasA,basm,gasu}from"./chunk-7YEOLR2L.js";import{aase,casl,das_}from"./chunk-RH3GFHG2.js";import{aasg}from"./chunk-TA3RE4KQ.js";import{aasy,basp}from"./chunk-RTY3VPG6.js";import{easr}from"./chunk-LRNH5AEO.js";varx=newA;functions(n,t){if(p.defined("origin",n),t=g(t,_.default),n=t.scaleToGeodeticSurface(n),!r(n))thrownewy("origin must not be at the center of the ellipsoid.");leto=u.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(m.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(m.getColumn(o,1,x));leti=e.fromCartesian4(m.getColumn(o,2,x));this._plane=O.fromPointNormal(n,i)}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},origin:{get:function(){returnthis._origin}},plane:{get:function(){returnthis._plane}},xAxis:{get:function(){returnthis._xAxis}},yAxis:{get:function(){returnthis._yAxis}},zAxis:{get:function(){returnthis._plane.normal}}});varC=newP;s.fromPoints=function(n,t){p.defined("cartesians",n);leto=P.fromPoints(n,C);returnnews(o.center,t)};varw=newj,h=newe;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);leto=w;o.origin=n,e.normalize(n,o.direction);leti=d.rayPlane(o,this._plane,h);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h)),r(i)){letc=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);returnr(t)?(t.x=a,t.y=f,t):newl(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);leto=0,i=n.length;for(letc=0;c<i;c++){leta=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}returnt.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=newl);leto=w;o.origin=n,e.clone(this._plane.normal,o.direction);leti=d.rayPlane(o,this._plane,h);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h));letc=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);returnt.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);leto=n.length;t.length=o;for(leti=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);returnt};varT=newe;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=newe);leto=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=T;returne.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);leto=n.length;r(t)?t.length=o:t=newArray(o);for(leti=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);returnt};varM=s;export{Masa};