/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.128 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as P}from"./chunk-CCGHELB6.js";import{a as u,b as d}from"./chunk-YTKWBMG6.js";import{a as j}from"./chunk-OIUXC5BJ.js";import{a as _,b as h,g as A}from"./chunk-GSQ5TTBU.js";import{a as e,c as l,d as g}from"./chunk-KLDIEE7M.js";import{a as y,b as p}from"./chunk-IQDUXDOM.js";import{e as r}from"./chunk-GDY26PU3.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c