/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.96.6 * * 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. */ define(["exports","./Matrix2-4706dd70","./defaultValue-028a8a27","./RuntimeError-a977b8e0","./ComponentDatatype-438cad2a"],(function(e,t,i,o,a){"use strict";function r(e){this._ellipsoid=i.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r.mercatorAngleToGeodeticLatitude=function(e){return a.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},r.geodeticLatitudeToMercatorAngle=function(e){e>r.MaximumLatitude?e=r.MaximumLatitude:e<-r.MaximumLatitude&&(e=-r.MaximumLatitude);const t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},r.MaximumLatitude=r.mercatorAngleToGeodeticLatitude(Math.PI),r.prototype.project=function(e,o){const a=this._semimajorAxis,n=e.longitude*a,u=r.geodeticLatitudeToMercatorAngle(e.latitude)*a,d=e.height;return i.defined(o)?(o.x=n,o.y=u,o.z=d,o):new t.Cartesian3(n,u,d)},r.prototype.unproject=function(e,a){if(!i.defined(e))throw new o.DeveloperError("cartesian is required");const n=this._oneOverSemimajorAxis,u=e.x*n,d=r.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i.defined(a)?(a.longitude=u,a.latitude=d,a.height=s,a):new t.Cartographic(u,d,s)},e.WebMercatorProjection=r}));