@baidumap/mapv-three 1.3.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/assets/textures/cloud/stbn.bin +0 -0
- package/dist/assets/textures/weather/thunder.jpg +0 -0
- package/dist/assets/wasm/lanelet.js +3296 -165
- package/dist/assets/wasm/lanelet.wasm +0 -0
- package/dist/assets/workers/{BaiduVectorParser.worker-d550338e.js → BaiduVectorParser.worker-486240e8.js} +977 -930
- package/dist/assets/workers/{CesiumTerrainParser.worker-20119751.js → CesiumTerrainParser.worker-ba35b937.js} +1032 -954
- package/dist/assets/workers/{MVTParser.worker-7dc8b0e4.js → MVTParser.worker-bb80e3b4.js} +755 -699
- package/dist/devtool/panel.js +108 -29
- package/dist/mapvthree.module.js +45540 -46298
- package/dist/mapvthree.umd.js +13 -7
- package/dist/types/Internal.d.ts +2 -0
- package/dist/types/adapters/bmap/Icon.d.ts +18 -0
- package/dist/types/adapters/bmap/InfoWindow.d.ts +124 -0
- package/dist/types/adapters/bmap/Label.d.ts +58 -0
- package/dist/types/adapters/bmap/Map.d.ts +124 -0
- package/dist/types/adapters/bmap/Marker.d.ts +28 -0
- package/dist/types/adapters/bmap/Overlay.d.ts +18 -0
- package/dist/types/adapters/bmap/Pixel.d.ts +1 -0
- package/dist/types/adapters/bmap/Point.d.ts +8 -0
- package/dist/types/adapters/bmap/Size.d.ts +8 -0
- package/dist/types/adapters/bmap/index.d.ts +8 -0
- package/dist/types/adapters/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.open.d.ts +5 -0
- package/dist/types/threejs/controls/PointerLockControls.d.ts +2 -0
- package/dist/types/threejs/geometries/text/ScreenTextGeometry.d.ts +15 -0
- package/dist/types/threejs/loaders/utilities/BatchTableHierarchyExtension.d.ts +4 -4
- package/dist/types/threejs/loaders/utilities/FeatureTable.d.ts +1 -1
- package/dist/types/threejs/materials/effects/LightningBillboardMaterial.d.ts +3 -0
- package/dist/types/threejs/materials/effects/LightningMaterial.d.ts +9 -0
- package/dist/types/threejs/materials/extend/ExtendMeshStandardMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/natural/DynamicSkyMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/natural/StaticSkyMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/natural/VerticalGradientSkyMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/polygon/PolygonMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/text/ScreenTextMaterial.d.ts +25 -0
- package/dist/types/threejs/objects/GeoInstancedMesh.d.ts +1 -0
- package/dist/types/threejs/objects/line/FatLineInternal.d.ts +4 -0
- package/dist/types/threejs/objects/line/Polyline.d.ts +1 -1
- package/dist/types/threejs/objects/point/Icon.d.ts +1 -0
- package/dist/types/threejs/objects/point/Label.d.ts +15 -2
- package/dist/types/threejs/objects/point/label/GeometryBufferBuilder.d.ts +3 -0
- package/dist/types/threejs/objects/point/label/TextBoxCalculator.d.ts +5 -3
- package/dist/types/threejs/objects/text/ScreenText.d.ts +273 -0
- package/dist/types/threejs/objects/text/font-atlas-manager.d.ts +10 -2
- package/dist/types/threejs/objects/text/utils.d.ts +1 -1
- package/dist/types/threemap/3dtiles/HDMap3DTiles.d.ts +26 -0
- package/dist/types/threemap/3dtiles/materials/Default3DTilesMaterialManager.d.ts +51 -3
- package/dist/types/threemap/Engine.d.ts +23 -4
- package/dist/types/threemap/animations/ObjectTracker.d.ts +73 -44
- package/dist/types/threemap/animations/PathTracker.d.ts +92 -24
- package/dist/types/threemap/animations/RotateTracker.d.ts +115 -21
- package/dist/types/threemap/animations/TrackerAbstract.d.ts +15 -11
- package/dist/types/threemap/controls/PointerLockControls.d.ts +8 -2
- package/dist/types/threemap/controls/controller/ColumbusController.d.ts +10 -0
- package/dist/types/threemap/controls/controller/Scene3DController.d.ts +9 -0
- package/dist/types/threemap/controls/editors/Editor.d.ts +3 -0
- package/dist/types/threemap/engine/Clock.d.ts +156 -0
- package/dist/types/threemap/engine/Controller.d.ts +141 -0
- package/dist/types/threemap/engine/Map.d.ts +34 -4
- package/dist/types/threemap/engine/Rendering.d.ts +15 -0
- package/dist/types/threemap/engine/event/EntityProxy.d.ts +1 -0
- package/dist/types/threemap/engine/map/BlankMap.d.ts +1 -1
- package/dist/types/threemap/engine/map/BlankMap3DControl.d.ts +4 -1
- package/dist/types/{threejs → threemap/engine/map}/controls/DraggingMovementAggregator.d.ts +3 -0
- package/dist/types/{threejs → threemap/engine/map}/controls/MapControl3D.d.ts +19 -2
- package/dist/types/{threejs → threemap/engine/map}/controls/PointerMovementAggregator.d.ts +3 -0
- package/dist/types/threemap/engine/map/earth/Earth.d.ts +1 -0
- package/dist/types/threemap/engine/rendering/Collision.d.ts +5 -0
- package/dist/types/threemap/engine/rendering/Label.d.ts +15 -0
- package/dist/types/threemap/engine/rendering/MainNew.d.ts +1 -1
- package/dist/types/threemap/engine/rendering/postprocessing/OpaquePostprocessings.d.ts +1 -1
- package/dist/types/threemap/engine/rendering/postprocessing/SkyAtmospherePass.d.ts +1 -0
- package/dist/types/threemap/engine/rendering/scene/DirectSceneRendering.d.ts +5 -0
- package/dist/types/threemap/mapView/geo/terrainData/QuantizedMeshTerrainData.d.ts +1 -1
- package/dist/types/threemap/mapView/grid/BaiduVectorOfflineGrid.d.ts +5 -0
- package/dist/types/threemap/mapView/map/MapView.d.ts +3 -0
- package/dist/types/threemap/mapView/parser/baidulane/ElementParser.d.ts +86 -0
- package/dist/types/threemap/mapView/parser/baidulane/StyleParser.d.ts +28 -0
- package/dist/types/threemap/mapView/parser/baidulane/constants/index.d.ts +25 -0
- package/dist/types/threemap/mapView/parser/baidulane/constants/types.d.ts +47 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/GeometryBuilder.d.ts +40 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/LayerManager.d.ts +41 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/MaterialFactory.d.ts +71 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/StyleManager.d.ts +50 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/TextureManager.d.ts +65 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/wasmManager.d.ts +18 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Base.d.ts +46 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Building3d.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/FlatSymbol.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/LabelLine.d.ts +36 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Line.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Line3d.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Line3dTexture.d.ts +3 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/LineDash.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/LineTexture.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Poi.d.ts +26 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon3d.d.ts +40 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrude.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrudeTexture.d.ts +18 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonOpacity.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/SimplePoint.d.ts +39 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Background.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Base.d.ts +27 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/BridgePier.d.ts +20 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/DebugLine.d.ts +16 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPoint.d.ts +5 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPolygon.d.ts +20 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGradient.d.ts +16 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGuide.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingLine.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingPoly.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingRoad.d.ts +13 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/HRegion.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/LineName.d.ts +48 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Link.d.ts +10 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Poi.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Poly.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Texture.d.ts +10 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/color.d.ts +13 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/coordinate.d.ts +18 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/geometry.d.ts +3 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/icon.d.ts +8 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/merge.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/tracer.d.ts +7 -0
- package/dist/types/{util/mapbox.d.ts → threemap/mapView/parser/mapbox/util.d.ts} +1 -1
- package/dist/types/threemap/mapView/surface/GroundSceneRenderer.d.ts +7 -2
- package/dist/types/threemap/mapView/surface/MapSurface.d.ts +2 -0
- package/dist/types/threemap/mapView/surface/strategy/FastTileLoaderStrategy.d.ts +16 -0
- package/dist/types/threemap/mapView/tileProvider/terrain/CesiumTerrainTileProvider.d.ts +3 -0
- package/dist/types/threemap/mapView/tileProvider/vector/BaiduLaneVectorTileProvider.d.ts +7 -0
- package/dist/types/threemap/mapView/tileProvider/vector/BaiduVectorTileProvider.d.ts +3 -0
- package/dist/types/threemap/mapView/tileProvider/vector/MapboxVectorTileProvider.d.ts +6 -10
- package/dist/types/threemap/mapView/utils/createGroundTileMesh.d.ts +2 -1
- package/dist/types/threemap/mapView/utils/projectVertices.d.ts +1 -1
- package/dist/types/threemap/materials/BatchBuildingMaterial.d.ts +9 -11
- package/dist/types/threemap/materials/RoadMarkingMaterial.d.ts +2 -11
- package/dist/types/threemap/materials/TerrainClassificationMaterial.d.ts +9 -7
- package/dist/types/threemap/natural/DynamicSky.d.ts +68 -22
- package/dist/types/threemap/natural/DynamicWeather.d.ts +17 -105
- package/dist/types/threemap/natural/EmptySky.d.ts +48 -62
- package/dist/types/threemap/natural/PhysicalSky.d.ts +220 -0
- package/dist/types/threemap/natural/Rain.d.ts +5 -2
- package/dist/types/threemap/natural/Snow.d.ts +5 -2
- package/dist/types/threemap/natural/StaticSky.d.ts +1 -0
- package/dist/types/threemap/natural/Thunderstorm.d.ts +46 -0
- package/dist/types/threemap/natural/clouds/CascadedShadowMaps.d.ts +31 -0
- package/dist/types/threemap/natural/clouds/CloudLayer.d.ts +19 -0
- package/dist/types/threemap/natural/clouds/CloudLayers.d.ts +13 -0
- package/dist/types/threemap/natural/clouds/CloudShape.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/CloudShapeDetail.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/CloudsEffect.d.ts +173 -0
- package/dist/types/threemap/natural/clouds/CloudsMaterial.d.ts +35 -0
- package/dist/types/threemap/natural/clouds/CloudsPass.d.ts +39 -0
- package/dist/types/threemap/natural/clouds/CloudsPostPass.d.ts +10 -0
- package/dist/types/threemap/natural/clouds/CloudsResolveMaterial.d.ts +13 -0
- package/dist/types/threemap/natural/clouds/DensityProfile.d.ts +10 -0
- package/dist/types/threemap/natural/clouds/LocalWeather.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/PassBase.d.ts +7 -0
- package/dist/types/threemap/natural/clouds/Procedural3DTexture.d.ts +15 -0
- package/dist/types/threemap/natural/clouds/ProceduralTexture.d.ts +15 -0
- package/dist/types/threemap/natural/clouds/ShaderArrayPass.d.ts +3 -0
- package/dist/types/threemap/natural/clouds/ShadowMaterial.d.ts +14 -0
- package/dist/types/threemap/natural/clouds/ShadowPass.d.ts +31 -0
- package/dist/types/threemap/natural/clouds/ShadowResolveMaterial.d.ts +8 -0
- package/dist/types/threemap/natural/clouds/Turbulence.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/bayer.d.ts +2 -0
- package/dist/types/threemap/natural/clouds/constants.d.ts +6 -0
- package/dist/types/threemap/natural/clouds/helpers/FrustumCorners.d.ts +10 -0
- package/dist/types/threemap/natural/clouds/helpers/setArrayRenderTargetLayers.d.ts +1 -0
- package/dist/types/threemap/natural/clouds/helpers/splitFrustum.d.ts +6 -0
- package/dist/types/threemap/natural/clouds/qualityPresets.d.ts +130 -0
- package/dist/types/threemap/natural/clouds/uniforms.d.ts +44 -0
- package/dist/types/threemap/natural/core/ArrayBufferLoader.d.ts +3 -0
- package/dist/types/threemap/natural/core/DataTextureLoader.d.ts +11 -0
- package/dist/types/threemap/natural/core/Ellipsoid.d.ts +17 -0
- package/dist/types/threemap/natural/core/Geodetic.d.ts +23 -0
- package/dist/types/threemap/natural/core/TypedArrayLoader.d.ts +5 -0
- package/dist/types/threemap/natural/core/capabilities.d.ts +1 -0
- package/dist/types/threemap/natural/core/celestialDirections.d.ts +5 -0
- package/dist/types/threemap/natural/core/decorators.d.ts +61 -0
- package/dist/types/threemap/natural/core/defineShorthand.d.ts +2 -0
- package/dist/types/threemap/natural/core/helpers/projectOnEllipsoidSurface.d.ts +1 -0
- package/dist/types/threemap/natural/core/math.d.ts +15 -0
- package/dist/types/threemap/natural/core/requestIdleCallback.d.ts +2 -0
- package/dist/types/threemap/natural/core/resolveIncludes.d.ts +1 -0
- package/dist/types/threemap/natural/core/shaders/index.d.ts +10 -0
- package/dist/types/threemap/natural/core/unrollLoops.d.ts +1 -0
- package/dist/types/threemap/natural/effects/DepthEffect.d.ts +15 -0
- package/dist/types/threemap/natural/effects/DitheringEffect.d.ts +6 -0
- package/dist/types/threemap/natural/effects/DownsampleThresholdMaterial.d.ts +14 -0
- package/dist/types/threemap/natural/effects/GeometryEffect.d.ts +11 -0
- package/dist/types/threemap/natural/effects/GeometryPass.d.ts +6 -0
- package/dist/types/threemap/natural/effects/LensFlareEffect.d.ts +31 -0
- package/dist/types/threemap/natural/effects/LensFlareFeaturesMaterial.d.ts +17 -0
- package/dist/types/threemap/natural/effects/NormalEffect.d.ts +16 -0
- package/dist/types/threemap/natural/effects/createHaldLookupTexture.d.ts +1 -0
- package/dist/types/threemap/natural/effects/index.d.ts +7 -0
- package/dist/types/threemap/natural/effects/setupMaterialsForGeometryPass.d.ts +1 -0
- package/dist/types/threemap/natural/sky/AerialPerspectiveEffect.d.ts +95 -0
- package/dist/types/threemap/natural/sky/AtmosphereMaterialBase.d.ts +40 -0
- package/dist/types/threemap/natural/sky/AtmosphereParameters.d.ts +32 -0
- package/dist/types/threemap/natural/sky/AtmospherePostPass.d.ts +10 -0
- package/dist/types/threemap/natural/sky/PrecomputedTexturesGenerator.d.ts +66 -0
- package/dist/types/threemap/natural/sky/SkyMaterial.d.ts +26 -0
- package/dist/types/threemap/natural/sky/constants.d.ts +14 -0
- package/dist/types/threemap/natural/sky/getAltitudeCorrectionOffset.d.ts +1 -0
- package/dist/types/threemap/overlay/Marker.d.ts +3 -0
- package/dist/types/threemap/services/autoComplete/AutoComplete.d.ts +1 -1
- package/dist/types/threemap/services/boundary/Boundary.d.ts +3 -3
- package/dist/types/threemap/services/common/baiduRequest.d.ts +1 -1
- package/dist/types/threemap/services/configs.d.ts +2 -2
- package/dist/types/threemap/services/district/DistrictLayer.d.ts +3 -3
- package/dist/types/threemap/services/geocoder/Geocoder.d.ts +5 -5
- package/dist/types/threemap/services/localSearch/LocalSearch.d.ts +5 -5
- package/dist/types/threemap/services/routeSearch/DrivingRoute.d.ts +2 -2
- package/dist/types/threemap/services/routeSearch/TransitRoute.d.ts +3 -3
- package/dist/types/threemap/video/VideoConfig.d.ts +2 -2
- package/dist/types/util/graphics/line.d.ts +2 -2
- package/dist/types/util/request.d.ts +1 -1
- package/package.json +6 -3
- /package/dist/types/{threejs → threemap/engine/map}/controls/MapControl.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/color.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/background.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill-extrusion.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/line.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/symbol.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/compound_expression.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/assertion.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/at.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/case.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coalesce.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coercion.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/collator.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/comparison.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/format.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/image.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/in.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index_of.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/interpolate.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/length.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/let.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/literal.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/match.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/number_format.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/slice.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/step.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/var.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/within.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/evaluation_context.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/expression.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/is_constant.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_context.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_error.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/scope.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/stops.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/collator.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/formatted.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/resolved_image.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/values.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/feature_filter/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/convert.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sourceLayer.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sprite.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/style.d.ts +0 -0
|
@@ -9,10 +9,10 @@ function clamp$1(t, e, s) {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
12
|
-
* Copyright 2010-
|
|
12
|
+
* Copyright 2010-2025 Three.js Authors
|
|
13
13
|
* SPDX-License-Identifier: MIT
|
|
14
14
|
*/
|
|
15
|
-
const REVISION = "
|
|
15
|
+
const REVISION = "179", WebGLCoordinateSystem = 2e3, WebGPUCoordinateSystem = 2001, _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
16
16
|
let _seed = 1234567;
|
|
17
17
|
const DEG2RAD = Math.PI / 180, RAD2DEG = 180 / Math.PI;
|
|
18
18
|
function generateUUID() {
|
|
@@ -242,14 +242,14 @@ class Vector2 {
|
|
|
242
242
|
return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this;
|
|
243
243
|
}
|
|
244
244
|
clamp(t, e) {
|
|
245
|
-
return this.x =
|
|
245
|
+
return this.x = clamp(this.x, t.x, e.x), this.y = clamp(this.y, t.y, e.y), this;
|
|
246
246
|
}
|
|
247
247
|
clampScalar(t, e) {
|
|
248
|
-
return this.x =
|
|
248
|
+
return this.x = clamp(this.x, t, e), this.y = clamp(this.y, t, e), this;
|
|
249
249
|
}
|
|
250
250
|
clampLength(t, e) {
|
|
251
251
|
const s = this.length();
|
|
252
|
-
return this.divideScalar(s || 1).multiplyScalar(
|
|
252
|
+
return this.divideScalar(s || 1).multiplyScalar(clamp(s, t, e));
|
|
253
253
|
}
|
|
254
254
|
floor() {
|
|
255
255
|
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
|
|
@@ -336,130 +336,219 @@ class Vector2 {
|
|
|
336
336
|
yield this.x, yield this.y;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
class
|
|
340
|
-
constructor(t, e, s
|
|
341
|
-
|
|
339
|
+
class Quaternion$1 {
|
|
340
|
+
constructor(t = 0, e = 0, s = 0, i = 1) {
|
|
341
|
+
this.isQuaternion = true, this._x = t, this._y = e, this._z = s, this._w = i;
|
|
342
342
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
343
|
+
static slerpFlat(t, e, s, i, r, a, n) {
|
|
344
|
+
let o = s[i + 0], h = s[i + 1], c = s[i + 2], l = s[i + 3];
|
|
345
|
+
const u = r[a + 0], d = r[a + 1], _ = r[a + 2], m = r[a + 3];
|
|
346
|
+
if (0 === n)
|
|
347
|
+
return t[e + 0] = o, t[e + 1] = h, t[e + 2] = c, void (t[e + 3] = l);
|
|
348
|
+
if (1 === n)
|
|
349
|
+
return t[e + 0] = u, t[e + 1] = d, t[e + 2] = _, void (t[e + 3] = m);
|
|
350
|
+
if (l !== m || o !== u || h !== d || c !== _) {
|
|
351
|
+
let t2 = 1 - n;
|
|
352
|
+
const e2 = o * u + h * d + c * _ + l * m, s2 = e2 >= 0 ? 1 : -1, i2 = 1 - e2 * e2;
|
|
353
|
+
if (i2 > Number.EPSILON) {
|
|
354
|
+
const r3 = Math.sqrt(i2), a2 = Math.atan2(r3, e2 * s2);
|
|
355
|
+
t2 = Math.sin(t2 * a2) / r3, n = Math.sin(n * a2) / r3;
|
|
356
|
+
}
|
|
357
|
+
const r2 = n * s2;
|
|
358
|
+
if (o = o * t2 + u * r2, h = h * t2 + d * r2, c = c * t2 + _ * r2, l = l * t2 + m * r2, t2 === 1 - n) {
|
|
359
|
+
const t3 = 1 / Math.sqrt(o * o + h * h + c * c + l * l);
|
|
360
|
+
o *= t3, h *= t3, c *= t3, l *= t3;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
t[e] = o, t[e + 1] = h, t[e + 2] = c, t[e + 3] = l;
|
|
346
364
|
}
|
|
347
|
-
|
|
348
|
-
|
|
365
|
+
static multiplyQuaternionsFlat(t, e, s, i, r, a) {
|
|
366
|
+
const n = s[i], o = s[i + 1], h = s[i + 2], c = s[i + 3], l = r[a], u = r[a + 1], d = r[a + 2], _ = r[a + 3];
|
|
367
|
+
return t[e] = n * _ + c * l + o * d - h * u, t[e + 1] = o * _ + c * u + h * l - n * d, t[e + 2] = h * _ + c * d + n * u - o * l, t[e + 3] = c * _ - n * l - o * u - h * d, t;
|
|
368
|
+
}
|
|
369
|
+
get x() {
|
|
370
|
+
return this._x;
|
|
371
|
+
}
|
|
372
|
+
set x(t) {
|
|
373
|
+
this._x = t, this._onChangeCallback();
|
|
374
|
+
}
|
|
375
|
+
get y() {
|
|
376
|
+
return this._y;
|
|
377
|
+
}
|
|
378
|
+
set y(t) {
|
|
379
|
+
this._y = t, this._onChangeCallback();
|
|
380
|
+
}
|
|
381
|
+
get z() {
|
|
382
|
+
return this._z;
|
|
383
|
+
}
|
|
384
|
+
set z(t) {
|
|
385
|
+
this._z = t, this._onChangeCallback();
|
|
386
|
+
}
|
|
387
|
+
get w() {
|
|
388
|
+
return this._w;
|
|
389
|
+
}
|
|
390
|
+
set w(t) {
|
|
391
|
+
this._w = t, this._onChangeCallback();
|
|
392
|
+
}
|
|
393
|
+
set(t, e, s, i) {
|
|
394
|
+
return this._x = t, this._y = e, this._z = s, this._w = i, this._onChangeCallback(), this;
|
|
395
|
+
}
|
|
396
|
+
clone() {
|
|
397
|
+
return new this.constructor(this._x, this._y, this._z, this._w);
|
|
349
398
|
}
|
|
350
399
|
copy(t) {
|
|
351
|
-
|
|
352
|
-
return e[0] = s[0], e[1] = s[1], e[2] = s[2], e[3] = s[3], e[4] = s[4], e[5] = s[5], e[6] = s[6], e[7] = s[7], e[8] = s[8], this;
|
|
400
|
+
return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
|
|
353
401
|
}
|
|
354
|
-
|
|
355
|
-
|
|
402
|
+
setFromEuler(t, e = true) {
|
|
403
|
+
const s = t._x, i = t._y, r = t._z, a = t._order, n = Math.cos, o = Math.sin, h = n(s / 2), c = n(i / 2), l = n(r / 2), u = o(s / 2), d = o(i / 2), _ = o(r / 2);
|
|
404
|
+
switch (a) {
|
|
405
|
+
case "XYZ":
|
|
406
|
+
this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
|
|
407
|
+
break;
|
|
408
|
+
case "YXZ":
|
|
409
|
+
this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
|
|
410
|
+
break;
|
|
411
|
+
case "ZXY":
|
|
412
|
+
this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
|
|
413
|
+
break;
|
|
414
|
+
case "ZYX":
|
|
415
|
+
this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
|
|
416
|
+
break;
|
|
417
|
+
case "YZX":
|
|
418
|
+
this._x = u * c * l + h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l - u * d * _;
|
|
419
|
+
break;
|
|
420
|
+
case "XZY":
|
|
421
|
+
this._x = u * c * l - h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l + u * d * _;
|
|
422
|
+
break;
|
|
423
|
+
default:
|
|
424
|
+
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
|
|
425
|
+
}
|
|
426
|
+
return true === e && this._onChangeCallback(), this;
|
|
356
427
|
}
|
|
357
|
-
|
|
358
|
-
const e =
|
|
359
|
-
return this.
|
|
428
|
+
setFromAxisAngle(t, e) {
|
|
429
|
+
const s = e / 2, i = Math.sin(s);
|
|
430
|
+
return this._x = t.x * i, this._y = t.y * i, this._z = t.z * i, this._w = Math.cos(s), this._onChangeCallback(), this;
|
|
360
431
|
}
|
|
361
|
-
|
|
362
|
-
|
|
432
|
+
setFromRotationMatrix(t) {
|
|
433
|
+
const e = t.elements, s = e[0], i = e[4], r = e[8], a = e[1], n = e[5], o = e[9], h = e[2], c = e[6], l = e[10], u = s + n + l;
|
|
434
|
+
if (u > 0) {
|
|
435
|
+
const t2 = 0.5 / Math.sqrt(u + 1);
|
|
436
|
+
this._w = 0.25 / t2, this._x = (c - o) * t2, this._y = (r - h) * t2, this._z = (a - i) * t2;
|
|
437
|
+
} else if (s > n && s > l) {
|
|
438
|
+
const t2 = 2 * Math.sqrt(1 + s - n - l);
|
|
439
|
+
this._w = (c - o) / t2, this._x = 0.25 * t2, this._y = (i + a) / t2, this._z = (r + h) / t2;
|
|
440
|
+
} else if (n > l) {
|
|
441
|
+
const t2 = 2 * Math.sqrt(1 + n - s - l);
|
|
442
|
+
this._w = (r - h) / t2, this._x = (i + a) / t2, this._y = 0.25 * t2, this._z = (o + c) / t2;
|
|
443
|
+
} else {
|
|
444
|
+
const t2 = 2 * Math.sqrt(1 + l - s - n);
|
|
445
|
+
this._w = (a - i) / t2, this._x = (r + h) / t2, this._y = (o + c) / t2, this._z = 0.25 * t2;
|
|
446
|
+
}
|
|
447
|
+
return this._onChangeCallback(), this;
|
|
363
448
|
}
|
|
364
|
-
|
|
365
|
-
|
|
449
|
+
setFromUnitVectors(t, e) {
|
|
450
|
+
let s = t.dot(e) + 1;
|
|
451
|
+
return s < 1e-8 ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
|
|
366
452
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
return r[0] = a * m + n * y + o * x, r[3] = a * f + n * g + o * w, r[6] = a * p + n * M + o * S, r[1] = h * m + c * y + l * x, r[4] = h * f + c * g + l * w, r[7] = h * p + c * M + l * S, r[2] = u * m + d * y + _ * x, r[5] = u * f + d * g + _ * w, r[8] = u * p + d * M + _ * S, this;
|
|
453
|
+
angleTo(t) {
|
|
454
|
+
return 2 * Math.acos(Math.abs(clamp(this.dot(t), -1, 1)));
|
|
370
455
|
}
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
|
|
456
|
+
rotateTowards(t, e) {
|
|
457
|
+
const s = this.angleTo(t);
|
|
458
|
+
if (0 === s)
|
|
459
|
+
return this;
|
|
460
|
+
const i = Math.min(1, e / s);
|
|
461
|
+
return this.slerp(t, i), this;
|
|
374
462
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return e * a * c - e * n * h - s * r * c + s * n * o + i * r * h - i * a * o;
|
|
463
|
+
identity() {
|
|
464
|
+
return this.set(0, 0, 0, 1);
|
|
378
465
|
}
|
|
379
466
|
invert() {
|
|
380
|
-
|
|
381
|
-
if (0 === _)
|
|
382
|
-
return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
383
|
-
const m = 1 / _;
|
|
384
|
-
return t[0] = l * m, t[1] = (i * h - c * s) * m, t[2] = (n * s - i * a) * m, t[3] = u * m, t[4] = (c * e - i * o) * m, t[5] = (i * r - n * e) * m, t[6] = d * m, t[7] = (s * o - h * e) * m, t[8] = (a * e - s * r) * m, this;
|
|
467
|
+
return this.conjugate();
|
|
385
468
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
const e = this.elements;
|
|
389
|
-
return t = e[1], e[1] = e[3], e[3] = t, t = e[2], e[2] = e[6], e[6] = t, t = e[5], e[5] = e[7], e[7] = t, this;
|
|
469
|
+
conjugate() {
|
|
470
|
+
return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
|
|
390
471
|
}
|
|
391
|
-
|
|
392
|
-
return this.
|
|
472
|
+
dot(t) {
|
|
473
|
+
return this._x * t._x + this._y * t._y + this._z * t._z + this._w * t._w;
|
|
393
474
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return t[0] = e[0], t[1] = e[3], t[2] = e[6], t[3] = e[1], t[4] = e[4], t[5] = e[7], t[6] = e[2], t[7] = e[5], t[8] = e[8], this;
|
|
475
|
+
lengthSq() {
|
|
476
|
+
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
|
|
397
477
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return this.set(s * o, s * h, -s * (o * a + h * n) + a + t, -i * h, i * o, -i * (-h * a + o * n) + n + e, 0, 0, 1), this;
|
|
478
|
+
length() {
|
|
479
|
+
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
|
|
401
480
|
}
|
|
402
|
-
|
|
403
|
-
|
|
481
|
+
normalize() {
|
|
482
|
+
let t = this.length();
|
|
483
|
+
return 0 === t ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t = 1 / t, this._x = this._x * t, this._y = this._y * t, this._z = this._z * t, this._w = this._w * t), this._onChangeCallback(), this;
|
|
404
484
|
}
|
|
405
|
-
|
|
406
|
-
return this.
|
|
485
|
+
multiply(t) {
|
|
486
|
+
return this.multiplyQuaternions(this, t);
|
|
407
487
|
}
|
|
408
|
-
|
|
409
|
-
return this.
|
|
488
|
+
premultiply(t) {
|
|
489
|
+
return this.multiplyQuaternions(t, this);
|
|
410
490
|
}
|
|
411
|
-
|
|
412
|
-
|
|
491
|
+
multiplyQuaternions(t, e) {
|
|
492
|
+
const s = t._x, i = t._y, r = t._z, a = t._w, n = e._x, o = e._y, h = e._z, c = e._w;
|
|
493
|
+
return this._x = s * c + a * n + i * h - r * o, this._y = i * c + a * o + r * n - s * h, this._z = r * c + a * h + s * o - i * n, this._w = a * c - s * n - i * o - r * h, this._onChangeCallback(), this;
|
|
413
494
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
495
|
+
slerp(t, e) {
|
|
496
|
+
if (0 === e)
|
|
497
|
+
return this;
|
|
498
|
+
if (1 === e)
|
|
499
|
+
return this.copy(t);
|
|
500
|
+
const s = this._x, i = this._y, r = this._z, a = this._w;
|
|
501
|
+
let n = a * t._w + s * t._x + i * t._y + r * t._z;
|
|
502
|
+
if (n < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, n = -n) : this.copy(t), n >= 1)
|
|
503
|
+
return this._w = a, this._x = s, this._y = i, this._z = r, this;
|
|
504
|
+
const o = 1 - n * n;
|
|
505
|
+
if (o <= Number.EPSILON) {
|
|
506
|
+
const t2 = 1 - e;
|
|
507
|
+
return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this;
|
|
508
|
+
}
|
|
509
|
+
const h = Math.sqrt(o), c = Math.atan2(h, n), l = Math.sin((1 - e) * c) / h, u = Math.sin(e * c) / h;
|
|
510
|
+
return this._w = a * l + this._w * u, this._x = s * l + this._x * u, this._y = i * l + this._y * u, this._z = r * l + this._z * u, this._onChangeCallback(), this;
|
|
417
511
|
}
|
|
418
|
-
|
|
419
|
-
return this.
|
|
512
|
+
slerpQuaternions(t, e, s) {
|
|
513
|
+
return this.copy(t).slerp(e, s);
|
|
514
|
+
}
|
|
515
|
+
random() {
|
|
516
|
+
const t = 2 * Math.PI * Math.random(), e = 2 * Math.PI * Math.random(), s = Math.random(), i = Math.sqrt(1 - s), r = Math.sqrt(s);
|
|
517
|
+
return this.set(i * Math.sin(t), i * Math.cos(t), r * Math.sin(e), r * Math.cos(e));
|
|
420
518
|
}
|
|
421
519
|
equals(t) {
|
|
422
|
-
|
|
423
|
-
for (let t2 = 0; t2 < 9; t2++)
|
|
424
|
-
if (e[t2] !== s[t2])
|
|
425
|
-
return false;
|
|
426
|
-
return true;
|
|
520
|
+
return t._x === this._x && t._y === this._y && t._z === this._z && t._w === this._w;
|
|
427
521
|
}
|
|
428
522
|
fromArray(t, e = 0) {
|
|
429
|
-
|
|
430
|
-
this.elements[s] = t[s + e];
|
|
431
|
-
return this;
|
|
523
|
+
return this._x = t[e], this._y = t[e + 1], this._z = t[e + 2], this._w = t[e + 3], this._onChangeCallback(), this;
|
|
432
524
|
}
|
|
433
525
|
toArray(t = [], e = 0) {
|
|
434
|
-
|
|
435
|
-
return t[e] = s[0], t[e + 1] = s[1], t[e + 2] = s[2], t[e + 3] = s[3], t[e + 4] = s[4], t[e + 5] = s[5], t[e + 6] = s[6], t[e + 7] = s[7], t[e + 8] = s[8], t;
|
|
526
|
+
return t[e] = this._x, t[e + 1] = this._y, t[e + 2] = this._z, t[e + 3] = this._w, t;
|
|
436
527
|
}
|
|
437
|
-
|
|
438
|
-
return
|
|
528
|
+
fromBufferAttribute(t, e) {
|
|
529
|
+
return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this._onChangeCallback(), this;
|
|
439
530
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
class Vector4 {
|
|
443
|
-
constructor(t = 0, e = 0, s = 0, i = 1) {
|
|
444
|
-
Vector4.prototype.isVector4 = true, this.x = t, this.y = e, this.z = s, this.w = i;
|
|
531
|
+
toJSON() {
|
|
532
|
+
return this.toArray();
|
|
445
533
|
}
|
|
446
|
-
|
|
447
|
-
return this.
|
|
534
|
+
_onChange(t) {
|
|
535
|
+
return this._onChangeCallback = t, this;
|
|
448
536
|
}
|
|
449
|
-
|
|
450
|
-
this.z = t;
|
|
537
|
+
_onChangeCallback() {
|
|
451
538
|
}
|
|
452
|
-
|
|
453
|
-
|
|
539
|
+
*[Symbol.iterator]() {
|
|
540
|
+
yield this._x, yield this._y, yield this._z, yield this._w;
|
|
454
541
|
}
|
|
455
|
-
|
|
456
|
-
|
|
542
|
+
}
|
|
543
|
+
class Vector3$1 {
|
|
544
|
+
constructor(t = 0, e = 0, s = 0) {
|
|
545
|
+
Vector3$1.prototype.isVector3 = true, this.x = t, this.y = e, this.z = s;
|
|
457
546
|
}
|
|
458
|
-
set(t, e, s
|
|
459
|
-
return this.x = t, this.y = e, this.z = s, this
|
|
547
|
+
set(t, e, s) {
|
|
548
|
+
return void 0 === s && (s = this.z), this.x = t, this.y = e, this.z = s, this;
|
|
460
549
|
}
|
|
461
550
|
setScalar(t) {
|
|
462
|
-
return this.x = t, this.y = t, this.z = t, this
|
|
551
|
+
return this.x = t, this.y = t, this.z = t, this;
|
|
463
552
|
}
|
|
464
553
|
setX(t) {
|
|
465
554
|
return this.x = t, this;
|
|
@@ -470,9 +559,6 @@ class Vector4 {
|
|
|
470
559
|
setZ(t) {
|
|
471
560
|
return this.z = t, this;
|
|
472
561
|
}
|
|
473
|
-
setW(t) {
|
|
474
|
-
return this.w = t, this;
|
|
475
|
-
}
|
|
476
562
|
setComponent(t, e) {
|
|
477
563
|
switch (t) {
|
|
478
564
|
case 0:
|
|
@@ -484,9 +570,6 @@ class Vector4 {
|
|
|
484
570
|
case 2:
|
|
485
571
|
this.z = e;
|
|
486
572
|
break;
|
|
487
|
-
case 3:
|
|
488
|
-
this.w = e;
|
|
489
|
-
break;
|
|
490
573
|
default:
|
|
491
574
|
throw new Error("index is out of range: " + t);
|
|
492
575
|
}
|
|
@@ -500,112 +583,125 @@ class Vector4 {
|
|
|
500
583
|
return this.y;
|
|
501
584
|
case 2:
|
|
502
585
|
return this.z;
|
|
503
|
-
case 3:
|
|
504
|
-
return this.w;
|
|
505
586
|
default:
|
|
506
587
|
throw new Error("index is out of range: " + t);
|
|
507
588
|
}
|
|
508
589
|
}
|
|
509
590
|
clone() {
|
|
510
|
-
return new this.constructor(this.x, this.y, this.z
|
|
591
|
+
return new this.constructor(this.x, this.y, this.z);
|
|
511
592
|
}
|
|
512
593
|
copy(t) {
|
|
513
|
-
return this.x = t.x, this.y = t.y, this.z = t.z, this
|
|
594
|
+
return this.x = t.x, this.y = t.y, this.z = t.z, this;
|
|
514
595
|
}
|
|
515
596
|
add(t) {
|
|
516
|
-
return this.x += t.x, this.y += t.y, this.z += t.z, this
|
|
597
|
+
return this.x += t.x, this.y += t.y, this.z += t.z, this;
|
|
517
598
|
}
|
|
518
599
|
addScalar(t) {
|
|
519
|
-
return this.x += t, this.y += t, this.z += t, this
|
|
600
|
+
return this.x += t, this.y += t, this.z += t, this;
|
|
520
601
|
}
|
|
521
602
|
addVectors(t, e) {
|
|
522
|
-
return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this
|
|
603
|
+
return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this;
|
|
523
604
|
}
|
|
524
605
|
addScaledVector(t, e) {
|
|
525
|
-
return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this
|
|
606
|
+
return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this;
|
|
526
607
|
}
|
|
527
608
|
sub(t) {
|
|
528
|
-
return this.x -= t.x, this.y -= t.y, this.z -= t.z, this
|
|
609
|
+
return this.x -= t.x, this.y -= t.y, this.z -= t.z, this;
|
|
529
610
|
}
|
|
530
611
|
subScalar(t) {
|
|
531
|
-
return this.x -= t, this.y -= t, this.z -= t, this
|
|
612
|
+
return this.x -= t, this.y -= t, this.z -= t, this;
|
|
532
613
|
}
|
|
533
614
|
subVectors(t, e) {
|
|
534
|
-
return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this
|
|
615
|
+
return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this;
|
|
535
616
|
}
|
|
536
617
|
multiply(t) {
|
|
537
|
-
return this.x *= t.x, this.y *= t.y, this.z *= t.z, this
|
|
618
|
+
return this.x *= t.x, this.y *= t.y, this.z *= t.z, this;
|
|
538
619
|
}
|
|
539
620
|
multiplyScalar(t) {
|
|
540
|
-
return this.x *= t, this.y *= t, this.z *= t, this
|
|
621
|
+
return this.x *= t, this.y *= t, this.z *= t, this;
|
|
622
|
+
}
|
|
623
|
+
multiplyVectors(t, e) {
|
|
624
|
+
return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
|
|
625
|
+
}
|
|
626
|
+
applyEuler(t) {
|
|
627
|
+
return this.applyQuaternion(_quaternion$4.setFromEuler(t));
|
|
628
|
+
}
|
|
629
|
+
applyAxisAngle(t, e) {
|
|
630
|
+
return this.applyQuaternion(_quaternion$4.setFromAxisAngle(t, e));
|
|
631
|
+
}
|
|
632
|
+
applyMatrix3(t) {
|
|
633
|
+
const e = this.x, s = this.y, i = this.z, r = t.elements;
|
|
634
|
+
return this.x = r[0] * e + r[3] * s + r[6] * i, this.y = r[1] * e + r[4] * s + r[7] * i, this.z = r[2] * e + r[5] * s + r[8] * i, this;
|
|
635
|
+
}
|
|
636
|
+
applyNormalMatrix(t) {
|
|
637
|
+
return this.applyMatrix3(t).normalize();
|
|
541
638
|
}
|
|
542
639
|
applyMatrix4(t) {
|
|
543
|
-
const e = this.x, s = this.y, i = this.z, r =
|
|
544
|
-
return this.x =
|
|
640
|
+
const e = this.x, s = this.y, i = this.z, r = t.elements, a = 1 / (r[3] * e + r[7] * s + r[11] * i + r[15]);
|
|
641
|
+
return this.x = (r[0] * e + r[4] * s + r[8] * i + r[12]) * a, this.y = (r[1] * e + r[5] * s + r[9] * i + r[13]) * a, this.z = (r[2] * e + r[6] * s + r[10] * i + r[14]) * a, this;
|
|
545
642
|
}
|
|
546
|
-
|
|
547
|
-
|
|
643
|
+
applyQuaternion(t) {
|
|
644
|
+
const e = this.x, s = this.y, i = this.z, r = t.x, a = t.y, n = t.z, o = t.w, h = 2 * (a * i - n * s), c = 2 * (n * e - r * i), l = 2 * (r * s - a * e);
|
|
645
|
+
return this.x = e + o * h + a * l - n * c, this.y = s + o * c + n * h - r * l, this.z = i + o * l + r * c - a * h, this;
|
|
548
646
|
}
|
|
549
|
-
|
|
550
|
-
this.
|
|
551
|
-
const e = Math.sqrt(1 - t.w * t.w);
|
|
552
|
-
return e < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t.x / e, this.y = t.y / e, this.z = t.z / e), this;
|
|
647
|
+
project(t) {
|
|
648
|
+
return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
|
|
553
649
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
return
|
|
650
|
+
unproject(t) {
|
|
651
|
+
return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld);
|
|
652
|
+
}
|
|
653
|
+
transformDirection(t) {
|
|
654
|
+
const e = this.x, s = this.y, i = this.z, r = t.elements;
|
|
655
|
+
return this.x = r[0] * e + r[4] * s + r[8] * i, this.y = r[1] * e + r[5] * s + r[9] * i, this.z = r[2] * e + r[6] * s + r[10] * i, this.normalize();
|
|
656
|
+
}
|
|
657
|
+
divide(t) {
|
|
658
|
+
return this.x /= t.x, this.y /= t.y, this.z /= t.z, this;
|
|
659
|
+
}
|
|
660
|
+
divideScalar(t) {
|
|
661
|
+
return this.multiplyScalar(1 / t);
|
|
566
662
|
}
|
|
567
663
|
min(t) {
|
|
568
|
-
return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this
|
|
664
|
+
return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this;
|
|
569
665
|
}
|
|
570
666
|
max(t) {
|
|
571
|
-
return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this
|
|
667
|
+
return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this;
|
|
572
668
|
}
|
|
573
669
|
clamp(t, e) {
|
|
574
|
-
return this.x =
|
|
670
|
+
return this.x = clamp(this.x, t.x, e.x), this.y = clamp(this.y, t.y, e.y), this.z = clamp(this.z, t.z, e.z), this;
|
|
575
671
|
}
|
|
576
672
|
clampScalar(t, e) {
|
|
577
|
-
return this.x =
|
|
673
|
+
return this.x = clamp(this.x, t, e), this.y = clamp(this.y, t, e), this.z = clamp(this.z, t, e), this;
|
|
578
674
|
}
|
|
579
675
|
clampLength(t, e) {
|
|
580
676
|
const s = this.length();
|
|
581
|
-
return this.divideScalar(s || 1).multiplyScalar(
|
|
677
|
+
return this.divideScalar(s || 1).multiplyScalar(clamp(s, t, e));
|
|
582
678
|
}
|
|
583
679
|
floor() {
|
|
584
|
-
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this
|
|
680
|
+
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
|
|
585
681
|
}
|
|
586
682
|
ceil() {
|
|
587
|
-
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this
|
|
683
|
+
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
|
|
588
684
|
}
|
|
589
685
|
round() {
|
|
590
|
-
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this
|
|
686
|
+
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
|
|
591
687
|
}
|
|
592
688
|
roundToZero() {
|
|
593
|
-
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this
|
|
689
|
+
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
|
|
594
690
|
}
|
|
595
691
|
negate() {
|
|
596
|
-
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
|
|
692
|
+
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
|
|
597
693
|
}
|
|
598
694
|
dot(t) {
|
|
599
|
-
return this.x * t.x + this.y * t.y + this.z * t.z
|
|
695
|
+
return this.x * t.x + this.y * t.y + this.z * t.z;
|
|
600
696
|
}
|
|
601
697
|
lengthSq() {
|
|
602
|
-
return this.x * this.x + this.y * this.y + this.z * this.z
|
|
698
|
+
return this.x * this.x + this.y * this.y + this.z * this.z;
|
|
603
699
|
}
|
|
604
700
|
length() {
|
|
605
|
-
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z
|
|
701
|
+
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
606
702
|
}
|
|
607
703
|
manhattanLength() {
|
|
608
|
-
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
|
|
704
|
+
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
|
|
609
705
|
}
|
|
610
706
|
normalize() {
|
|
611
707
|
return this.divideScalar(this.length() || 1);
|
|
@@ -614,243 +710,229 @@ class Vector4 {
|
|
|
614
710
|
return this.normalize().multiplyScalar(t);
|
|
615
711
|
}
|
|
616
712
|
lerp(t, e) {
|
|
617
|
-
return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this
|
|
713
|
+
return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this;
|
|
618
714
|
}
|
|
619
715
|
lerpVectors(t, e, s) {
|
|
620
|
-
return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this
|
|
621
|
-
}
|
|
622
|
-
equals(t) {
|
|
623
|
-
return t.x === this.x && t.y === this.y && t.z === this.z && t.w === this.w;
|
|
716
|
+
return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this;
|
|
624
717
|
}
|
|
625
|
-
|
|
626
|
-
return this.
|
|
718
|
+
cross(t) {
|
|
719
|
+
return this.crossVectors(this, t);
|
|
627
720
|
}
|
|
628
|
-
|
|
629
|
-
|
|
721
|
+
crossVectors(t, e) {
|
|
722
|
+
const s = t.x, i = t.y, r = t.z, a = e.x, n = e.y, o = e.z;
|
|
723
|
+
return this.x = i * o - r * n, this.y = r * a - s * o, this.z = s * n - i * a, this;
|
|
630
724
|
}
|
|
631
|
-
|
|
632
|
-
|
|
725
|
+
projectOnVector(t) {
|
|
726
|
+
const e = t.lengthSq();
|
|
727
|
+
if (0 === e)
|
|
728
|
+
return this.set(0, 0, 0);
|
|
729
|
+
const s = t.dot(this) / e;
|
|
730
|
+
return this.copy(t).multiplyScalar(s);
|
|
633
731
|
}
|
|
634
|
-
|
|
635
|
-
return
|
|
732
|
+
projectOnPlane(t) {
|
|
733
|
+
return _vector$c.copy(this).projectOnVector(t), this.sub(_vector$c);
|
|
636
734
|
}
|
|
637
|
-
|
|
638
|
-
|
|
735
|
+
reflect(t) {
|
|
736
|
+
return this.sub(_vector$c.copy(t).multiplyScalar(2 * this.dot(t)));
|
|
639
737
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
738
|
+
angleTo(t) {
|
|
739
|
+
const e = Math.sqrt(this.lengthSq() * t.lengthSq());
|
|
740
|
+
if (0 === e)
|
|
741
|
+
return Math.PI / 2;
|
|
742
|
+
const s = this.dot(t) / e;
|
|
743
|
+
return Math.acos(clamp(s, -1, 1));
|
|
644
744
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
const u = r[a + 0], d = r[a + 1], _ = r[a + 2], m = r[a + 3];
|
|
648
|
-
if (0 === n)
|
|
649
|
-
return t[e + 0] = o, t[e + 1] = h, t[e + 2] = c, void (t[e + 3] = l);
|
|
650
|
-
if (1 === n)
|
|
651
|
-
return t[e + 0] = u, t[e + 1] = d, t[e + 2] = _, void (t[e + 3] = m);
|
|
652
|
-
if (l !== m || o !== u || h !== d || c !== _) {
|
|
653
|
-
let t2 = 1 - n;
|
|
654
|
-
const e2 = o * u + h * d + c * _ + l * m, s2 = e2 >= 0 ? 1 : -1, i2 = 1 - e2 * e2;
|
|
655
|
-
if (i2 > Number.EPSILON) {
|
|
656
|
-
const r3 = Math.sqrt(i2), a2 = Math.atan2(r3, e2 * s2);
|
|
657
|
-
t2 = Math.sin(t2 * a2) / r3, n = Math.sin(n * a2) / r3;
|
|
658
|
-
}
|
|
659
|
-
const r2 = n * s2;
|
|
660
|
-
if (o = o * t2 + u * r2, h = h * t2 + d * r2, c = c * t2 + _ * r2, l = l * t2 + m * r2, t2 === 1 - n) {
|
|
661
|
-
const t3 = 1 / Math.sqrt(o * o + h * h + c * c + l * l);
|
|
662
|
-
o *= t3, h *= t3, c *= t3, l *= t3;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
t[e] = o, t[e + 1] = h, t[e + 2] = c, t[e + 3] = l;
|
|
745
|
+
distanceTo(t) {
|
|
746
|
+
return Math.sqrt(this.distanceToSquared(t));
|
|
666
747
|
}
|
|
667
|
-
|
|
668
|
-
const
|
|
669
|
-
return
|
|
748
|
+
distanceToSquared(t) {
|
|
749
|
+
const e = this.x - t.x, s = this.y - t.y, i = this.z - t.z;
|
|
750
|
+
return e * e + s * s + i * i;
|
|
670
751
|
}
|
|
671
|
-
|
|
672
|
-
return this.
|
|
752
|
+
manhattanDistanceTo(t) {
|
|
753
|
+
return Math.abs(this.x - t.x) + Math.abs(this.y - t.y) + Math.abs(this.z - t.z);
|
|
673
754
|
}
|
|
674
|
-
|
|
675
|
-
this.
|
|
755
|
+
setFromSpherical(t) {
|
|
756
|
+
return this.setFromSphericalCoords(t.radius, t.phi, t.theta);
|
|
676
757
|
}
|
|
677
|
-
|
|
678
|
-
|
|
758
|
+
setFromSphericalCoords(t, e, s) {
|
|
759
|
+
const i = Math.sin(e) * t;
|
|
760
|
+
return this.x = i * Math.sin(s), this.y = Math.cos(e) * t, this.z = i * Math.cos(s), this;
|
|
679
761
|
}
|
|
680
|
-
|
|
681
|
-
this.
|
|
762
|
+
setFromCylindrical(t) {
|
|
763
|
+
return this.setFromCylindricalCoords(t.radius, t.theta, t.y);
|
|
682
764
|
}
|
|
683
|
-
|
|
684
|
-
return this.
|
|
765
|
+
setFromCylindricalCoords(t, e, s) {
|
|
766
|
+
return this.x = t * Math.sin(e), this.y = s, this.z = t * Math.cos(e), this;
|
|
685
767
|
}
|
|
686
|
-
|
|
687
|
-
|
|
768
|
+
setFromMatrixPosition(t) {
|
|
769
|
+
const e = t.elements;
|
|
770
|
+
return this.x = e[12], this.y = e[13], this.z = e[14], this;
|
|
688
771
|
}
|
|
689
|
-
|
|
690
|
-
|
|
772
|
+
setFromMatrixScale(t) {
|
|
773
|
+
const e = this.setFromMatrixColumn(t, 0).length(), s = this.setFromMatrixColumn(t, 1).length(), i = this.setFromMatrixColumn(t, 2).length();
|
|
774
|
+
return this.x = e, this.y = s, this.z = i, this;
|
|
691
775
|
}
|
|
692
|
-
|
|
693
|
-
this.
|
|
776
|
+
setFromMatrixColumn(t, e) {
|
|
777
|
+
return this.fromArray(t.elements, 4 * e);
|
|
694
778
|
}
|
|
695
|
-
|
|
696
|
-
return this.
|
|
779
|
+
setFromMatrix3Column(t, e) {
|
|
780
|
+
return this.fromArray(t.elements, 3 * e);
|
|
697
781
|
}
|
|
698
|
-
|
|
699
|
-
return
|
|
782
|
+
setFromEuler(t) {
|
|
783
|
+
return this.x = t._x, this.y = t._y, this.z = t._z, this;
|
|
700
784
|
}
|
|
701
|
-
|
|
702
|
-
return this.
|
|
785
|
+
setFromColor(t) {
|
|
786
|
+
return this.x = t.r, this.y = t.g, this.z = t.b, this;
|
|
703
787
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
switch (a) {
|
|
707
|
-
case "XYZ":
|
|
708
|
-
this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
|
|
709
|
-
break;
|
|
710
|
-
case "YXZ":
|
|
711
|
-
this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
|
|
712
|
-
break;
|
|
713
|
-
case "ZXY":
|
|
714
|
-
this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
|
|
715
|
-
break;
|
|
716
|
-
case "ZYX":
|
|
717
|
-
this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
|
|
718
|
-
break;
|
|
719
|
-
case "YZX":
|
|
720
|
-
this._x = u * c * l + h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l - u * d * _;
|
|
721
|
-
break;
|
|
722
|
-
case "XZY":
|
|
723
|
-
this._x = u * c * l - h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l + u * d * _;
|
|
724
|
-
break;
|
|
725
|
-
default:
|
|
726
|
-
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
|
|
727
|
-
}
|
|
728
|
-
return false !== e && this._onChangeCallback(), this;
|
|
788
|
+
equals(t) {
|
|
789
|
+
return t.x === this.x && t.y === this.y && t.z === this.z;
|
|
729
790
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
return this._x = t.x * i, this._y = t.y * i, this._z = t.z * i, this._w = Math.cos(s), this._onChangeCallback(), this;
|
|
791
|
+
fromArray(t, e = 0) {
|
|
792
|
+
return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this;
|
|
733
793
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
if (u > 0) {
|
|
737
|
-
const t2 = 0.5 / Math.sqrt(u + 1);
|
|
738
|
-
this._w = 0.25 / t2, this._x = (c - o) * t2, this._y = (r - h) * t2, this._z = (a - i) * t2;
|
|
739
|
-
} else if (s > n && s > l) {
|
|
740
|
-
const t2 = 2 * Math.sqrt(1 + s - n - l);
|
|
741
|
-
this._w = (c - o) / t2, this._x = 0.25 * t2, this._y = (i + a) / t2, this._z = (r + h) / t2;
|
|
742
|
-
} else if (n > l) {
|
|
743
|
-
const t2 = 2 * Math.sqrt(1 + n - s - l);
|
|
744
|
-
this._w = (r - h) / t2, this._x = (i + a) / t2, this._y = 0.25 * t2, this._z = (o + c) / t2;
|
|
745
|
-
} else {
|
|
746
|
-
const t2 = 2 * Math.sqrt(1 + l - s - n);
|
|
747
|
-
this._w = (a - i) / t2, this._x = (r + h) / t2, this._y = (o + c) / t2, this._z = 0.25 * t2;
|
|
748
|
-
}
|
|
749
|
-
return this._onChangeCallback(), this;
|
|
794
|
+
toArray(t = [], e = 0) {
|
|
795
|
+
return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t;
|
|
750
796
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
return s < Number.EPSILON ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
|
|
797
|
+
fromBufferAttribute(t, e) {
|
|
798
|
+
return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this;
|
|
754
799
|
}
|
|
755
|
-
|
|
756
|
-
return
|
|
800
|
+
random() {
|
|
801
|
+
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
|
|
757
802
|
}
|
|
758
|
-
|
|
759
|
-
const s =
|
|
760
|
-
|
|
761
|
-
return this;
|
|
762
|
-
const i = Math.min(1, e / s);
|
|
763
|
-
return this.slerp(t, i), this;
|
|
803
|
+
randomDirection() {
|
|
804
|
+
const t = Math.random() * Math.PI * 2, e = 2 * Math.random() - 1, s = Math.sqrt(1 - e * e);
|
|
805
|
+
return this.x = s * Math.cos(t), this.y = e, this.z = s * Math.sin(t), this;
|
|
764
806
|
}
|
|
765
|
-
|
|
766
|
-
|
|
807
|
+
*[Symbol.iterator]() {
|
|
808
|
+
yield this.x, yield this.y, yield this.z;
|
|
767
809
|
}
|
|
768
|
-
|
|
769
|
-
|
|
810
|
+
}
|
|
811
|
+
const _vector$c = new Vector3$1(), _quaternion$4 = new Quaternion$1();
|
|
812
|
+
class Matrix3 {
|
|
813
|
+
constructor(t, e, s, i, r, a, n, o, h) {
|
|
814
|
+
Matrix3.prototype.isMatrix3 = true, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h);
|
|
770
815
|
}
|
|
771
|
-
|
|
772
|
-
|
|
816
|
+
set(t, e, s, i, r, a, n, o, h) {
|
|
817
|
+
const c = this.elements;
|
|
818
|
+
return c[0] = t, c[1] = i, c[2] = n, c[3] = e, c[4] = r, c[5] = o, c[6] = s, c[7] = a, c[8] = h, this;
|
|
773
819
|
}
|
|
774
|
-
|
|
775
|
-
return this.
|
|
820
|
+
identity() {
|
|
821
|
+
return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
|
|
776
822
|
}
|
|
777
|
-
|
|
778
|
-
|
|
823
|
+
copy(t) {
|
|
824
|
+
const e = this.elements, s = t.elements;
|
|
825
|
+
return e[0] = s[0], e[1] = s[1], e[2] = s[2], e[3] = s[3], e[4] = s[4], e[5] = s[5], e[6] = s[6], e[7] = s[7], e[8] = s[8], this;
|
|
779
826
|
}
|
|
780
|
-
|
|
781
|
-
return
|
|
827
|
+
extractBasis(t, e, s) {
|
|
828
|
+
return t.setFromMatrix3Column(this, 0), e.setFromMatrix3Column(this, 1), s.setFromMatrix3Column(this, 2), this;
|
|
782
829
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
return
|
|
830
|
+
setFromMatrix4(t) {
|
|
831
|
+
const e = t.elements;
|
|
832
|
+
return this.set(e[0], e[4], e[8], e[1], e[5], e[9], e[2], e[6], e[10]), this;
|
|
786
833
|
}
|
|
787
834
|
multiply(t) {
|
|
788
|
-
return this.
|
|
835
|
+
return this.multiplyMatrices(this, t);
|
|
789
836
|
}
|
|
790
837
|
premultiply(t) {
|
|
791
|
-
return this.
|
|
838
|
+
return this.multiplyMatrices(t, this);
|
|
792
839
|
}
|
|
793
|
-
|
|
794
|
-
const s = t.
|
|
795
|
-
return
|
|
840
|
+
multiplyMatrices(t, e) {
|
|
841
|
+
const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[3], o = s[6], h = s[1], c = s[4], l = s[7], u = s[2], d = s[5], _ = s[8], m = i[0], p = i[3], f = i[6], y = i[1], g = i[4], M = i[7], x = i[2], w = i[5], S = i[8];
|
|
842
|
+
return r[0] = a * m + n * y + o * x, r[3] = a * p + n * g + o * w, r[6] = a * f + n * M + o * S, r[1] = h * m + c * y + l * x, r[4] = h * p + c * g + l * w, r[7] = h * f + c * M + l * S, r[2] = u * m + d * y + _ * x, r[5] = u * p + d * g + _ * w, r[8] = u * f + d * M + _ * S, this;
|
|
796
843
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
if (1 === e)
|
|
801
|
-
return this.copy(t);
|
|
802
|
-
const s = this._x, i = this._y, r = this._z, a = this._w;
|
|
803
|
-
let n = a * t._w + s * t._x + i * t._y + r * t._z;
|
|
804
|
-
if (n < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, n = -n) : this.copy(t), n >= 1)
|
|
805
|
-
return this._w = a, this._x = s, this._y = i, this._z = r, this;
|
|
806
|
-
const o = 1 - n * n;
|
|
807
|
-
if (o <= Number.EPSILON) {
|
|
808
|
-
const t2 = 1 - e;
|
|
809
|
-
return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this._onChangeCallback(), this;
|
|
810
|
-
}
|
|
811
|
-
const h = Math.sqrt(o), c = Math.atan2(h, n), l = Math.sin((1 - e) * c) / h, u = Math.sin(e * c) / h;
|
|
812
|
-
return this._w = a * l + this._w * u, this._x = s * l + this._x * u, this._y = i * l + this._y * u, this._z = r * l + this._z * u, this._onChangeCallback(), this;
|
|
844
|
+
multiplyScalar(t) {
|
|
845
|
+
const e = this.elements;
|
|
846
|
+
return e[0] *= t, e[3] *= t, e[6] *= t, e[1] *= t, e[4] *= t, e[7] *= t, e[2] *= t, e[5] *= t, e[8] *= t, this;
|
|
813
847
|
}
|
|
814
|
-
|
|
815
|
-
|
|
848
|
+
determinant() {
|
|
849
|
+
const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8];
|
|
850
|
+
return e * a * c - e * n * h - s * r * c + s * n * o + i * r * h - i * a * o;
|
|
851
|
+
}
|
|
852
|
+
invert() {
|
|
853
|
+
const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = c * a - n * h, u = n * o - c * r, d = h * r - a * o, _ = e * l + s * u + i * d;
|
|
854
|
+
if (0 === _)
|
|
855
|
+
return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
856
|
+
const m = 1 / _;
|
|
857
|
+
return t[0] = l * m, t[1] = (i * h - c * s) * m, t[2] = (n * s - i * a) * m, t[3] = u * m, t[4] = (c * e - i * o) * m, t[5] = (i * r - n * e) * m, t[6] = d * m, t[7] = (s * o - h * e) * m, t[8] = (a * e - s * r) * m, this;
|
|
858
|
+
}
|
|
859
|
+
transpose() {
|
|
860
|
+
let t;
|
|
861
|
+
const e = this.elements;
|
|
862
|
+
return t = e[1], e[1] = e[3], e[3] = t, t = e[2], e[2] = e[6], e[6] = t, t = e[5], e[5] = e[7], e[7] = t, this;
|
|
863
|
+
}
|
|
864
|
+
getNormalMatrix(t) {
|
|
865
|
+
return this.setFromMatrix4(t).invert().transpose();
|
|
866
|
+
}
|
|
867
|
+
transposeIntoArray(t) {
|
|
868
|
+
const e = this.elements;
|
|
869
|
+
return t[0] = e[0], t[1] = e[3], t[2] = e[6], t[3] = e[1], t[4] = e[4], t[5] = e[7], t[6] = e[2], t[7] = e[5], t[8] = e[8], this;
|
|
870
|
+
}
|
|
871
|
+
setUvTransform(t, e, s, i, r, a, n) {
|
|
872
|
+
const o = Math.cos(r), h = Math.sin(r);
|
|
873
|
+
return this.set(s * o, s * h, -s * (o * a + h * n) + a + t, -i * h, i * o, -i * (-h * a + o * n) + n + e, 0, 0, 1), this;
|
|
874
|
+
}
|
|
875
|
+
scale(t, e) {
|
|
876
|
+
return this.premultiply(_m3.makeScale(t, e)), this;
|
|
877
|
+
}
|
|
878
|
+
rotate(t) {
|
|
879
|
+
return this.premultiply(_m3.makeRotation(-t)), this;
|
|
880
|
+
}
|
|
881
|
+
translate(t, e) {
|
|
882
|
+
return this.premultiply(_m3.makeTranslation(t, e)), this;
|
|
883
|
+
}
|
|
884
|
+
makeTranslation(t, e) {
|
|
885
|
+
return t.isVector2 ? this.set(1, 0, t.x, 0, 1, t.y, 0, 0, 1) : this.set(1, 0, t, 0, 1, e, 0, 0, 1), this;
|
|
816
886
|
}
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
return this.set(e
|
|
887
|
+
makeRotation(t) {
|
|
888
|
+
const e = Math.cos(t), s = Math.sin(t);
|
|
889
|
+
return this.set(e, -s, 0, s, e, 0, 0, 0, 1), this;
|
|
890
|
+
}
|
|
891
|
+
makeScale(t, e) {
|
|
892
|
+
return this.set(t, 0, 0, 0, e, 0, 0, 0, 1), this;
|
|
820
893
|
}
|
|
821
894
|
equals(t) {
|
|
822
|
-
|
|
895
|
+
const e = this.elements, s = t.elements;
|
|
896
|
+
for (let t2 = 0; t2 < 9; t2++)
|
|
897
|
+
if (e[t2] !== s[t2])
|
|
898
|
+
return false;
|
|
899
|
+
return true;
|
|
823
900
|
}
|
|
824
901
|
fromArray(t, e = 0) {
|
|
825
|
-
|
|
902
|
+
for (let s = 0; s < 9; s++)
|
|
903
|
+
this.elements[s] = t[s + e];
|
|
904
|
+
return this;
|
|
826
905
|
}
|
|
827
906
|
toArray(t = [], e = 0) {
|
|
828
|
-
|
|
907
|
+
const s = this.elements;
|
|
908
|
+
return t[e] = s[0], t[e + 1] = s[1], t[e + 2] = s[2], t[e + 3] = s[3], t[e + 4] = s[4], t[e + 5] = s[5], t[e + 6] = s[6], t[e + 7] = s[7], t[e + 8] = s[8], t;
|
|
829
909
|
}
|
|
830
|
-
|
|
831
|
-
return
|
|
910
|
+
clone() {
|
|
911
|
+
return new this.constructor().fromArray(this.elements);
|
|
832
912
|
}
|
|
833
|
-
|
|
834
|
-
|
|
913
|
+
}
|
|
914
|
+
const _m3 = new Matrix3();
|
|
915
|
+
class Vector4 {
|
|
916
|
+
constructor(t = 0, e = 0, s = 0, i = 1) {
|
|
917
|
+
Vector4.prototype.isVector4 = true, this.x = t, this.y = e, this.z = s, this.w = i;
|
|
835
918
|
}
|
|
836
|
-
|
|
837
|
-
return this.
|
|
919
|
+
get width() {
|
|
920
|
+
return this.z;
|
|
838
921
|
}
|
|
839
|
-
|
|
922
|
+
set width(t) {
|
|
923
|
+
this.z = t;
|
|
840
924
|
}
|
|
841
|
-
|
|
842
|
-
|
|
925
|
+
get height() {
|
|
926
|
+
return this.w;
|
|
843
927
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
constructor(t = 0, e = 0, s = 0) {
|
|
847
|
-
Vector3$1.prototype.isVector3 = true, this.x = t, this.y = e, this.z = s;
|
|
928
|
+
set height(t) {
|
|
929
|
+
this.w = t;
|
|
848
930
|
}
|
|
849
|
-
set(t, e, s) {
|
|
850
|
-
return
|
|
931
|
+
set(t, e, s, i) {
|
|
932
|
+
return this.x = t, this.y = e, this.z = s, this.w = i, this;
|
|
851
933
|
}
|
|
852
934
|
setScalar(t) {
|
|
853
|
-
return this.x = t, this.y = t, this.z = t, this;
|
|
935
|
+
return this.x = t, this.y = t, this.z = t, this.w = t, this;
|
|
854
936
|
}
|
|
855
937
|
setX(t) {
|
|
856
938
|
return this.x = t, this;
|
|
@@ -861,6 +943,9 @@ class Vector3$1 {
|
|
|
861
943
|
setZ(t) {
|
|
862
944
|
return this.z = t, this;
|
|
863
945
|
}
|
|
946
|
+
setW(t) {
|
|
947
|
+
return this.w = t, this;
|
|
948
|
+
}
|
|
864
949
|
setComponent(t, e) {
|
|
865
950
|
switch (t) {
|
|
866
951
|
case 0:
|
|
@@ -872,6 +957,9 @@ class Vector3$1 {
|
|
|
872
957
|
case 2:
|
|
873
958
|
this.z = e;
|
|
874
959
|
break;
|
|
960
|
+
case 3:
|
|
961
|
+
this.w = e;
|
|
962
|
+
break;
|
|
875
963
|
default:
|
|
876
964
|
throw new Error("index is out of range: " + t);
|
|
877
965
|
}
|
|
@@ -885,125 +973,119 @@ class Vector3$1 {
|
|
|
885
973
|
return this.y;
|
|
886
974
|
case 2:
|
|
887
975
|
return this.z;
|
|
976
|
+
case 3:
|
|
977
|
+
return this.w;
|
|
888
978
|
default:
|
|
889
979
|
throw new Error("index is out of range: " + t);
|
|
890
980
|
}
|
|
891
981
|
}
|
|
892
982
|
clone() {
|
|
893
|
-
return new this.constructor(this.x, this.y, this.z);
|
|
983
|
+
return new this.constructor(this.x, this.y, this.z, this.w);
|
|
894
984
|
}
|
|
895
985
|
copy(t) {
|
|
896
|
-
return this.x = t.x, this.y = t.y, this.z = t.z, this;
|
|
986
|
+
return this.x = t.x, this.y = t.y, this.z = t.z, this.w = void 0 !== t.w ? t.w : 1, this;
|
|
897
987
|
}
|
|
898
988
|
add(t) {
|
|
899
|
-
return this.x += t.x, this.y += t.y, this.z += t.z, this;
|
|
989
|
+
return this.x += t.x, this.y += t.y, this.z += t.z, this.w += t.w, this;
|
|
900
990
|
}
|
|
901
991
|
addScalar(t) {
|
|
902
|
-
return this.x += t, this.y += t, this.z += t, this;
|
|
992
|
+
return this.x += t, this.y += t, this.z += t, this.w += t, this;
|
|
903
993
|
}
|
|
904
994
|
addVectors(t, e) {
|
|
905
|
-
return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this;
|
|
995
|
+
return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this.w = t.w + e.w, this;
|
|
906
996
|
}
|
|
907
997
|
addScaledVector(t, e) {
|
|
908
|
-
return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this;
|
|
998
|
+
return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this.w += t.w * e, this;
|
|
909
999
|
}
|
|
910
1000
|
sub(t) {
|
|
911
|
-
return this.x -= t.x, this.y -= t.y, this.z -= t.z, this;
|
|
1001
|
+
return this.x -= t.x, this.y -= t.y, this.z -= t.z, this.w -= t.w, this;
|
|
912
1002
|
}
|
|
913
1003
|
subScalar(t) {
|
|
914
|
-
return this.x -= t, this.y -= t, this.z -= t, this;
|
|
1004
|
+
return this.x -= t, this.y -= t, this.z -= t, this.w -= t, this;
|
|
915
1005
|
}
|
|
916
1006
|
subVectors(t, e) {
|
|
917
|
-
return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this;
|
|
1007
|
+
return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this.w = t.w - e.w, this;
|
|
918
1008
|
}
|
|
919
1009
|
multiply(t) {
|
|
920
|
-
return this.x *= t.x, this.y *= t.y, this.z *= t.z, this;
|
|
1010
|
+
return this.x *= t.x, this.y *= t.y, this.z *= t.z, this.w *= t.w, this;
|
|
921
1011
|
}
|
|
922
1012
|
multiplyScalar(t) {
|
|
923
|
-
return this.x *= t, this.y *= t, this.z *= t, this;
|
|
924
|
-
}
|
|
925
|
-
multiplyVectors(t, e) {
|
|
926
|
-
return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
|
|
927
|
-
}
|
|
928
|
-
applyEuler(t) {
|
|
929
|
-
return this.applyQuaternion(_quaternion$4.setFromEuler(t));
|
|
930
|
-
}
|
|
931
|
-
applyAxisAngle(t, e) {
|
|
932
|
-
return this.applyQuaternion(_quaternion$4.setFromAxisAngle(t, e));
|
|
933
|
-
}
|
|
934
|
-
applyMatrix3(t) {
|
|
935
|
-
const e = this.x, s = this.y, i = this.z, r = t.elements;
|
|
936
|
-
return this.x = r[0] * e + r[3] * s + r[6] * i, this.y = r[1] * e + r[4] * s + r[7] * i, this.z = r[2] * e + r[5] * s + r[8] * i, this;
|
|
937
|
-
}
|
|
938
|
-
applyNormalMatrix(t) {
|
|
939
|
-
return this.applyMatrix3(t).normalize();
|
|
1013
|
+
return this.x *= t, this.y *= t, this.z *= t, this.w *= t, this;
|
|
940
1014
|
}
|
|
941
1015
|
applyMatrix4(t) {
|
|
942
|
-
const e = this.x, s = this.y, i = this.z, r =
|
|
943
|
-
return this.x =
|
|
944
|
-
}
|
|
945
|
-
applyQuaternion(t) {
|
|
946
|
-
const e = this.x, s = this.y, i = this.z, r = t.x, a = t.y, n = t.z, o = t.w, h = 2 * (a * i - n * s), c = 2 * (n * e - r * i), l = 2 * (r * s - a * e);
|
|
947
|
-
return this.x = e + o * h + a * l - n * c, this.y = s + o * c + n * h - r * l, this.z = i + o * l + r * c - a * h, this;
|
|
948
|
-
}
|
|
949
|
-
project(t) {
|
|
950
|
-
return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
|
|
951
|
-
}
|
|
952
|
-
unproject(t) {
|
|
953
|
-
return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld);
|
|
954
|
-
}
|
|
955
|
-
transformDirection(t) {
|
|
956
|
-
const e = this.x, s = this.y, i = this.z, r = t.elements;
|
|
957
|
-
return this.x = r[0] * e + r[4] * s + r[8] * i, this.y = r[1] * e + r[5] * s + r[9] * i, this.z = r[2] * e + r[6] * s + r[10] * i, this.normalize();
|
|
1016
|
+
const e = this.x, s = this.y, i = this.z, r = this.w, a = t.elements;
|
|
1017
|
+
return this.x = a[0] * e + a[4] * s + a[8] * i + a[12] * r, this.y = a[1] * e + a[5] * s + a[9] * i + a[13] * r, this.z = a[2] * e + a[6] * s + a[10] * i + a[14] * r, this.w = a[3] * e + a[7] * s + a[11] * i + a[15] * r, this;
|
|
958
1018
|
}
|
|
959
1019
|
divide(t) {
|
|
960
|
-
return this.x /= t.x, this.y /= t.y, this.z /= t.z, this;
|
|
1020
|
+
return this.x /= t.x, this.y /= t.y, this.z /= t.z, this.w /= t.w, this;
|
|
961
1021
|
}
|
|
962
1022
|
divideScalar(t) {
|
|
963
1023
|
return this.multiplyScalar(1 / t);
|
|
964
1024
|
}
|
|
1025
|
+
setAxisAngleFromQuaternion(t) {
|
|
1026
|
+
this.w = 2 * Math.acos(t.w);
|
|
1027
|
+
const e = Math.sqrt(1 - t.w * t.w);
|
|
1028
|
+
return e < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t.x / e, this.y = t.y / e, this.z = t.z / e), this;
|
|
1029
|
+
}
|
|
1030
|
+
setAxisAngleFromRotationMatrix(t) {
|
|
1031
|
+
let e, s, i, r;
|
|
1032
|
+
const a = 0.01, n = 0.1, o = t.elements, h = o[0], c = o[4], l = o[8], u = o[1], d = o[5], _ = o[9], m = o[2], p = o[6], f = o[10];
|
|
1033
|
+
if (Math.abs(c - u) < a && Math.abs(l - m) < a && Math.abs(_ - p) < a) {
|
|
1034
|
+
if (Math.abs(c + u) < n && Math.abs(l + m) < n && Math.abs(_ + p) < n && Math.abs(h + d + f - 3) < n)
|
|
1035
|
+
return this.set(1, 0, 0, 0), this;
|
|
1036
|
+
e = Math.PI;
|
|
1037
|
+
const t2 = (h + 1) / 2, o2 = (d + 1) / 2, y2 = (f + 1) / 2, g = (c + u) / 4, M = (l + m) / 4, x = (_ + p) / 4;
|
|
1038
|
+
return t2 > o2 && t2 > y2 ? t2 < a ? (s = 0, i = 0.707106781, r = 0.707106781) : (s = Math.sqrt(t2), i = g / s, r = M / s) : o2 > y2 ? o2 < a ? (s = 0.707106781, i = 0, r = 0.707106781) : (i = Math.sqrt(o2), s = g / i, r = x / i) : y2 < a ? (s = 0.707106781, i = 0.707106781, r = 0) : (r = Math.sqrt(y2), s = M / r, i = x / r), this.set(s, i, r, e), this;
|
|
1039
|
+
}
|
|
1040
|
+
let y = Math.sqrt((p - _) * (p - _) + (l - m) * (l - m) + (u - c) * (u - c));
|
|
1041
|
+
return Math.abs(y) < 1e-3 && (y = 1), this.x = (p - _) / y, this.y = (l - m) / y, this.z = (u - c) / y, this.w = Math.acos((h + d + f - 1) / 2), this;
|
|
1042
|
+
}
|
|
1043
|
+
setFromMatrixPosition(t) {
|
|
1044
|
+
const e = t.elements;
|
|
1045
|
+
return this.x = e[12], this.y = e[13], this.z = e[14], this.w = e[15], this;
|
|
1046
|
+
}
|
|
965
1047
|
min(t) {
|
|
966
|
-
return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this;
|
|
1048
|
+
return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this.w = Math.min(this.w, t.w), this;
|
|
967
1049
|
}
|
|
968
1050
|
max(t) {
|
|
969
|
-
return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this;
|
|
1051
|
+
return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this.w = Math.max(this.w, t.w), this;
|
|
970
1052
|
}
|
|
971
1053
|
clamp(t, e) {
|
|
972
|
-
return this.x =
|
|
1054
|
+
return this.x = clamp(this.x, t.x, e.x), this.y = clamp(this.y, t.y, e.y), this.z = clamp(this.z, t.z, e.z), this.w = clamp(this.w, t.w, e.w), this;
|
|
973
1055
|
}
|
|
974
1056
|
clampScalar(t, e) {
|
|
975
|
-
return this.x =
|
|
1057
|
+
return this.x = clamp(this.x, t, e), this.y = clamp(this.y, t, e), this.z = clamp(this.z, t, e), this.w = clamp(this.w, t, e), this;
|
|
976
1058
|
}
|
|
977
1059
|
clampLength(t, e) {
|
|
978
1060
|
const s = this.length();
|
|
979
|
-
return this.divideScalar(s || 1).multiplyScalar(
|
|
1061
|
+
return this.divideScalar(s || 1).multiplyScalar(clamp(s, t, e));
|
|
980
1062
|
}
|
|
981
1063
|
floor() {
|
|
982
|
-
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
|
|
1064
|
+
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
|
|
983
1065
|
}
|
|
984
1066
|
ceil() {
|
|
985
|
-
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
|
|
1067
|
+
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
|
|
986
1068
|
}
|
|
987
1069
|
round() {
|
|
988
|
-
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
|
|
1070
|
+
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
|
|
989
1071
|
}
|
|
990
1072
|
roundToZero() {
|
|
991
|
-
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
|
|
1073
|
+
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
|
|
992
1074
|
}
|
|
993
1075
|
negate() {
|
|
994
|
-
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
|
|
1076
|
+
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
|
|
995
1077
|
}
|
|
996
1078
|
dot(t) {
|
|
997
|
-
return this.x * t.x + this.y * t.y + this.z * t.z;
|
|
1079
|
+
return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
|
|
998
1080
|
}
|
|
999
1081
|
lengthSq() {
|
|
1000
|
-
return this.x * this.x + this.y * this.y + this.z * this.z;
|
|
1082
|
+
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
|
|
1001
1083
|
}
|
|
1002
1084
|
length() {
|
|
1003
|
-
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
1085
|
+
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
|
|
1004
1086
|
}
|
|
1005
1087
|
manhattanLength() {
|
|
1006
|
-
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
|
|
1088
|
+
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
|
|
1007
1089
|
}
|
|
1008
1090
|
normalize() {
|
|
1009
1091
|
return this.divideScalar(this.length() || 1);
|
|
@@ -1012,105 +1094,30 @@ class Vector3$1 {
|
|
|
1012
1094
|
return this.normalize().multiplyScalar(t);
|
|
1013
1095
|
}
|
|
1014
1096
|
lerp(t, e) {
|
|
1015
|
-
return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this;
|
|
1097
|
+
return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this.w += (t.w - this.w) * e, this;
|
|
1016
1098
|
}
|
|
1017
1099
|
lerpVectors(t, e, s) {
|
|
1018
|
-
return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this;
|
|
1019
|
-
}
|
|
1020
|
-
cross(t) {
|
|
1021
|
-
return this.crossVectors(this, t);
|
|
1022
|
-
}
|
|
1023
|
-
crossVectors(t, e) {
|
|
1024
|
-
const s = t.x, i = t.y, r = t.z, a = e.x, n = e.y, o = e.z;
|
|
1025
|
-
return this.x = i * o - r * n, this.y = r * a - s * o, this.z = s * n - i * a, this;
|
|
1026
|
-
}
|
|
1027
|
-
projectOnVector(t) {
|
|
1028
|
-
const e = t.lengthSq();
|
|
1029
|
-
if (0 === e)
|
|
1030
|
-
return this.set(0, 0, 0);
|
|
1031
|
-
const s = t.dot(this) / e;
|
|
1032
|
-
return this.copy(t).multiplyScalar(s);
|
|
1033
|
-
}
|
|
1034
|
-
projectOnPlane(t) {
|
|
1035
|
-
return _vector$b.copy(this).projectOnVector(t), this.sub(_vector$b);
|
|
1036
|
-
}
|
|
1037
|
-
reflect(t) {
|
|
1038
|
-
return this.sub(_vector$b.copy(t).multiplyScalar(2 * this.dot(t)));
|
|
1039
|
-
}
|
|
1040
|
-
angleTo(t) {
|
|
1041
|
-
const e = Math.sqrt(this.lengthSq() * t.lengthSq());
|
|
1042
|
-
if (0 === e)
|
|
1043
|
-
return Math.PI / 2;
|
|
1044
|
-
const s = this.dot(t) / e;
|
|
1045
|
-
return Math.acos(clamp(s, -1, 1));
|
|
1046
|
-
}
|
|
1047
|
-
distanceTo(t) {
|
|
1048
|
-
return Math.sqrt(this.distanceToSquared(t));
|
|
1049
|
-
}
|
|
1050
|
-
distanceToSquared(t) {
|
|
1051
|
-
const e = this.x - t.x, s = this.y - t.y, i = this.z - t.z;
|
|
1052
|
-
return e * e + s * s + i * i;
|
|
1053
|
-
}
|
|
1054
|
-
manhattanDistanceTo(t) {
|
|
1055
|
-
return Math.abs(this.x - t.x) + Math.abs(this.y - t.y) + Math.abs(this.z - t.z);
|
|
1056
|
-
}
|
|
1057
|
-
setFromSpherical(t) {
|
|
1058
|
-
return this.setFromSphericalCoords(t.radius, t.phi, t.theta);
|
|
1059
|
-
}
|
|
1060
|
-
setFromSphericalCoords(t, e, s) {
|
|
1061
|
-
const i = Math.sin(e) * t;
|
|
1062
|
-
return this.x = i * Math.sin(s), this.y = Math.cos(e) * t, this.z = i * Math.cos(s), this;
|
|
1063
|
-
}
|
|
1064
|
-
setFromCylindrical(t) {
|
|
1065
|
-
return this.setFromCylindricalCoords(t.radius, t.theta, t.y);
|
|
1066
|
-
}
|
|
1067
|
-
setFromCylindricalCoords(t, e, s) {
|
|
1068
|
-
return this.x = t * Math.sin(e), this.y = s, this.z = t * Math.cos(e), this;
|
|
1069
|
-
}
|
|
1070
|
-
setFromMatrixPosition(t) {
|
|
1071
|
-
const e = t.elements;
|
|
1072
|
-
return this.x = e[12], this.y = e[13], this.z = e[14], this;
|
|
1073
|
-
}
|
|
1074
|
-
setFromMatrixScale(t) {
|
|
1075
|
-
const e = this.setFromMatrixColumn(t, 0).length(), s = this.setFromMatrixColumn(t, 1).length(), i = this.setFromMatrixColumn(t, 2).length();
|
|
1076
|
-
return this.x = e, this.y = s, this.z = i, this;
|
|
1077
|
-
}
|
|
1078
|
-
setFromMatrixColumn(t, e) {
|
|
1079
|
-
return this.fromArray(t.elements, 4 * e);
|
|
1080
|
-
}
|
|
1081
|
-
setFromMatrix3Column(t, e) {
|
|
1082
|
-
return this.fromArray(t.elements, 3 * e);
|
|
1083
|
-
}
|
|
1084
|
-
setFromEuler(t) {
|
|
1085
|
-
return this.x = t._x, this.y = t._y, this.z = t._z, this;
|
|
1086
|
-
}
|
|
1087
|
-
setFromColor(t) {
|
|
1088
|
-
return this.x = t.r, this.y = t.g, this.z = t.b, this;
|
|
1100
|
+
return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this.w = t.w + (e.w - t.w) * s, this;
|
|
1089
1101
|
}
|
|
1090
1102
|
equals(t) {
|
|
1091
|
-
return t.x === this.x && t.y === this.y && t.z === this.z;
|
|
1103
|
+
return t.x === this.x && t.y === this.y && t.z === this.z && t.w === this.w;
|
|
1092
1104
|
}
|
|
1093
1105
|
fromArray(t, e = 0) {
|
|
1094
|
-
return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this;
|
|
1106
|
+
return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this.w = t[e + 3], this;
|
|
1095
1107
|
}
|
|
1096
1108
|
toArray(t = [], e = 0) {
|
|
1097
|
-
return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t;
|
|
1109
|
+
return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t[e + 3] = this.w, t;
|
|
1098
1110
|
}
|
|
1099
1111
|
fromBufferAttribute(t, e) {
|
|
1100
|
-
return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this;
|
|
1112
|
+
return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this.w = t.getW(e), this;
|
|
1101
1113
|
}
|
|
1102
1114
|
random() {
|
|
1103
|
-
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
|
|
1104
|
-
}
|
|
1105
|
-
randomDirection() {
|
|
1106
|
-
const t = 2 * (Math.random() - 0.5), e = Math.random() * Math.PI * 2, s = Math.sqrt(1 - t ** 2);
|
|
1107
|
-
return this.x = s * Math.cos(e), this.y = s * Math.sin(e), this.z = t, this;
|
|
1115
|
+
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
|
|
1108
1116
|
}
|
|
1109
1117
|
*[Symbol.iterator]() {
|
|
1110
|
-
yield this.x, yield this.y, yield this.z;
|
|
1118
|
+
yield this.x, yield this.y, yield this.z, yield this.w;
|
|
1111
1119
|
}
|
|
1112
1120
|
}
|
|
1113
|
-
const _vector$b = new Vector3$1(), _quaternion$4 = new Quaternion$1();
|
|
1114
1121
|
class Box3 {
|
|
1115
1122
|
constructor(t = new Vector3$1(1 / 0, 1 / 0, 1 / 0), e = new Vector3$1(-1 / 0, -1 / 0, -1 / 0)) {
|
|
1116
1123
|
this.isBox3 = true, this.min = t, this.max = e;
|
|
@@ -1121,13 +1128,13 @@ class Box3 {
|
|
|
1121
1128
|
setFromArray(t) {
|
|
1122
1129
|
this.makeEmpty();
|
|
1123
1130
|
for (let e = 0, s = t.length; e < s; e += 3)
|
|
1124
|
-
this.expandByPoint(_vector$
|
|
1131
|
+
this.expandByPoint(_vector$b.fromArray(t, e));
|
|
1125
1132
|
return this;
|
|
1126
1133
|
}
|
|
1127
1134
|
setFromBufferAttribute(t) {
|
|
1128
1135
|
this.makeEmpty();
|
|
1129
1136
|
for (let e = 0, s = t.count; e < s; e++)
|
|
1130
|
-
this.expandByPoint(_vector$
|
|
1137
|
+
this.expandByPoint(_vector$b.fromBufferAttribute(t, e));
|
|
1131
1138
|
return this;
|
|
1132
1139
|
}
|
|
1133
1140
|
setFromPoints(t) {
|
|
@@ -1137,7 +1144,7 @@ class Box3 {
|
|
|
1137
1144
|
return this;
|
|
1138
1145
|
}
|
|
1139
1146
|
setFromCenterAndSize(t, e) {
|
|
1140
|
-
const s = _vector$
|
|
1147
|
+
const s = _vector$b.copy(e).multiplyScalar(0.5);
|
|
1141
1148
|
return this.min.copy(t).sub(s), this.max.copy(t).add(s), this;
|
|
1142
1149
|
}
|
|
1143
1150
|
setFromObject(t, e = false) {
|
|
@@ -1177,9 +1184,9 @@ class Box3 {
|
|
|
1177
1184
|
const i2 = s.getAttribute("position");
|
|
1178
1185
|
if (true === e && void 0 !== i2 && true !== t.isInstancedMesh)
|
|
1179
1186
|
for (let e2 = 0, s2 = i2.count; e2 < s2; e2++)
|
|
1180
|
-
true === t.isMesh ? t.getVertexPosition(e2, _vector$
|
|
1187
|
+
true === t.isMesh ? t.getVertexPosition(e2, _vector$b) : _vector$b.fromBufferAttribute(i2, e2), _vector$b.applyMatrix4(t.matrixWorld), this.expandByPoint(_vector$b);
|
|
1181
1188
|
else
|
|
1182
|
-
void 0 !== t.boundingBox ? (null === t.boundingBox && t.computeBoundingBox(), _box$
|
|
1189
|
+
void 0 !== t.boundingBox ? (null === t.boundingBox && t.computeBoundingBox(), _box$4.copy(t.boundingBox)) : (null === s.boundingBox && s.computeBoundingBox(), _box$4.copy(s.boundingBox)), _box$4.applyMatrix4(t.matrixWorld), this.union(_box$4);
|
|
1183
1190
|
}
|
|
1184
1191
|
const i = t.children;
|
|
1185
1192
|
for (let t2 = 0, s2 = i.length; t2 < s2; t2++)
|
|
@@ -1187,7 +1194,7 @@ class Box3 {
|
|
|
1187
1194
|
return this;
|
|
1188
1195
|
}
|
|
1189
1196
|
containsPoint(t) {
|
|
1190
|
-
return
|
|
1197
|
+
return t.x >= this.min.x && t.x <= this.max.x && t.y >= this.min.y && t.y <= this.max.y && t.z >= this.min.z && t.z <= this.max.z;
|
|
1191
1198
|
}
|
|
1192
1199
|
containsBox(t) {
|
|
1193
1200
|
return this.min.x <= t.min.x && t.max.x <= this.max.x && this.min.y <= t.min.y && t.max.y <= this.max.y && this.min.z <= t.min.z && t.max.z <= this.max.z;
|
|
@@ -1196,10 +1203,10 @@ class Box3 {
|
|
|
1196
1203
|
return e.set((t.x - this.min.x) / (this.max.x - this.min.x), (t.y - this.min.y) / (this.max.y - this.min.y), (t.z - this.min.z) / (this.max.z - this.min.z));
|
|
1197
1204
|
}
|
|
1198
1205
|
intersectsBox(t) {
|
|
1199
|
-
return
|
|
1206
|
+
return t.max.x >= this.min.x && t.min.x <= this.max.x && t.max.y >= this.min.y && t.min.y <= this.max.y && t.max.z >= this.min.z && t.min.z <= this.max.z;
|
|
1200
1207
|
}
|
|
1201
1208
|
intersectsSphere(t) {
|
|
1202
|
-
return this.clampPoint(t.center, _vector$
|
|
1209
|
+
return this.clampPoint(t.center, _vector$b), _vector$b.distanceToSquared(t.center) <= t.radius * t.radius;
|
|
1203
1210
|
}
|
|
1204
1211
|
intersectsPlane(t) {
|
|
1205
1212
|
let e, s;
|
|
@@ -1216,10 +1223,10 @@ class Box3 {
|
|
|
1216
1223
|
return e.copy(t).clamp(this.min, this.max);
|
|
1217
1224
|
}
|
|
1218
1225
|
distanceToPoint(t) {
|
|
1219
|
-
return this.clampPoint(t, _vector$
|
|
1226
|
+
return this.clampPoint(t, _vector$b).distanceTo(t);
|
|
1220
1227
|
}
|
|
1221
1228
|
getBoundingSphere(t) {
|
|
1222
|
-
return this.isEmpty() ? t.makeEmpty() : (this.getCenter(t.center), t.radius = 0.5 * this.getSize(_vector$
|
|
1229
|
+
return this.isEmpty() ? t.makeEmpty() : (this.getCenter(t.center), t.radius = 0.5 * this.getSize(_vector$b).length()), t;
|
|
1223
1230
|
}
|
|
1224
1231
|
intersect(t) {
|
|
1225
1232
|
return this.min.max(t.min), this.max.min(t.max), this.isEmpty() && this.makeEmpty(), this;
|
|
@@ -1236,8 +1243,14 @@ class Box3 {
|
|
|
1236
1243
|
equals(t) {
|
|
1237
1244
|
return t.min.equals(this.min) && t.max.equals(this.max);
|
|
1238
1245
|
}
|
|
1246
|
+
toJSON() {
|
|
1247
|
+
return { min: this.min.toArray(), max: this.max.toArray() };
|
|
1248
|
+
}
|
|
1249
|
+
fromJSON(t) {
|
|
1250
|
+
return this.min.fromArray(t.min), this.max.fromArray(t.max), this;
|
|
1251
|
+
}
|
|
1239
1252
|
}
|
|
1240
|
-
const _points = [new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1()], _vector$
|
|
1253
|
+
const _points = [new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1()], _vector$b = new Vector3$1(), _box$4 = new Box3(), _v0$2 = new Vector3$1(), _v1$7 = new Vector3$1(), _v2$4 = new Vector3$1(), _f0 = new Vector3$1(), _f1 = new Vector3$1(), _f2 = new Vector3$1(), _center$1 = new Vector3$1(), _extents = new Vector3$1(), _triangleNormal = new Vector3$1(), _testAxis = new Vector3$1();
|
|
1241
1254
|
function satForAxes(t, e, s, i, r) {
|
|
1242
1255
|
for (let a = 0, n = t.length - 3; a <= n; a += 3) {
|
|
1243
1256
|
_testAxis.fromArray(t, a);
|
|
@@ -1247,7 +1260,7 @@ function satForAxes(t, e, s, i, r) {
|
|
|
1247
1260
|
}
|
|
1248
1261
|
return true;
|
|
1249
1262
|
}
|
|
1250
|
-
const _vector$
|
|
1263
|
+
const _vector$a = new Vector3$1(), _segCenter = new Vector3$1(), _segDir = new Vector3$1(), _diff = new Vector3$1(), _edge1 = new Vector3$1(), _edge2 = new Vector3$1(), _normal$1 = new Vector3$1();
|
|
1251
1264
|
class Ray {
|
|
1252
1265
|
constructor(t = new Vector3$1(), e = new Vector3$1(0, 0, -1)) {
|
|
1253
1266
|
this.origin = t, this.direction = e;
|
|
@@ -1265,7 +1278,7 @@ class Ray {
|
|
|
1265
1278
|
return this.direction.copy(t).sub(this.origin).normalize(), this;
|
|
1266
1279
|
}
|
|
1267
1280
|
recast(t) {
|
|
1268
|
-
return this.origin.copy(this.at(t, _vector$
|
|
1281
|
+
return this.origin.copy(this.at(t, _vector$a)), this;
|
|
1269
1282
|
}
|
|
1270
1283
|
closestPointToPoint(t, e) {
|
|
1271
1284
|
e.subVectors(t, this.origin);
|
|
@@ -1276,8 +1289,8 @@ class Ray {
|
|
|
1276
1289
|
return Math.sqrt(this.distanceSqToPoint(t));
|
|
1277
1290
|
}
|
|
1278
1291
|
distanceSqToPoint(t) {
|
|
1279
|
-
const e = _vector$
|
|
1280
|
-
return e < 0 ? this.origin.distanceToSquared(t) : (_vector$
|
|
1292
|
+
const e = _vector$a.subVectors(t, this.origin).dot(this.direction);
|
|
1293
|
+
return e < 0 ? this.origin.distanceToSquared(t) : (_vector$a.copy(this.origin).addScaledVector(this.direction, e), _vector$a.distanceToSquared(t));
|
|
1281
1294
|
}
|
|
1282
1295
|
distanceSqToSegment(t, e, s, i) {
|
|
1283
1296
|
_segCenter.copy(t).add(e).multiplyScalar(0.5), _segDir.copy(e).sub(t).normalize(), _diff.copy(this.origin).sub(_segCenter);
|
|
@@ -1300,15 +1313,15 @@ class Ray {
|
|
|
1300
1313
|
return s && s.copy(this.origin).addScaledVector(this.direction, l), i && i.copy(_segCenter).addScaledVector(_segDir, u), d;
|
|
1301
1314
|
}
|
|
1302
1315
|
intersectSphere(t, e) {
|
|
1303
|
-
_vector$
|
|
1304
|
-
const s = _vector$
|
|
1316
|
+
_vector$a.subVectors(t.center, this.origin);
|
|
1317
|
+
const s = _vector$a.dot(this.direction), i = _vector$a.dot(_vector$a) - s * s, r = t.radius * t.radius;
|
|
1305
1318
|
if (i > r)
|
|
1306
1319
|
return null;
|
|
1307
1320
|
const a = Math.sqrt(r - i), n = s - a, o = s + a;
|
|
1308
1321
|
return o < 0 ? null : n < 0 ? this.at(o, e) : this.at(n, e);
|
|
1309
1322
|
}
|
|
1310
1323
|
intersectsSphere(t) {
|
|
1311
|
-
return this.distanceSqToPoint(t.center) <= t.radius * t.radius;
|
|
1324
|
+
return !(t.radius < 0) && this.distanceSqToPoint(t.center) <= t.radius * t.radius;
|
|
1312
1325
|
}
|
|
1313
1326
|
distanceToPlane(t) {
|
|
1314
1327
|
const e = t.normal.dot(this.direction);
|
|
@@ -1333,7 +1346,7 @@ class Ray {
|
|
|
1333
1346
|
return h >= 0 ? (s = (t.min.x - u.x) * h, i = (t.max.x - u.x) * h) : (s = (t.max.x - u.x) * h, i = (t.min.x - u.x) * h), c >= 0 ? (r = (t.min.y - u.y) * c, a = (t.max.y - u.y) * c) : (r = (t.max.y - u.y) * c, a = (t.min.y - u.y) * c), s > a || r > i ? null : ((r > s || isNaN(s)) && (s = r), (a < i || isNaN(i)) && (i = a), l >= 0 ? (n = (t.min.z - u.z) * l, o = (t.max.z - u.z) * l) : (n = (t.max.z - u.z) * l, o = (t.min.z - u.z) * l), s > o || n > i ? null : ((n > s || s != s) && (s = n), (o < i || i != i) && (i = o), i < 0 ? null : this.at(s >= 0 ? s : i, e)));
|
|
1334
1347
|
}
|
|
1335
1348
|
intersectsBox(t) {
|
|
1336
|
-
return null !== this.intersectBox(t, _vector$
|
|
1349
|
+
return null !== this.intersectBox(t, _vector$a);
|
|
1337
1350
|
}
|
|
1338
1351
|
intersectTriangle(t, e, s, i, r) {
|
|
1339
1352
|
_edge1.subVectors(e, t), _edge2.subVectors(s, t), _normal$1.crossVectors(_edge1, _edge2);
|
|
@@ -1370,12 +1383,12 @@ class Ray {
|
|
|
1370
1383
|
}
|
|
1371
1384
|
}
|
|
1372
1385
|
class Matrix4 {
|
|
1373
|
-
constructor(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m,
|
|
1374
|
-
Matrix4.prototype.isMatrix4 = true, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m,
|
|
1386
|
+
constructor(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p) {
|
|
1387
|
+
Matrix4.prototype.isMatrix4 = true, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p);
|
|
1375
1388
|
}
|
|
1376
|
-
set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m,
|
|
1377
|
-
const
|
|
1378
|
-
return
|
|
1389
|
+
set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p) {
|
|
1390
|
+
const f = this.elements;
|
|
1391
|
+
return f[0] = t, f[4] = e, f[8] = s, f[12] = i, f[1] = r, f[5] = a, f[9] = n, f[13] = o, f[2] = h, f[6] = c, f[10] = l, f[14] = u, f[3] = d, f[7] = _, f[11] = m, f[15] = p, this;
|
|
1379
1392
|
}
|
|
1380
1393
|
identity() {
|
|
1381
1394
|
return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
|
|
@@ -1442,8 +1455,8 @@ class Matrix4 {
|
|
|
1442
1455
|
return this.multiplyMatrices(t, this);
|
|
1443
1456
|
}
|
|
1444
1457
|
multiplyMatrices(t, e) {
|
|
1445
|
-
const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[4], o = s[8], h = s[12], c = s[1], l = s[5], u = s[9], d = s[13], _ = s[2], m = s[6],
|
|
1446
|
-
return r[0] = a * w + n * P + o * T + h * N, r[4] = a * S + n * b + o * I + h * G, r[8] = a * C + n *
|
|
1458
|
+
const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[4], o = s[8], h = s[12], c = s[1], l = s[5], u = s[9], d = s[13], _ = s[2], m = s[6], p = s[10], f = s[14], y = s[3], g = s[7], M = s[11], x = s[15], w = i[0], S = i[4], C = i[8], E = i[12], P = i[1], b = i[5], A2 = i[9], v = i[13], T = i[2], I = i[6], z = i[10], O = i[14], N = i[3], G = i[7], R = i[11], L = i[15];
|
|
1459
|
+
return r[0] = a * w + n * P + o * T + h * N, r[4] = a * S + n * b + o * I + h * G, r[8] = a * C + n * A2 + o * z + h * R, r[12] = a * E + n * v + o * O + h * L, r[1] = c * w + l * P + u * T + d * N, r[5] = c * S + l * b + u * I + d * G, r[9] = c * C + l * A2 + u * z + d * R, r[13] = c * E + l * v + u * O + d * L, r[2] = _ * w + m * P + p * T + f * N, r[6] = _ * S + m * b + p * I + f * G, r[10] = _ * C + m * A2 + p * z + f * R, r[14] = _ * E + m * v + p * O + f * L, r[3] = y * w + g * P + M * T + x * N, r[7] = y * S + g * b + M * I + x * G, r[11] = y * C + g * A2 + M * z + x * R, r[15] = y * E + g * v + M * O + x * L, this;
|
|
1447
1460
|
}
|
|
1448
1461
|
multiplyScalar(t) {
|
|
1449
1462
|
const e = this.elements;
|
|
@@ -1463,11 +1476,11 @@ class Matrix4 {
|
|
|
1463
1476
|
return t.isVector3 ? (i[12] = t.x, i[13] = t.y, i[14] = t.z) : (i[12] = t, i[13] = e, i[14] = s), this;
|
|
1464
1477
|
}
|
|
1465
1478
|
invert() {
|
|
1466
|
-
const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = t[9], u = t[10], d = t[11], _ = t[12], m = t[13],
|
|
1479
|
+
const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = t[9], u = t[10], d = t[11], _ = t[12], m = t[13], p = t[14], f = t[15], y = l * p * h - m * u * h + m * o * d - n * p * d - l * o * f + n * u * f, g = _ * u * h - c * p * h - _ * o * d + a * p * d + c * o * f - a * u * f, M = c * m * h - _ * l * h + _ * n * d - a * m * d - c * n * f + a * l * f, x = _ * l * o - c * m * o - _ * n * u + a * m * u + c * n * p - a * l * p, w = e * y + s * g + i * M + r * x;
|
|
1467
1480
|
if (0 === w)
|
|
1468
1481
|
return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1469
1482
|
const S = 1 / w;
|
|
1470
|
-
return t[0] = y * S, t[1] = (m * u * r - l *
|
|
1483
|
+
return t[0] = y * S, t[1] = (m * u * r - l * p * r - m * i * d + s * p * d + l * i * f - s * u * f) * S, t[2] = (n * p * r - m * o * r + m * i * h - s * p * h - n * i * f + s * o * f) * S, t[3] = (l * o * r - n * u * r - l * i * h + s * u * h + n * i * d - s * o * d) * S, t[4] = g * S, t[5] = (c * p * r - _ * u * r + _ * i * d - e * p * d - c * i * f + e * u * f) * S, t[6] = (_ * o * r - a * p * r - _ * i * h + e * p * h + a * i * f - e * o * f) * S, t[7] = (a * u * r - c * o * r + c * i * h - e * u * h - a * i * d + e * o * d) * S, t[8] = M * S, t[9] = (_ * l * r - c * m * r - _ * s * d + e * m * d + c * s * f - e * l * f) * S, t[10] = (a * m * r - _ * n * r + _ * s * h - e * m * h - a * s * f + e * n * f) * S, t[11] = (c * n * r - a * l * r - c * s * h + e * l * h + a * s * d - e * n * d) * S, t[12] = x * S, t[13] = (c * m * i - _ * l * i + _ * s * u - e * m * u - c * s * p + e * l * p) * S, t[14] = (_ * n * i - a * m * i - _ * s * o + e * m * o + a * s * p - e * n * p) * S, t[15] = (a * l * i - c * n * i + c * s * o - e * l * o - a * s * u + e * n * u) * S, this;
|
|
1471
1484
|
}
|
|
1472
1485
|
scale(t) {
|
|
1473
1486
|
const e = this.elements, s = t.x, i = t.y, r = t.z;
|
|
@@ -1503,8 +1516,8 @@ class Matrix4 {
|
|
|
1503
1516
|
return this.set(1, s, r, 0, t, 1, a, 0, e, i, 1, 0, 0, 0, 0, 1), this;
|
|
1504
1517
|
}
|
|
1505
1518
|
compose(t, e, s) {
|
|
1506
|
-
const i = this.elements, r = e._x, a = e._y, n = e._z, o = e._w, h = r + r, c = a + a, l = n + n, u = r * h, d = r * c, _ = r * l, m = a * c,
|
|
1507
|
-
return i[0] = (1 - (m +
|
|
1519
|
+
const i = this.elements, r = e._x, a = e._y, n = e._z, o = e._w, h = r + r, c = a + a, l = n + n, u = r * h, d = r * c, _ = r * l, m = a * c, p = a * l, f = n * l, y = o * h, g = o * c, M = o * l, x = s.x, w = s.y, S = s.z;
|
|
1520
|
+
return i[0] = (1 - (m + f)) * x, i[1] = (d + M) * x, i[2] = (_ - g) * x, i[3] = 0, i[4] = (d - M) * w, i[5] = (1 - (u + f)) * w, i[6] = (p + y) * w, i[7] = 0, i[8] = (_ + g) * S, i[9] = (p - y) * S, i[10] = (1 - (u + m)) * S, i[11] = 0, i[12] = t.x, i[13] = t.y, i[14] = t.z, i[15] = 1, this;
|
|
1508
1521
|
}
|
|
1509
1522
|
decompose(t, e, s) {
|
|
1510
1523
|
const i = this.elements;
|
|
@@ -1514,29 +1527,33 @@ class Matrix4 {
|
|
|
1514
1527
|
const o = 1 / r, h = 1 / a, c = 1 / n;
|
|
1515
1528
|
return _m1$2.elements[0] *= o, _m1$2.elements[1] *= o, _m1$2.elements[2] *= o, _m1$2.elements[4] *= h, _m1$2.elements[5] *= h, _m1$2.elements[6] *= h, _m1$2.elements[8] *= c, _m1$2.elements[9] *= c, _m1$2.elements[10] *= c, e.setFromRotationMatrix(_m1$2), s.x = r, s.y = a, s.z = n, this;
|
|
1516
1529
|
}
|
|
1517
|
-
makePerspective(t, e, s, i, r, a, n = WebGLCoordinateSystem) {
|
|
1518
|
-
const
|
|
1519
|
-
let
|
|
1520
|
-
if (
|
|
1521
|
-
|
|
1530
|
+
makePerspective(t, e, s, i, r, a, n = WebGLCoordinateSystem, o = false) {
|
|
1531
|
+
const h = this.elements, c = 2 * r / (e - t), l = 2 * r / (s - i), u = (e + t) / (e - t), d = (s + i) / (s - i);
|
|
1532
|
+
let _, m;
|
|
1533
|
+
if (o)
|
|
1534
|
+
_ = r / (a - r), m = a * r / (a - r);
|
|
1535
|
+
else if (n === WebGLCoordinateSystem)
|
|
1536
|
+
_ = -(a + r) / (a - r), m = -2 * a * r / (a - r);
|
|
1522
1537
|
else {
|
|
1523
1538
|
if (n !== WebGPUCoordinateSystem)
|
|
1524
1539
|
throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + n);
|
|
1525
|
-
|
|
1540
|
+
_ = -a / (a - r), m = -a * r / (a - r);
|
|
1526
1541
|
}
|
|
1527
|
-
return
|
|
1542
|
+
return h[0] = c, h[4] = 0, h[8] = u, h[12] = 0, h[1] = 0, h[5] = l, h[9] = d, h[13] = 0, h[2] = 0, h[6] = 0, h[10] = _, h[14] = m, h[3] = 0, h[7] = 0, h[11] = -1, h[15] = 0, this;
|
|
1528
1543
|
}
|
|
1529
|
-
makeOrthographic(t, e, s, i, r, a, n = WebGLCoordinateSystem) {
|
|
1530
|
-
const
|
|
1544
|
+
makeOrthographic(t, e, s, i, r, a, n = WebGLCoordinateSystem, o = false) {
|
|
1545
|
+
const h = this.elements, c = 2 / (e - t), l = 2 / (s - i), u = -(e + t) / (e - t), d = -(s + i) / (s - i);
|
|
1531
1546
|
let _, m;
|
|
1532
|
-
if (
|
|
1533
|
-
_ = (a
|
|
1547
|
+
if (o)
|
|
1548
|
+
_ = 1 / (a - r), m = a / (a - r);
|
|
1549
|
+
else if (n === WebGLCoordinateSystem)
|
|
1550
|
+
_ = -2 / (a - r), m = -(a + r) / (a - r);
|
|
1534
1551
|
else {
|
|
1535
1552
|
if (n !== WebGPUCoordinateSystem)
|
|
1536
1553
|
throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + n);
|
|
1537
|
-
_ =
|
|
1554
|
+
_ = -1 / (a - r), m = -r / (a - r);
|
|
1538
1555
|
}
|
|
1539
|
-
return
|
|
1556
|
+
return h[0] = c, h[4] = 0, h[8] = 0, h[12] = u, h[1] = 0, h[5] = l, h[9] = 0, h[13] = d, h[2] = 0, h[6] = 0, h[10] = _, h[14] = m, h[3] = 0, h[7] = 0, h[11] = 0, h[15] = 1, this;
|
|
1540
1557
|
}
|
|
1541
1558
|
equals(t) {
|
|
1542
1559
|
const e = this.elements, s = t.elements;
|
|
@@ -1690,7 +1707,7 @@ class Quaternion {
|
|
|
1690
1707
|
copy(t) {
|
|
1691
1708
|
return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
|
|
1692
1709
|
}
|
|
1693
|
-
setFromEuler(t, e) {
|
|
1710
|
+
setFromEuler(t, e = true) {
|
|
1694
1711
|
const s = t._x, i = t._y, r = t._z, a = t._order, n = Math.cos, o = Math.sin, h = n(s / 2), c = n(i / 2), l = n(r / 2), u = o(s / 2), d = o(i / 2), _ = o(r / 2);
|
|
1695
1712
|
switch (a) {
|
|
1696
1713
|
case "XYZ":
|
|
@@ -1714,7 +1731,7 @@ class Quaternion {
|
|
|
1714
1731
|
default:
|
|
1715
1732
|
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
|
|
1716
1733
|
}
|
|
1717
|
-
return
|
|
1734
|
+
return true === e && this._onChangeCallback(), this;
|
|
1718
1735
|
}
|
|
1719
1736
|
setFromAxisAngle(t, e) {
|
|
1720
1737
|
const s = e / 2, i = Math.sin(s);
|
|
@@ -1739,7 +1756,7 @@ class Quaternion {
|
|
|
1739
1756
|
}
|
|
1740
1757
|
setFromUnitVectors(t, e) {
|
|
1741
1758
|
let s = t.dot(e) + 1;
|
|
1742
|
-
return s <
|
|
1759
|
+
return s < 1e-8 ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
|
|
1743
1760
|
}
|
|
1744
1761
|
angleTo(t) {
|
|
1745
1762
|
return 2 * Math.acos(Math.abs(clamp$1(this.dot(t), -1, 1)));
|
|
@@ -1795,7 +1812,7 @@ class Quaternion {
|
|
|
1795
1812
|
const o = 1 - n * n;
|
|
1796
1813
|
if (o <= Number.EPSILON) {
|
|
1797
1814
|
const t2 = 1 - e;
|
|
1798
|
-
return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this
|
|
1815
|
+
return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this;
|
|
1799
1816
|
}
|
|
1800
1817
|
const h = Math.sqrt(o), c = Math.atan2(h, n), l = Math.sin((1 - e) * c) / h, u = Math.sin(e * c) / h;
|
|
1801
1818
|
return this._w = a * l + this._w * u, this._x = s * l + this._x * u, this._y = i * l + this._y * u, this._z = r * l + this._z * u, this._onChangeCallback(), this;
|
|
@@ -1804,8 +1821,8 @@ class Quaternion {
|
|
|
1804
1821
|
return this.copy(t).slerp(e, s);
|
|
1805
1822
|
}
|
|
1806
1823
|
random() {
|
|
1807
|
-
const t = Math.random(), e = Math.
|
|
1808
|
-
return this.set(
|
|
1824
|
+
const t = 2 * Math.PI * Math.random(), e = 2 * Math.PI * Math.random(), s = Math.random(), i = Math.sqrt(1 - s), r = Math.sqrt(s);
|
|
1825
|
+
return this.set(i * Math.sin(t), i * Math.cos(t), r * Math.sin(e), r * Math.cos(e));
|
|
1809
1826
|
}
|
|
1810
1827
|
equals(t) {
|
|
1811
1828
|
return t._x === this._x && t._y === this._y && t._z === this._z && t._w === this._w;
|
|
@@ -1817,7 +1834,7 @@ class Quaternion {
|
|
|
1817
1834
|
return t[e] = this._x, t[e + 1] = this._y, t[e + 2] = this._z, t[e + 3] = this._w, t;
|
|
1818
1835
|
}
|
|
1819
1836
|
fromBufferAttribute(t, e) {
|
|
1820
|
-
return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this;
|
|
1837
|
+
return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this._onChangeCallback(), this;
|
|
1821
1838
|
}
|
|
1822
1839
|
toJSON() {
|
|
1823
1840
|
return this.toArray();
|
|
@@ -1958,14 +1975,14 @@ class Vector3 {
|
|
|
1958
1975
|
return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this;
|
|
1959
1976
|
}
|
|
1960
1977
|
clamp(t, e) {
|
|
1961
|
-
return this.x =
|
|
1978
|
+
return this.x = clamp$1(this.x, t.x, e.x), this.y = clamp$1(this.y, t.y, e.y), this.z = clamp$1(this.z, t.z, e.z), this;
|
|
1962
1979
|
}
|
|
1963
1980
|
clampScalar(t, e) {
|
|
1964
|
-
return this.x =
|
|
1981
|
+
return this.x = clamp$1(this.x, t, e), this.y = clamp$1(this.y, t, e), this.z = clamp$1(this.z, t, e), this;
|
|
1965
1982
|
}
|
|
1966
1983
|
clampLength(t, e) {
|
|
1967
1984
|
const s = this.length();
|
|
1968
|
-
return this.divideScalar(s || 1).multiplyScalar(
|
|
1985
|
+
return this.divideScalar(s || 1).multiplyScalar(clamp$1(s, t, e));
|
|
1969
1986
|
}
|
|
1970
1987
|
floor() {
|
|
1971
1988
|
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
|
|
@@ -2092,8 +2109,8 @@ class Vector3 {
|
|
|
2092
2109
|
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
|
|
2093
2110
|
}
|
|
2094
2111
|
randomDirection() {
|
|
2095
|
-
const t =
|
|
2096
|
-
return this.x = s * Math.cos(
|
|
2112
|
+
const t = Math.random() * Math.PI * 2, e = 2 * Math.random() - 1, s = Math.sqrt(1 - e * e);
|
|
2113
|
+
return this.x = s * Math.cos(t), this.y = e, this.z = s * Math.sin(t), this;
|
|
2097
2114
|
}
|
|
2098
2115
|
*[Symbol.iterator]() {
|
|
2099
2116
|
yield this.x, yield this.y, yield this.z;
|
|
@@ -2213,30 +2230,41 @@ function isAOConcaveAngle(t, e, s) {
|
|
|
2213
2230
|
return (i[0] * r[0] + i[1] * r[1]) / Math.sqrt((i[0] * i[0] + i[1] * i[1]) * (r[0] * r[0] + r[1] * r[1])) > -0.866 && -i[1] * r[0] + i[0] * r[1] < 0;
|
|
2214
2231
|
}
|
|
2215
2232
|
new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3();
|
|
2216
|
-
const _centerIn = new Vector3$1(), _lastPosition = new Vector3$1(), _currentPosition = new Vector3$1(), _lineNormal = new Vector3$1(), _offset = new Vector3$1(), _segmentLines3D = (t, e, s, i, r, a, n, o, h, c, l, u, d, _) => {
|
|
2217
|
-
const
|
|
2218
|
-
let
|
|
2219
|
-
_centerIn.fromArray(
|
|
2220
|
-
let
|
|
2221
|
-
r.push(
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2233
|
+
const _centerIn = new Vector3$1(), _lastPosition = new Vector3$1(), _currentPosition = new Vector3$1(), _lineNormal = new Vector3$1(), _offset = new Vector3$1(), _segmentLines3D = (t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p) => {
|
|
2234
|
+
const f = d.targetCenter, y = d.targetProjection, { sourceProjectionName: g, targetProjectionName: M } = d;
|
|
2235
|
+
let x = 0;
|
|
2236
|
+
_centerIn.fromArray(f), _lastPosition.fromArray(n), _currentPosition.fromArray(o);
|
|
2237
|
+
let w = u.value;
|
|
2238
|
+
r.push(w, w), a.push(w, 1, w, 0);
|
|
2239
|
+
const S = y.getProjectedSurfaceNormal(_lastPosition, _lineNormal), C = _offset.copy(_currentPosition).sub(_lastPosition), E = _lineNormal.crossVectors(S, C).normalize();
|
|
2240
|
+
g !== M && (_lastPosition.sub(_centerIn), _currentPosition.sub(_centerIn)), s.push(E.x, E.y, E.z, -E.x, -E.y, -E.z), t.push(_lastPosition.x, _lastPosition.y, _lastPosition.z, _lastPosition.x, _lastPosition.y, _lastPosition.z), e.push(h, h), x += 2, l || (i.push(c + 0 - 2, c + 1 - 2, c + 2 - 2), i.push(c + 2 - 2, c + 1 - 2, c + 3 - 2)), i.push(c, c + 1, c + 2), s.push(E.x, E.y, E.z, -E.x, -E.y, -E.z), t.push(_currentPosition.x, _currentPosition.y, _currentPosition.z, _currentPosition.x, _currentPosition.y, _currentPosition.z), e.push(h, h);
|
|
2241
|
+
return w += (m && p ? getDistance(m, p) : getDistance(n, o)) / _, r.push(w, w), a.push(w, 1, w, 0), u.value = w, x += 2, i.push(c + 2, c + 1, c + 3), 4;
|
|
2224
2242
|
};
|
|
2225
|
-
function lineToMesh(t, e, s, i, r = 1) {
|
|
2226
|
-
let
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2243
|
+
function lineToMesh(t, e, s, i, r = 1, a) {
|
|
2244
|
+
let n = t;
|
|
2245
|
+
if (!Array.isArray(t[0])) {
|
|
2246
|
+
n = [];
|
|
2247
|
+
for (let e2 = 0; e2 < t.length; e2 += 3)
|
|
2248
|
+
n.push([t[e2], t[e2 + 1], t[e2 + 2]]);
|
|
2249
|
+
}
|
|
2250
|
+
let o = 0, h = null, c = null, l = null;
|
|
2251
|
+
const u = [], d = [], _ = [], m = [], p = [], f = [];
|
|
2252
|
+
let y;
|
|
2253
|
+
const g = { value: 0 }, M = a || n;
|
|
2254
|
+
let x = true;
|
|
2255
|
+
for (let t2 = 1, i2 = n.length - 1; t2 <= i2; t2++) {
|
|
2256
|
+
h = l || n[t2 - 1], c = n[t2];
|
|
2257
|
+
const i3 = l ? a ? a[n.indexOf(l)] : l : M[t2 - 1], y2 = M[t2], w = M[t2 + 1];
|
|
2258
|
+
if (w && isPointEqual(y2, w)) {
|
|
2259
|
+
l = h;
|
|
2234
2260
|
continue;
|
|
2235
2261
|
}
|
|
2236
|
-
let
|
|
2237
|
-
|
|
2262
|
+
let S = 0;
|
|
2263
|
+
S = _segmentLines3D(u, m, d, _, p, f, h, c, e, o, x, g, s, r, i3, y2), -1 !== S && (o += S, l = null), x = false;
|
|
2238
2264
|
}
|
|
2239
|
-
|
|
2265
|
+
for (let t2 = 0; t2 < f.length; t2++)
|
|
2266
|
+
t2 % 2 == 0 && (f[t2] = g.value - f[t2]);
|
|
2267
|
+
return i && (y = new Array(p.length).fill(g.value)), { vertices: u, indices: _, normals: d, widths: m, lengths: p, totalLengths: y, uvs: f };
|
|
2240
2268
|
}
|
|
2241
2269
|
function fillFlatArray(t, e, s) {
|
|
2242
2270
|
s || (s = e.length);
|
|
@@ -2251,11 +2279,14 @@ function reFetch(t = "", e = {}, s = 3) {
|
|
|
2251
2279
|
return s--, fetch(e2, i).then((t3) => {
|
|
2252
2280
|
if (200 === t3.status)
|
|
2253
2281
|
return t3;
|
|
2282
|
+
if (404 === t3.status)
|
|
2283
|
+
throw new Error("404");
|
|
2254
2284
|
}).catch((r) => {
|
|
2255
2285
|
if (i.signal && "AbortError" === r.name)
|
|
2256
2286
|
throw r;
|
|
2257
2287
|
if (s > 0)
|
|
2258
2288
|
return t2(e2, i);
|
|
2289
|
+
throw r;
|
|
2259
2290
|
});
|
|
2260
2291
|
}(t, e);
|
|
2261
2292
|
}
|
|
@@ -2666,14 +2697,14 @@ Rectangle.fromBox = function(t, e, s = false) {
|
|
|
2666
2697
|
}, Rectangle.MAX_VALUE = Object.freeze(new Rectangle(-Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, CesiumMath.PI_OVER_TWO));
|
|
2667
2698
|
const scaleToGeodeticSurfaceIntersection = new Vector3$1(), scaleToGeodeticSurfaceGradient = new Vector3$1();
|
|
2668
2699
|
function scaleToGeodeticSurface(t, e, s, i, r) {
|
|
2669
|
-
const a = t.x, n = t.y, o = t.z, h = e.x, c = e.y, l = e.z, u = a * a * h * h, d = n * n * c * c, _ = o * o * l * l, m = u + d + _,
|
|
2700
|
+
const a = t.x, n = t.y, o = t.z, h = e.x, c = e.y, l = e.z, u = a * a * h * h, d = n * n * c * c, _ = o * o * l * l, m = u + d + _, p = Math.sqrt(1 / m), f = scaleToGeodeticSurfaceIntersection.copy(t).multiplyScalar(p);
|
|
2670
2701
|
if (m < i)
|
|
2671
|
-
return r || (r = new Vector3$1()), isFinite(
|
|
2702
|
+
return r || (r = new Vector3$1()), isFinite(p) ? r.copy(f) : void 0;
|
|
2672
2703
|
const y = s.x, g = s.y, M = s.z, x = scaleToGeodeticSurfaceGradient;
|
|
2673
|
-
x.x =
|
|
2674
|
-
let w, S, C, E, P, b,
|
|
2704
|
+
x.x = f.x * y * 2, x.y = f.y * g * 2, x.z = f.z * M * 2;
|
|
2705
|
+
let w, S, C, E, P, b, A2, v, T, I, z, O = (1 - p) * t.length() / (0.5 * x.length()), N = 0;
|
|
2675
2706
|
do {
|
|
2676
|
-
O -= N, C = 1 / (1 + O * y), E = 1 / (1 + O * g), P = 1 / (1 + O * M), b = C * C,
|
|
2707
|
+
O -= N, C = 1 / (1 + O * y), E = 1 / (1 + O * g), P = 1 / (1 + O * M), b = C * C, A2 = E * E, v = P * P, T = b * C, I = A2 * E, z = v * P, w = u * b + d * A2 + _ * v - 1, S = u * T * y + d * I * g + _ * z * M, N = w / (-2 * S);
|
|
2677
2708
|
} while (Math.abs(w) > 1e-12);
|
|
2678
2709
|
return r ? (r.x = a * C, r.y = n * E, r.z = o * P, r) : new Vector3$1(a * C, n * E, o * P);
|
|
2679
2710
|
}
|
|
@@ -2832,8 +2863,8 @@ class StaticMatrix4 {
|
|
|
2832
2863
|
defined$1(i) || (i = new Matrix4()), t = defaultValue(t, defaultValue.EMPTY_OBJECT);
|
|
2833
2864
|
const r = defaultValue(t.x, 0), a = defaultValue(t.y, 0), n = defaultValue(t.width, 0), o = defaultValue(t.height, 0);
|
|
2834
2865
|
e = defaultValue(e, 0);
|
|
2835
|
-
const h = 0.5 * n, c = 0.5 * o, l = 0.5 * ((s = defaultValue(s, 1)) - e), u = h, d = c, _ = l, m = r + h,
|
|
2836
|
-
return y[0] = u, y[1] = 0, y[2] = 0, y[3] = 0, y[4] = 0, y[5] = d, y[6] = 0, y[7] = 0, y[8] = 0, y[9] = 0, y[10] = _, y[11] = 0, y[12] = m, y[13] =
|
|
2866
|
+
const h = 0.5 * n, c = 0.5 * o, l = 0.5 * ((s = defaultValue(s, 1)) - e), u = h, d = c, _ = l, m = r + h, p = a + c, f = e + l, y = i.elements;
|
|
2867
|
+
return y[0] = u, y[1] = 0, y[2] = 0, y[3] = 0, y[4] = 0, y[5] = d, y[6] = 0, y[7] = 0, y[8] = 0, y[9] = 0, y[10] = _, y[11] = 0, y[12] = m, y[13] = p, y[14] = f, y[15] = 1, i;
|
|
2837
2868
|
}
|
|
2838
2869
|
static equals(t, e) {
|
|
2839
2870
|
return t.equals(e);
|
|
@@ -2847,7 +2878,7 @@ class StaticMatrix4 {
|
|
|
2847
2878
|
}
|
|
2848
2879
|
static fromTranslationQuaternionRotationScale(t, e, s, i) {
|
|
2849
2880
|
i || (i = new Matrix4());
|
|
2850
|
-
const r = s.x, a = s.y, n = s.z, o = e.x * e.x, h = e.x * e.y, c = e.x * e.z, l = e.x * e.w, u = e.y * e.y, d = e.y * e.z, _ = e.y * e.w, m = e.z * e.z,
|
|
2881
|
+
const r = s.x, a = s.y, n = s.z, o = e.x * e.x, h = e.x * e.y, c = e.x * e.z, l = e.x * e.w, u = e.y * e.y, d = e.y * e.z, _ = e.y * e.w, m = e.z * e.z, p = e.z * e.w, f = e.w * e.w, y = o - u - m + f, g = 2 * (h - p), M = 2 * (c + _), x = 2 * (h + p), w = -o + u - m + f, S = 2 * (d - l), C = 2 * (c - _), E = 2 * (d + l), P = -o - u + m + f, b = i.elements;
|
|
2851
2882
|
return b[0] = y * r, b[1] = x * r, b[2] = C * r, b[3] = 0, b[4] = g * a, b[5] = w * a, b[6] = E * a, b[7] = 0, b[8] = M * n, b[9] = S * n, b[10] = P * n, b[11] = 0, b[12] = t.x, b[13] = t.y, b[14] = t.z, b[15] = 1, i;
|
|
2852
2883
|
}
|
|
2853
2884
|
}
|
|
@@ -2891,8 +2922,8 @@ Transforms.lnglatToEcef = lnglatToEcef, Transforms.radianToEcef = radianToEcef,
|
|
|
2891
2922
|
}, Transforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator("north", "east"), Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator("north", "up"), Transforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator("north", "west");
|
|
2892
2923
|
class StaticMatrix3 {
|
|
2893
2924
|
static fromQuaternion(t, e) {
|
|
2894
|
-
const s = t.x * t.x, i = t.x * t.y, r = t.x * t.z, a = t.x * t.w, n = t.y * t.y, o = t.y * t.z, h = t.y * t.w, c = t.z * t.z, l = t.z * t.w, u = t.w * t.w, d = s - n - c + u, _ = 2 * (i - l), m = 2 * (r + h),
|
|
2895
|
-
return e || (e = new Matrix3()), e.set(d, _, m,
|
|
2925
|
+
const s = t.x * t.x, i = t.x * t.y, r = t.x * t.z, a = t.x * t.w, n = t.y * t.y, o = t.y * t.z, h = t.y * t.w, c = t.z * t.z, l = t.z * t.w, u = t.w * t.w, d = s - n - c + u, _ = 2 * (i - l), m = 2 * (r + h), p = 2 * (i + l), f = -s + n - c + u, y = 2 * (o - a), g = 2 * (r - h), M = 2 * (o + a), x = -s - n + c + u;
|
|
2926
|
+
return e || (e = new Matrix3()), e.set(d, _, m, p, f, y, g, M, x), e;
|
|
2896
2927
|
}
|
|
2897
2928
|
static getColumn(t, e, s) {
|
|
2898
2929
|
const i = t.elements, r = 3 * e, a = i[r], n = i[r + 1], o = i[r + 2];
|
|
@@ -2916,8 +2947,8 @@ class StaticMatrix3 {
|
|
|
2916
2947
|
}
|
|
2917
2948
|
static multiply(t, e, s) {
|
|
2918
2949
|
s || (s = new Matrix3());
|
|
2919
|
-
const i = t.elements, r = e.elements, a = s.elements, n = i[0], o = i[3], h = i[6], c = i[1], l = i[4], u = i[7], d = i[2], _ = i[5], m = i[8],
|
|
2920
|
-
return a[0] = n *
|
|
2950
|
+
const i = t.elements, r = e.elements, a = s.elements, n = i[0], o = i[3], h = i[6], c = i[1], l = i[4], u = i[7], d = i[2], _ = i[5], m = i[8], p = r[0], f = r[3], y = r[6], g = r[1], M = r[4], x = r[7], w = r[2], S = r[5], C = r[8];
|
|
2951
|
+
return a[0] = n * p + o * g + h * w, a[3] = n * f + o * M + h * S, a[6] = n * y + o * x + h * C, a[1] = c * p + l * g + u * w, a[4] = c * f + l * M + u * S, a[7] = c * y + l * x + u * C, a[2] = d * p + _ * g + m * w, a[5] = d * f + _ * M + m * S, a[8] = d * y + _ * x + m * C, s;
|
|
2921
2952
|
}
|
|
2922
2953
|
static clone(t, e) {
|
|
2923
2954
|
if (defined$1(t))
|
|
@@ -2975,20 +3006,20 @@ QuadraticRealPolynomial.computeDiscriminant = function(t, e, s) {
|
|
|
2975
3006
|
};
|
|
2976
3007
|
var CubicRealPolynomial = {};
|
|
2977
3008
|
function computeRealRoots(t, e, s, i) {
|
|
2978
|
-
var r, a, n = t, o = e / 3, h = s / 3, c = i, l = n * h, u = o * c, d = o * o, _ = h * h, m = n * h - d,
|
|
3009
|
+
var r, a, n = t, o = e / 3, h = s / 3, c = i, l = n * h, u = o * c, d = o * o, _ = h * h, m = n * h - d, p = n * c - o * h, f = o * c - _, y = 4 * m * f - p * p;
|
|
2979
3010
|
if (y < 0) {
|
|
2980
3011
|
var g, M, x;
|
|
2981
|
-
d * u >= l * _ ? (g = n, M = m, x = -2 * o * m + n *
|
|
3012
|
+
d * u >= l * _ ? (g = n, M = m, x = -2 * o * m + n * p) : (g = c, M = f, x = -c * p + 2 * h * f);
|
|
2982
3013
|
var w = -(x < 0 ? -1 : 1) * Math.abs(g) * Math.sqrt(-y), S = (a = -x + w) / 2, C = S < 0 ? -Math.pow(-S, 1 / 3) : Math.pow(S, 1 / 3), E = a === w ? -C : -M / C;
|
|
2983
3014
|
return r = M <= 0 ? C + E : -x / (C * C + E * E + M), d * u >= l * _ ? [(r - o) / n] : [-c / (r + h)];
|
|
2984
3015
|
}
|
|
2985
|
-
var P = m, b = -2 * o * m + n *
|
|
3016
|
+
var P = m, b = -2 * o * m + n * p, A2 = f, v = -c * p + 2 * h * f, T = Math.sqrt(y), I = Math.sqrt(3) / 2, z = Math.abs(Math.atan2(n * T, -b) / 3);
|
|
2986
3017
|
r = 2 * Math.sqrt(-P);
|
|
2987
3018
|
var O = Math.cos(z);
|
|
2988
3019
|
a = r * O;
|
|
2989
3020
|
var N = r * (-O / 2 - I * Math.sin(z)), G = a + N > 2 * o ? a - o : N - o, R = n, L = G / R;
|
|
2990
|
-
z = Math.abs(Math.atan2(c * T, -
|
|
2991
|
-
var $ = -c, V = (a = (r = 2 * Math.sqrt(-
|
|
3021
|
+
z = Math.abs(Math.atan2(c * T, -v) / 3);
|
|
3022
|
+
var $ = -c, V = (a = (r = 2 * Math.sqrt(-A2)) * (O = Math.cos(z))) + (N = r * (-O / 2 - I * Math.sin(z))) < 2 * h ? a + h : N + h, q = $ / V, j = -G * V - R * $, D = (h * j - o * (G * $)) / (-o * j + h * (R * V));
|
|
2992
3023
|
return L <= D ? L <= q ? D <= q ? [L, D, q] : [L, q, D] : [q, L, D] : L <= q ? [D, L, q] : D <= q ? [D, q, L] : [q, D, L];
|
|
2993
3024
|
}
|
|
2994
3025
|
CubicRealPolynomial.computeDiscriminant = function(t, e, s, i) {
|
|
@@ -3035,8 +3066,8 @@ function original(t, e, s, i) {
|
|
|
3035
3066
|
if (2 === u.length) {
|
|
3036
3067
|
var d, _ = u[0], m = u[1];
|
|
3037
3068
|
if (_ >= 0 && m >= 0) {
|
|
3038
|
-
var
|
|
3039
|
-
return [c -
|
|
3069
|
+
var p = Math.sqrt(_), f = Math.sqrt(m);
|
|
3070
|
+
return [c - f, c - p, c + p, c + f];
|
|
3040
3071
|
}
|
|
3041
3072
|
if (_ >= 0 && m < 0)
|
|
3042
3073
|
return [c - (d = Math.sqrt(_)), c + d];
|
|
@@ -3055,20 +3086,20 @@ function original(t, e, s, i) {
|
|
|
3055
3086
|
function neumark(t, e, s, i) {
|
|
3056
3087
|
var r = t * t, a = -2 * e, n = s * t + e * e - 4 * i, o = r * i - s * e * t + s * s, h = CubicRealPolynomial.computeRealRoots(1, a, n, o);
|
|
3057
3088
|
if (h.length > 0) {
|
|
3058
|
-
var c, l, u, d, _, m,
|
|
3059
|
-
if (
|
|
3089
|
+
var c, l, u, d, _, m, p = h[0], f = e - p, y = f * f, g = t / 2, M = f / 2, x = y - 4 * i, w = y + 4 * Math.abs(i), S = r - 4 * p, C = r + 4 * Math.abs(p);
|
|
3090
|
+
if (p < 0 || x * C < S * w) {
|
|
3060
3091
|
var E = Math.sqrt(S);
|
|
3061
3092
|
c = E / 2, l = 0 === E ? 0 : (t * M - s) / E;
|
|
3062
3093
|
} else {
|
|
3063
3094
|
var P = Math.sqrt(x);
|
|
3064
3095
|
c = 0 === P ? 0 : (t * M - s) / P, l = P / 2;
|
|
3065
3096
|
}
|
|
3066
|
-
0 === g && 0 === c ? (u = 0, d = 0) : CesiumMath.sign(g) === CesiumMath.sign(c) ? d =
|
|
3067
|
-
var b = QuadraticRealPolynomial.computeRealRoots(1, u, _),
|
|
3097
|
+
0 === g && 0 === c ? (u = 0, d = 0) : CesiumMath.sign(g) === CesiumMath.sign(c) ? d = p / (u = g + c) : u = p / (d = g - c), 0 === M && 0 === l ? (_ = 0, m = 0) : CesiumMath.sign(M) === CesiumMath.sign(l) ? m = i / (_ = M + l) : _ = i / (m = M - l);
|
|
3098
|
+
var b = QuadraticRealPolynomial.computeRealRoots(1, u, _), A2 = QuadraticRealPolynomial.computeRealRoots(1, d, m);
|
|
3068
3099
|
if (0 !== b.length)
|
|
3069
|
-
return 0 !==
|
|
3070
|
-
if (0 !==
|
|
3071
|
-
return
|
|
3100
|
+
return 0 !== A2.length ? b[1] <= A2[0] ? [b[0], b[1], A2[0], A2[1]] : A2[1] <= b[0] ? [A2[0], A2[1], b[0], b[1]] : b[0] >= A2[0] && b[1] <= A2[1] ? [A2[0], b[0], b[1], A2[1]] : A2[0] >= b[0] && A2[1] <= b[1] ? [b[0], A2[0], A2[1], b[1]] : b[0] > A2[0] && b[0] < A2[1] ? [A2[0], b[0], A2[1], b[1]] : [b[0], A2[0], b[1], A2[1]] : b;
|
|
3101
|
+
if (0 !== A2.length)
|
|
3102
|
+
return A2;
|
|
3072
3103
|
}
|
|
3073
3104
|
return [];
|
|
3074
3105
|
}
|
|
@@ -3145,24 +3176,24 @@ IntersectionTests.rayTriangleParametric = function(t, e, s, i, r) {
|
|
|
3145
3176
|
if (!defined$1(i))
|
|
3146
3177
|
throw new DeveloperError("p2 is required.");
|
|
3147
3178
|
r = defaultValue(r, false);
|
|
3148
|
-
var a, n, o, h, c, l = t.origin, u = t.direction, d = Cartesian3.subtract(s, e, scratchEdge0), _ = Cartesian3.subtract(i, e, scratchEdge1), m = Cartesian3.cross(u, _, scratchPVec),
|
|
3179
|
+
var a, n, o, h, c, l = t.origin, u = t.direction, d = Cartesian3.subtract(s, e, scratchEdge0), _ = Cartesian3.subtract(i, e, scratchEdge1), m = Cartesian3.cross(u, _, scratchPVec), p = Cartesian3.dot(d, m);
|
|
3149
3180
|
if (r) {
|
|
3150
|
-
if (
|
|
3181
|
+
if (p < CesiumMath.EPSILON6)
|
|
3151
3182
|
return;
|
|
3152
|
-
if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m)) < 0 || o >
|
|
3183
|
+
if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m)) < 0 || o > p)
|
|
3153
3184
|
return;
|
|
3154
|
-
if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n)) < 0 || o + h >
|
|
3185
|
+
if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n)) < 0 || o + h > p)
|
|
3155
3186
|
return;
|
|
3156
|
-
c = Cartesian3.dot(_, n) /
|
|
3187
|
+
c = Cartesian3.dot(_, n) / p;
|
|
3157
3188
|
} else {
|
|
3158
|
-
if (Math.abs(
|
|
3189
|
+
if (Math.abs(p) < CesiumMath.EPSILON6)
|
|
3159
3190
|
return;
|
|
3160
|
-
var
|
|
3161
|
-
if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m) *
|
|
3191
|
+
var f = 1 / p;
|
|
3192
|
+
if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m) * f) < 0 || o > 1)
|
|
3162
3193
|
return;
|
|
3163
|
-
if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n) *
|
|
3194
|
+
if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n) * f) < 0 || o + h > 1)
|
|
3164
3195
|
return;
|
|
3165
|
-
c = Cartesian3.dot(_, n) *
|
|
3196
|
+
c = Cartesian3.dot(_, n) * f;
|
|
3166
3197
|
}
|
|
3167
3198
|
return c;
|
|
3168
3199
|
}, IntersectionTests.rayTriangle = function(t, e, s, i, r, a) {
|
|
@@ -3239,10 +3270,10 @@ function quadraticVectorExpression(t, e, s, i, r) {
|
|
|
3239
3270
|
if (0 === d && 0 === u) {
|
|
3240
3271
|
if (0 === (a = QuadraticRealPolynomial.computeRealRoots(h, c, l)).length)
|
|
3241
3272
|
return _;
|
|
3242
|
-
var m = a[0],
|
|
3243
|
-
if (_.push(new Vector3$1(i, r * m, r * -
|
|
3244
|
-
var
|
|
3245
|
-
_.push(new Vector3$1(i, r *
|
|
3273
|
+
var m = a[0], p = Math.sqrt(Math.max(1 - m * m, 0));
|
|
3274
|
+
if (_.push(new Vector3$1(i, r * m, r * -p)), _.push(new Vector3$1(i, r * m, r * p)), 2 === a.length) {
|
|
3275
|
+
var f = a[1], y = Math.sqrt(Math.max(1 - f * f, 0));
|
|
3276
|
+
_.push(new Vector3$1(i, r * f, r * -y)), _.push(new Vector3$1(i, r * f, r * y));
|
|
3246
3277
|
}
|
|
3247
3278
|
return _;
|
|
3248
3279
|
}
|
|
@@ -3252,9 +3283,9 @@ function quadraticVectorExpression(t, e, s, i, r) {
|
|
|
3252
3283
|
var b = (a = QuarticRealPolynomial.computeRealRoots(w, S, C, E, P)).length;
|
|
3253
3284
|
if (0 === b)
|
|
3254
3285
|
return _;
|
|
3255
|
-
for (var
|
|
3256
|
-
var
|
|
3257
|
-
O < 0 ? _.push(new Vector3$1(i, r *
|
|
3286
|
+
for (var A2 = 0; A2 < b; ++A2) {
|
|
3287
|
+
var v = a[A2], T = v * v, I = Math.max(1 - T, 0), z = Math.sqrt(I), O = (CesiumMath.sign(h) === CesiumMath.sign(l) ? addWithCancellationCheck(h * T + l, c * v, CesiumMath.EPSILON12) : CesiumMath.sign(l) === CesiumMath.sign(c * v) ? addWithCancellationCheck(h * T, c * v + l, CesiumMath.EPSILON12) : addWithCancellationCheck(h * T + c * v, l, CesiumMath.EPSILON12)) * addWithCancellationCheck(u * v, d, CesiumMath.EPSILON15);
|
|
3288
|
+
O < 0 ? _.push(new Vector3$1(i, r * v, r * z)) : O > 0 ? _.push(new Vector3$1(i, r * v, r * -z)) : 0 !== z ? (_.push(new Vector3$1(i, r * v, r * -z)), _.push(new Vector3$1(i, r * v, r * z)), ++A2) : _.push(new Vector3$1(i, r * v, r * z));
|
|
3258
3289
|
}
|
|
3259
3290
|
return _;
|
|
3260
3291
|
}
|
|
@@ -3275,8 +3306,8 @@ IntersectionTests.rayEllipsoid = function(t, e) {
|
|
|
3275
3306
|
var _ = (n = -u + Math.sqrt(a)) / i, m = s / n;
|
|
3276
3307
|
return _ < m ? new Interval(_, m) : { start: m, stop: _ };
|
|
3277
3308
|
}
|
|
3278
|
-
var
|
|
3279
|
-
return new Interval(
|
|
3309
|
+
var p = Math.sqrt(s / i);
|
|
3310
|
+
return new Interval(p, p);
|
|
3280
3311
|
}
|
|
3281
3312
|
return l < 1 ? (s = l - 1, a = u * u - (r = (i = Cartesian3.magnitudeSquared(c)) * s), new Interval(0, (n = -u + Math.sqrt(a)) / i)) : u < 0 ? new Interval(0, -u / (i = Cartesian3.magnitudeSquared(c))) : void 0;
|
|
3282
3313
|
};
|
|
@@ -3294,17 +3325,17 @@ IntersectionTests.grazingAltitudeLocation = function(t, e) {
|
|
|
3294
3325
|
}
|
|
3295
3326
|
var a = defined$1(this.rayEllipsoid(t, e)), n = e.transformPositionToScaledSpace(i, firstAxisScratch), o = Cartesian3.normalize(n, n), h = Cartesian3.mostOrthogonalAxis(n, referenceScratch), c = Cartesian3.normalize(Cartesian3.cross(h, o, secondAxisScratch), secondAxisScratch), l = Cartesian3.normalize(Cartesian3.cross(o, c, thirdAxisScratch), thirdAxisScratch), u = bScratch;
|
|
3296
3327
|
u[0] = o.x, u[1] = o.y, u[2] = o.z, u[3] = c.x, u[4] = c.y, u[5] = c.z, u[6] = l.x, u[7] = l.y, u[8] = l.z;
|
|
3297
|
-
var d = StaticMatrix3.transpose(u, btScratch), _ = StaticMatrix3.fromScale(e.radii, diScratch), m = StaticMatrix3.fromScale(e.oneOverRadii, dScratch),
|
|
3298
|
-
|
|
3299
|
-
var
|
|
3328
|
+
var d = StaticMatrix3.transpose(u, btScratch), _ = StaticMatrix3.fromScale(e.radii, diScratch), m = StaticMatrix3.fromScale(e.oneOverRadii, dScratch), p = cScratch;
|
|
3329
|
+
p[0] = 0, p[1] = -i.z, p[2] = i.y, p[3] = i.z, p[4] = 0, p[5] = -i.x, p[6] = -i.y, p[7] = i.x, p[8] = 0;
|
|
3330
|
+
var f, y, g = StaticMatrix3.multiply(StaticMatrix3.multiply(d, m, tempMatrix), p, tempMatrix), M = StaticMatrix3.multiply(StaticMatrix3.multiply(g, _, aScratch), u, aScratch), x = StaticMatrix3.multiplyByVector(g, s, bCart), w = quadraticVectorExpression(M, Cartesian3.negate(x, firstAxisScratch), 0, 0, 1), S = w.length;
|
|
3300
3331
|
if (S > 0) {
|
|
3301
3332
|
for (var C = Cartesian3.clone(Cartesian3.ZERO, closestScratch), E = Number.NEGATIVE_INFINITY, P = 0; P < S; ++P) {
|
|
3302
|
-
|
|
3303
|
-
var b = Cartesian3.normalize(Cartesian3.subtract(
|
|
3304
|
-
|
|
3333
|
+
f = StaticMatrix3.multiplyByVector(_, StaticMatrix3.multiplyByVector(u, w[P], sScratch), sScratch);
|
|
3334
|
+
var b = Cartesian3.normalize(Cartesian3.subtract(f, s, referenceScratch), referenceScratch), A2 = Cartesian3.dot(b, i);
|
|
3335
|
+
A2 > E && (E = A2, C = Cartesian3.clone(f, C));
|
|
3305
3336
|
}
|
|
3306
|
-
var
|
|
3307
|
-
return E = CesiumMath.clamp(E, 0, 1), y = Cartesian3.magnitude(Cartesian3.subtract(C, s, referenceScratch)) * Math.sqrt(1 - E * E), y = a ? -y : y,
|
|
3337
|
+
var v = e.cartesianToCartographic(C, surfPointScratch);
|
|
3338
|
+
return E = CesiumMath.clamp(E, 0, 1), y = Cartesian3.magnitude(Cartesian3.subtract(C, s, referenceScratch)) * Math.sqrt(1 - E * E), y = a ? -y : y, v.z = y, e.cartographicToCartesian(v, new Vector3$1());
|
|
3308
3339
|
}
|
|
3309
3340
|
};
|
|
3310
3341
|
var lineSegmentPlaneDifference = new Vector3$1();
|
|
@@ -3543,8 +3574,8 @@ function getLineIntersection(t, e, s, i, r, a) {
|
|
|
3543
3574
|
const n = t.x, o = t.y, h = e.x, c = e.y, l = s.x, u = s.y, d = i.x, _ = i.y, m = (n - h) * (u - _) - (o - c) * (l - d);
|
|
3544
3575
|
if (Math.abs(m) < 1e-4)
|
|
3545
3576
|
return null;
|
|
3546
|
-
const
|
|
3547
|
-
return
|
|
3577
|
+
const p = ((n - l) * (u - _) - (o - u) * (l - d)) / m, f = -((n - h) * (o - u) - (o - c) * (n - l)) / m;
|
|
3578
|
+
return p >= 0 && p <= 1 && f >= 0 && f <= 1 ? { point: t.clone().lerp(e, p), uv: r.clone().lerp(a, p) } : null;
|
|
3548
3579
|
}
|
|
3549
3580
|
function isPointInTriangle(t, e, s, i) {
|
|
3550
3581
|
const r = s.x - e.x, a = s.y - e.y, n = i.x - e.x, o = i.y - e.y, h = t.x - e.x, c = t.y - e.y, l = r * o - a * n, u = (h * o - c * n) / l, d = (r * c - a * h) / l;
|
|
@@ -3567,19 +3598,19 @@ function calculateIntersection(t, e, s) {
|
|
|
3567
3598
|
i[s2] || (i[s2] = { point: t2, uv: e[r2] });
|
|
3568
3599
|
}
|
|
3569
3600
|
});
|
|
3570
|
-
const r = Math.min(t[0].x, Math.min(t[1].x, t[2].x)), a = Math.max(t[0].x, Math.max(t[1].x, t[2].x)), n = Math.min(t[0].y, Math.min(t[1].y, t[2].y)), o = Math.max(t[0].y, Math.max(t[1].y, t[2].y)), h = Math.min(e[0].x, Math.min(e[1].x, e[2].x)), c = Math.max(e[0].x, Math.max(e[1].x, e[2].x)), l = Math.min(e[0].y, Math.min(e[1].y, e[2].y)), u = Math.max(e[0].y, Math.max(e[1].y, e[2].y)), d = a - r, _ = o - n, m = c - h,
|
|
3601
|
+
const r = Math.min(t[0].x, Math.min(t[1].x, t[2].x)), a = Math.max(t[0].x, Math.max(t[1].x, t[2].x)), n = Math.min(t[0].y, Math.min(t[1].y, t[2].y)), o = Math.max(t[0].y, Math.max(t[1].y, t[2].y)), h = Math.min(e[0].x, Math.min(e[1].x, e[2].x)), c = Math.max(e[0].x, Math.max(e[1].x, e[2].x)), l = Math.min(e[0].y, Math.min(e[1].y, e[2].y)), u = Math.max(e[0].y, Math.max(e[1].y, e[2].y)), d = a - r, _ = o - n, m = c - h, p = u - l;
|
|
3571
3602
|
s.forEach((e2) => {
|
|
3572
3603
|
if (isPointInTriangle(e2, ...t)) {
|
|
3573
3604
|
const t2 = e2.x + "," + e2.y + "," + e2.z;
|
|
3574
3605
|
if (!i[t2]) {
|
|
3575
|
-
const s2 = h + m * (e2.x - r) / d, a2 = l +
|
|
3606
|
+
const s2 = h + m * (e2.x - r) / d, a2 = l + p * (e2.y - n) / _;
|
|
3576
3607
|
i[t2] = { point: e2, uv: new Vector2(s2, a2) };
|
|
3577
3608
|
}
|
|
3578
3609
|
}
|
|
3579
3610
|
});
|
|
3580
|
-
const
|
|
3611
|
+
const f = getRectangleEdges(s);
|
|
3581
3612
|
return [[0, 1], [1, 2], [2, 0]].forEach(([s2, r2]) => {
|
|
3582
|
-
|
|
3613
|
+
f.forEach(([a2, n2]) => {
|
|
3583
3614
|
const o2 = getLineIntersection(t[s2], t[r2], a2, n2, e[s2], e[r2]);
|
|
3584
3615
|
if (o2) {
|
|
3585
3616
|
const { point: t2 } = o2, e2 = t2.x + "," + t2.y + "," + t2.z;
|
|
@@ -3637,17 +3668,17 @@ const subdivisionMidScratch = new Vector3$1(), subdivisionT0Scratch = new Vector
|
|
|
3637
3668
|
} else
|
|
3638
3669
|
u = s.slice(0);
|
|
3639
3670
|
}
|
|
3640
|
-
const d = [], _ = {}, m = {},
|
|
3671
|
+
const d = [], _ = {}, m = {}, p = i * i;
|
|
3641
3672
|
for (; o.length > 0; ) {
|
|
3642
|
-
const t2 = o.pop(), e2 = o.pop(), s2 = o.pop(), i2 = subdivisionV0Scratch.fromArray(l, 3 * s2), c2 = subdivisionV1Scratch.fromArray(l, 3 * e2),
|
|
3673
|
+
const t2 = o.pop(), e2 = o.pop(), s2 = o.pop(), i2 = subdivisionV0Scratch.fromArray(l, 3 * s2), c2 = subdivisionV1Scratch.fromArray(l, 3 * e2), f = subdivisionV2Scratch.fromArray(l, 3 * t2);
|
|
3643
3674
|
let y, g, M;
|
|
3644
3675
|
n && (y = subdivisionT0Scratch.fromArray(u, 2 * s2), g = subdivisionT1Scratch.fromArray(u, 2 * e2), M = subdivisionT2Scratch.fromArray(u, 2 * t2));
|
|
3645
|
-
const x = Cartesian3.magnitudeSquared(Cartesian3.subtract(i2, c2, subdivisionMidScratch)), w = Cartesian3.magnitudeSquared(Cartesian3.subtract(c2,
|
|
3676
|
+
const x = Cartesian3.magnitudeSquared(Cartesian3.subtract(i2, c2, subdivisionMidScratch)), w = Cartesian3.magnitudeSquared(Cartesian3.subtract(c2, f, subdivisionMidScratch)), S = Cartesian3.magnitudeSquared(Cartesian3.subtract(f, i2, subdivisionMidScratch)), C = Math.max(x, w, S);
|
|
3646
3677
|
let E, P, b;
|
|
3647
|
-
if (C >
|
|
3648
|
-
x === C ? (E = `${Math.min(s2, e2)} ${Math.max(s2, e2)}`, h = _[E], null == h && (P = Cartesian3.add(i2, c2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(y, g, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(s2, h, t2), o.push(h, e2, t2)) : w === C ? (E = `${Math.min(e2, t2)} ${Math.max(e2, t2)}`, h = _[E], h || (P = Cartesian3.add(c2,
|
|
3678
|
+
if (C > p)
|
|
3679
|
+
x === C ? (E = `${Math.min(s2, e2)} ${Math.max(s2, e2)}`, h = _[E], null == h && (P = Cartesian3.add(i2, c2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(y, g, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(s2, h, t2), o.push(h, e2, t2)) : w === C ? (E = `${Math.min(e2, t2)} ${Math.max(e2, t2)}`, h = _[E], h || (P = Cartesian3.add(c2, f, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(g, M, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(e2, h, s2), o.push(h, t2, s2)) : S === C && (E = `${Math.min(t2, s2)} ${Math.max(t2, s2)}`, h = _[E], h || (P = Cartesian3.add(f, i2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(M, y, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(t2, h, e2), o.push(h, s2, e2));
|
|
3649
3680
|
else {
|
|
3650
|
-
if (subdivideWithRange([i2, c2,
|
|
3681
|
+
if (subdivideWithRange([i2, c2, f], [y, g, M], [s2, e2, t2], n, l, u, o, a, m))
|
|
3651
3682
|
continue;
|
|
3652
3683
|
d.push(s2 + r), d.push(e2 + r), d.push(t2 + r);
|
|
3653
3684
|
}
|
|
@@ -3656,26 +3687,26 @@ const subdivisionMidScratch = new Vector3$1(), subdivisionT0Scratch = new Vector
|
|
|
3656
3687
|
}, _pointIn$1 = new Vector3$1(), _pointOut$1 = new Vector3$1(), reprojectCoordinate = (t, e, s, i, r, a) => {
|
|
3657
3688
|
let n = CoordTransformer.canTransform(t, e);
|
|
3658
3689
|
return s !== i && s && i || n ? (s.unprojectCoordinate(r, _pointOut$1), n ? CoordTransformer.transform(t, e, _pointOut$1, _pointIn$1) : _pointIn$1.copy(_pointOut$1), i.projectCoordinate(_pointIn$1, a), a) : (a.copy(r), a);
|
|
3659
|
-
}, projectVertices = (t, e, s = true, i = true) => {
|
|
3660
|
-
if (!e.forceProjectCoordinates && e.targetProjectionName === e.sourceProjectionName)
|
|
3690
|
+
}, projectVertices = (t, e, s = true, i = true, r = false) => {
|
|
3691
|
+
if (!e.forceProjectCoordinates && !r && e.targetProjectionName === e.sourceProjectionName)
|
|
3661
3692
|
return;
|
|
3662
|
-
const
|
|
3663
|
-
let
|
|
3664
|
-
if (
|
|
3665
|
-
const t2 =
|
|
3666
|
-
|
|
3693
|
+
const a = e.sourceProjection, n = e.targetProjection, o = e.sourceCoordType, h = e.targetCoordType, [c, l, u] = e.targetCenter, d = e.forceUseGeoBoundingBox || a.isGeo, _ = d ? e.geoBoundingBox : e.projectedBoundingBox;
|
|
3694
|
+
let m, p, f, y;
|
|
3695
|
+
if (_.isBox3) {
|
|
3696
|
+
const t2 = _.min, e2 = _.max;
|
|
3697
|
+
m = t2.x, p = t2.y, f = e2.x, y = e2.y;
|
|
3667
3698
|
} else
|
|
3668
|
-
[
|
|
3669
|
-
const
|
|
3699
|
+
[m, p, , f, y] = _;
|
|
3700
|
+
const g = f - m, M = y - p;
|
|
3670
3701
|
if (s)
|
|
3671
3702
|
for (let e2 = 0, s2 = t.length - 2; e2 < s2; e2 += 3) {
|
|
3672
|
-
const s3 = t[e2],
|
|
3673
|
-
_pointIn$1.set(
|
|
3703
|
+
const s3 = t[e2], r2 = t[e2 + 1], _2 = t[e2 + 2];
|
|
3704
|
+
_pointIn$1.set(m + (s3 + 0.5) * g, p + (r2 + 0.5) * M, _2), d ? (o !== h && CoordTransformer.transform(o, h, _pointIn$1, _pointIn$1), n.projectCoordinate(_pointIn$1, _pointOut$1)) : reprojectCoordinate(o, h, a, n, _pointIn$1, _pointOut$1), t[e2] = _pointOut$1.x, t[e2 + 1] = _pointOut$1.y, t[e2 + 2] = _pointOut$1.z, i && (t[e2] -= c, t[e2 + 1] -= l, t[e2 + 2] -= u);
|
|
3674
3705
|
}
|
|
3675
3706
|
else
|
|
3676
3707
|
for (let e2 = 0, s2 = t.length; e2 < s2; e2 += 1) {
|
|
3677
|
-
const s3 = t[e2],
|
|
3678
|
-
_pointIn$1.set(
|
|
3708
|
+
const s3 = t[e2], r2 = s3[0], _2 = s3[1], f2 = s3[2];
|
|
3709
|
+
_pointIn$1.set(m + (r2 + 0.5) * g, p + (_2 + 0.5) * M, f2), d ? (o !== h && CoordTransformer.transform(o, h, _pointIn$1, _pointIn$1), n.projectCoordinate(_pointIn$1, _pointOut$1)) : reprojectCoordinate(o, h, a, n, _pointIn$1, _pointOut$1), s3[0] = _pointOut$1.x, s3[1] = _pointOut$1.y, s3[2] = _pointOut$1.z, i && (s3[0] -= c, s3[1] -= l, s3[2] -= u);
|
|
3679
3710
|
}
|
|
3680
3711
|
}, subdivideVertices = (t, e, s, i) => {
|
|
3681
3712
|
if (i.sourceProjectionName === i.targetProjectionName)
|
|
@@ -3798,9 +3829,9 @@ class OrientedBoundingBox {
|
|
|
3798
3829
|
intersectsObb(t) {
|
|
3799
3830
|
const e = this.center, s = t.center, i = this.halfAxes, r = t.halfAxes, a = new Vector3$1().subVectors(s, e), n = new Vector3$1(i.elements[0], i.elements[1], i.elements[2]), o = new Vector3$1(i.elements[3], i.elements[4], i.elements[5]), h = new Vector3$1(i.elements[6], i.elements[7], i.elements[8]), c = new Vector3$1(r.elements[0], r.elements[1], r.elements[2]), l = new Vector3$1(r.elements[3], r.elements[4], r.elements[5]), u = new Vector3$1(r.elements[6], r.elements[7], r.elements[8]), d = n.length(), _ = o.length(), m = h.length();
|
|
3800
3831
|
n.normalize(), o.normalize(), h.normalize();
|
|
3801
|
-
const
|
|
3832
|
+
const p = c.length(), f = l.length(), y = u.length();
|
|
3802
3833
|
let g, M, x;
|
|
3803
|
-
return c.normalize(), l.normalize(), u.normalize(), g = d, M =
|
|
3834
|
+
return c.normalize(), l.normalize(), u.normalize(), g = d, M = p * Math.abs(n.dot(c)) + f * Math.abs(n.dot(l)) + y * Math.abs(n.dot(u)), x = Math.abs(a.dot(n)), !(x > g + M) && (g = _, M = p * Math.abs(o.dot(c)) + f * Math.abs(o.dot(l)) + y * Math.abs(o.dot(u)), x = Math.abs(a.dot(o)), !(x > g + M) && (g = m, M = p * Math.abs(h.dot(c)) + f * Math.abs(h.dot(l)) + y * Math.abs(h.dot(u)), x = Math.abs(a.dot(h)), !(x > g + M) && (g = d * Math.abs(c.dot(n)) + _ * Math.abs(c.dot(o)) + m * Math.abs(c.dot(h)), M = p, x = Math.abs(a.dot(c)), !(x > g + M) && (g = d * Math.abs(l.dot(n)) + _ * Math.abs(l.dot(o)) + m * Math.abs(l.dot(h)), M = f, x = Math.abs(a.dot(l)), !(x > g + M) && (g = d * Math.abs(u.dot(n)) + _ * Math.abs(u.dot(o)) + m * Math.abs(u.dot(h)), M = y, x = Math.abs(a.dot(u)), !(x > g + M))))));
|
|
3804
3835
|
}
|
|
3805
3836
|
}
|
|
3806
3837
|
const scratchOffset = new Vector3$1(), scratchScale = new Vector3$1();
|
|
@@ -3831,21 +3862,21 @@ OrientedBoundingBox.fromRectangle = function(t, e, s, i, r) {
|
|
|
3831
3862
|
if (e = defaultValue(e, 0), s = defaultValue(s, 0), i = defaultValue(i, Ellipsoid.WGS84), t.width <= CesiumMath.PI) {
|
|
3832
3863
|
const d2 = Rectangle.center(t, scratchRectangleCenterCartographic), _2 = i.cartographicToCartesian(d2, scratchRectangleCenter), m2 = new EllipsoidTangentPlane(_2, i);
|
|
3833
3864
|
u = m2.plane;
|
|
3834
|
-
const
|
|
3865
|
+
const p2 = d2.x, f2 = t.south < 0 && t.north > 0 ? 0 : d2.y, y2 = Cartographic.fromRadians(p2, t.north, s, scratchPerimeterCartographicNC), g2 = Cartographic.fromRadians(t.west, t.north, s, scratchPerimeterCartographicNW), M2 = Cartographic.fromRadians(t.west, f2, s, scratchPerimeterCartographicCW), x2 = Cartographic.fromRadians(t.west, t.south, s, scratchPerimeterCartographicSW), w2 = Cartographic.fromRadians(p2, t.south, s, scratchPerimeterCartographicSC), S = i.cartographicToCartesian(y2, scratchPerimeterCartesianNC);
|
|
3835
3866
|
let C = i.cartographicToCartesian(g2, scratchPerimeterCartesianNW);
|
|
3836
3867
|
const E = i.cartographicToCartesian(M2, scratchPerimeterCartesianCW);
|
|
3837
3868
|
let P = i.cartographicToCartesian(x2, scratchPerimeterCartesianSW);
|
|
3838
|
-
const b = i.cartographicToCartesian(w2, scratchPerimeterCartesianSC),
|
|
3839
|
-
return a = Math.min(
|
|
3840
|
-
}
|
|
3841
|
-
const d = t.south > 0, _ = t.north < 0, m = d ? t.south : _ ? t.north : 0,
|
|
3842
|
-
|
|
3843
|
-
const y = Math.abs(
|
|
3844
|
-
u = StaticPlane.fromPointNormal(
|
|
3845
|
-
const x = Cartesian3.fromRadians(
|
|
3869
|
+
const b = i.cartographicToCartesian(w2, scratchPerimeterCartesianSC), A2 = m2.projectPointToNearestOnPlane(S, scratchPerimeterProjectedNC), v = m2.projectPointToNearestOnPlane(C, scratchPerimeterProjectedNW), T = m2.projectPointToNearestOnPlane(E, scratchPerimeterProjectedCW), I = m2.projectPointToNearestOnPlane(P, scratchPerimeterProjectedSW), z = m2.projectPointToNearestOnPlane(b, scratchPerimeterProjectedSC);
|
|
3870
|
+
return a = Math.min(v.x, T.x, I.x), n = -a, h = Math.max(v.y, A2.y), o = Math.min(I.y, z.y), g2.z = x2.z = e, C = i.cartographicToCartesian(g2, scratchPerimeterCartesianNW), P = i.cartographicToCartesian(x2, scratchPerimeterCartesianSW), c = Math.min(StaticPlane.getPointDistance(u, C), StaticPlane.getPointDistance(u, P)), l = s, fromPlaneExtents(m2.origin, m2.xAxis, m2.yAxis, m2.zAxis, a, n, o, h, c, l, r);
|
|
3871
|
+
}
|
|
3872
|
+
const d = t.south > 0, _ = t.north < 0, m = d ? t.south : _ ? t.north : 0, p = Rectangle.center(t, scratchRectangleCenterCartographic).x, f = Cartesian3.fromRadians(p, m, s, i, scratchPlaneOrigin);
|
|
3873
|
+
f.z = 0;
|
|
3874
|
+
const y = Math.abs(f.x) < CesiumMath.EPSILON10 && Math.abs(f.y) < CesiumMath.EPSILON10 ? Cartesian3.UNIT_X : Cartesian3.normalize(f, scratchPlaneNormal), g = Cartesian3.UNIT_Z, M = Cartesian3.cross(y, g, scratchPlaneXAxis);
|
|
3875
|
+
u = StaticPlane.fromPointNormal(f, y, scratchPlane);
|
|
3876
|
+
const x = Cartesian3.fromRadians(p + CesiumMath.PI_OVER_TWO, m, s, i, scratchHorizonCartesian);
|
|
3846
3877
|
n = Cartesian3.dot(StaticPlane.projectPointOntoPlane(u, x, scratchHorizonProjected), M), a = -n, h = Cartesian3.fromRadians(0, t.north, _ ? e : s, i, scratchMaxY).z, o = Cartesian3.fromRadians(0, t.south, d ? e : s, i, scratchMinY).z;
|
|
3847
3878
|
const w = Cartesian3.fromRadians(t.east, m, s, i, scratchZ);
|
|
3848
|
-
return c = StaticPlane.getPointDistance(u, w), l = 0, fromPlaneExtents(
|
|
3879
|
+
return c = StaticPlane.getPointDistance(u, w), l = 0, fromPlaneExtents(f, M, g, y, a, n, o, h, c, l, r);
|
|
3849
3880
|
};
|
|
3850
3881
|
const scratchCartesianU = new Vector3$1(), scratchCartesianV = new Vector3$1(), scratchCartesianW = new Vector3$1(), scratchValidAxis2 = new Vector3$1(), scratchValidAxis3 = new Vector3$1(), scratchPPrime = new Vector3$1();
|
|
3851
3882
|
OrientedBoundingBox.distanceSquaredTo = function(t, e) {
|
|
@@ -3859,14 +3890,14 @@ OrientedBoundingBox.distanceSquaredTo = function(t, e) {
|
|
|
3859
3890
|
let l = true, u = true, d = true;
|
|
3860
3891
|
o > 0 ? Cartesian3.divideByScalar(r, o, r) : l = false, h > 0 ? Cartesian3.divideByScalar(a, h, a) : u = false, c > 0 ? Cartesian3.divideByScalar(n, c, n) : d = false;
|
|
3861
3892
|
const _ = !l + !u + !d;
|
|
3862
|
-
let m,
|
|
3893
|
+
let m, p, f;
|
|
3863
3894
|
if (1 === _) {
|
|
3864
3895
|
let t2 = r;
|
|
3865
|
-
m = a,
|
|
3896
|
+
m = a, p = n, u ? d || (t2 = n, p = r) : (t2 = a, m = r), f = Cartesian3.cross(m, p, scratchValidAxis3), t2 === r ? r = f : t2 === a ? a = f : t2 === n && (n = f);
|
|
3866
3897
|
} else if (2 === _) {
|
|
3867
3898
|
m = r, u ? m = a : d && (m = n);
|
|
3868
3899
|
let t2 = Cartesian3.UNIT_Y;
|
|
3869
|
-
Cartesian3.equalsEpsilon(t2, m, CesiumMath.EPSILON3) && (t2 = Cartesian3.UNIT_X),
|
|
3900
|
+
Cartesian3.equalsEpsilon(t2, m, CesiumMath.EPSILON3) && (t2 = Cartesian3.UNIT_X), p = Cartesian3.cross(m, t2, scratchValidAxis2), Cartesian3.normalize(p, p), f = Cartesian3.cross(m, p, scratchValidAxis3), Cartesian3.normalize(f, f), m === r ? (a = p, n = f) : m === a ? (n = p, r = f) : m === n && (r = p, a = f);
|
|
3870
3901
|
} else
|
|
3871
3902
|
3 === _ && (r = Cartesian3.UNIT_X, a = Cartesian3.UNIT_Y, n = Cartesian3.UNIT_Z);
|
|
3872
3903
|
const y = scratchPPrime;
|
|
@@ -3977,26 +4008,21 @@ extend(Point.prototype, { equals: function(t) {
|
|
|
3977
4008
|
if (t.lng > 180 || t.lng < -180 || t.lat > 90 || t.lat < -90)
|
|
3978
4009
|
return t;
|
|
3979
4010
|
let e, s;
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
return i.lat = 31890685e-1 * Math.log((1 + Math.sin(a)) / (1 - Math.sin(a))), new Point(Number(i.lng), Number(i.lat));
|
|
3985
|
-
}
|
|
3986
|
-
for (var n = 0; n < this.LLBAND.length; n++)
|
|
3987
|
-
if (e.lat >= this.LLBAND[n]) {
|
|
3988
|
-
s = this.LL2MC[n];
|
|
4011
|
+
t.lng = this.getLoop(t.lng, -180, 180), t.lat = this.getRange(t.lat, -74, 74), e = new Point(t.lng, t.lat);
|
|
4012
|
+
for (var i = 0; i < this.LLBAND.length; i++)
|
|
4013
|
+
if (e.lat >= this.LLBAND[i]) {
|
|
4014
|
+
s = this.LL2MC[i];
|
|
3989
4015
|
break;
|
|
3990
4016
|
}
|
|
3991
4017
|
if (!s) {
|
|
3992
|
-
for (
|
|
3993
|
-
if (e.lat <= -this.LLBAND[
|
|
3994
|
-
s = this.LL2MC[
|
|
4018
|
+
for (i = 0; i < this.LLBAND.length; i++)
|
|
4019
|
+
if (e.lat <= -this.LLBAND[i]) {
|
|
4020
|
+
s = this.LL2MC[i];
|
|
3995
4021
|
break;
|
|
3996
4022
|
}
|
|
3997
4023
|
}
|
|
3998
|
-
let
|
|
3999
|
-
return t = new Point(Number(
|
|
4024
|
+
let r = this.convertor(t, s);
|
|
4025
|
+
return t = new Point(Number(r.lng), Number(r.lat));
|
|
4000
4026
|
}, convertor: function(t, e) {
|
|
4001
4027
|
if (!t || !e)
|
|
4002
4028
|
return;
|
|
@@ -4094,7 +4120,7 @@ proj4Src.exports = function() {
|
|
|
4094
4120
|
t2("EPSG:" + (32600 + e2), "+proj=utm +zone=" + e2 + " +datum=WGS84 +units=m"), t2("EPSG:" + (32700 + e2), "+proj=utm +zone=" + e2 + " +south +datum=WGS84 +units=m");
|
|
4095
4121
|
t2.WGS84 = t2["EPSG:4326"], t2["EPSG:3785"] = t2["EPSG:3857"], t2.GOOGLE = t2["EPSG:3857"], t2["EPSG:900913"] = t2["EPSG:3857"], t2["EPSG:102113"] = t2["EPSG:3857"];
|
|
4096
4122
|
}
|
|
4097
|
-
var e = 1, s = 2, i = 3, r = 4, a = 5, n = 6378137, o = 6356752314e-3, h = 0.0066943799901413165, c = 484813681109536e-20, l = Math.PI / 2, u = 0.16666666666666666, d = 0.04722222222222222, _ = 0.022156084656084655, m = 1e-10,
|
|
4123
|
+
var e = 1, s = 2, i = 3, r = 4, a = 5, n = 6378137, o = 6356752314e-3, h = 0.0066943799901413165, c = 484813681109536e-20, l = Math.PI / 2, u = 0.16666666666666666, d = 0.04722222222222222, _ = 0.022156084656084655, m = 1e-10, p = 0.017453292519943295, f = 57.29577951308232, y = Math.PI / 4, g = 2 * Math.PI, M = 3.14159265359, x = { greenwich: 0, lisbon: -9.131906111111, paris: 2.337229166667, bogota: -74.080916666667, madrid: -3.687938888889, rome: 12.452333333333, bern: 7.439583333333, jakarta: 106.807719444444, ferro: -17.666666666667, brussels: 4.367975, stockholm: 18.058277777778, athens: 23.7163375, oslo: 10.722916666667 }, w = { mm: { to_meter: 1e-3 }, cm: { to_meter: 0.01 }, ft: { to_meter: 0.3048 }, "us-ft": { to_meter: 1200 / 3937 }, fath: { to_meter: 1.8288 }, kmi: { to_meter: 1852 }, "us-ch": { to_meter: 20.1168402336805 }, "us-mi": { to_meter: 1609.34721869444 }, km: { to_meter: 1e3 }, "ind-ft": { to_meter: 0.30479841 }, "ind-yd": { to_meter: 0.91439523 }, mi: { to_meter: 1609.344 }, yd: { to_meter: 0.9144 }, ch: { to_meter: 20.1168 }, link: { to_meter: 0.201168 }, dm: { to_meter: 0.1 }, in: { to_meter: 0.0254 }, "ind-ch": { to_meter: 20.11669506 }, "us-in": { to_meter: 0.025400050800101 }, "us-yd": { to_meter: 0.914401828803658 } }, S = /[\s_\-\/\(\)]/g;
|
|
4098
4124
|
function C(t2, e2) {
|
|
4099
4125
|
if (t2[e2])
|
|
4100
4126
|
return t2[e2];
|
|
@@ -4113,25 +4139,25 @@ proj4Src.exports = function() {
|
|
|
4113
4139
|
}, {}), n2 = { proj: "projName", datum: "datumCode", rf: function(t3) {
|
|
4114
4140
|
r2.rf = parseFloat(t3);
|
|
4115
4141
|
}, lat_0: function(t3) {
|
|
4116
|
-
r2.lat0 = t3 *
|
|
4142
|
+
r2.lat0 = t3 * p;
|
|
4117
4143
|
}, lat_1: function(t3) {
|
|
4118
|
-
r2.lat1 = t3 *
|
|
4144
|
+
r2.lat1 = t3 * p;
|
|
4119
4145
|
}, lat_2: function(t3) {
|
|
4120
|
-
r2.lat2 = t3 *
|
|
4146
|
+
r2.lat2 = t3 * p;
|
|
4121
4147
|
}, lat_ts: function(t3) {
|
|
4122
|
-
r2.lat_ts = t3 *
|
|
4148
|
+
r2.lat_ts = t3 * p;
|
|
4123
4149
|
}, lon_0: function(t3) {
|
|
4124
|
-
r2.long0 = t3 *
|
|
4150
|
+
r2.long0 = t3 * p;
|
|
4125
4151
|
}, lon_1: function(t3) {
|
|
4126
|
-
r2.long1 = t3 *
|
|
4152
|
+
r2.long1 = t3 * p;
|
|
4127
4153
|
}, lon_2: function(t3) {
|
|
4128
|
-
r2.long2 = t3 *
|
|
4154
|
+
r2.long2 = t3 * p;
|
|
4129
4155
|
}, alpha: function(t3) {
|
|
4130
|
-
r2.alpha = parseFloat(t3) *
|
|
4156
|
+
r2.alpha = parseFloat(t3) * p;
|
|
4131
4157
|
}, gamma: function(t3) {
|
|
4132
|
-
r2.rectified_grid_angle = parseFloat(t3) *
|
|
4158
|
+
r2.rectified_grid_angle = parseFloat(t3) * p;
|
|
4133
4159
|
}, lonc: function(t3) {
|
|
4134
|
-
r2.longc = t3 *
|
|
4160
|
+
r2.longc = t3 * p;
|
|
4135
4161
|
}, x_0: function(t3) {
|
|
4136
4162
|
r2.x0 = parseFloat(t3);
|
|
4137
4163
|
}, y_0: function(t3) {
|
|
@@ -4163,10 +4189,10 @@ proj4Src.exports = function() {
|
|
|
4163
4189
|
var e3 = C(w, t3);
|
|
4164
4190
|
e3 && (r2.to_meter = e3.to_meter);
|
|
4165
4191
|
}, from_greenwich: function(t3) {
|
|
4166
|
-
r2.from_greenwich = t3 *
|
|
4192
|
+
r2.from_greenwich = t3 * p;
|
|
4167
4193
|
}, pm: function(t3) {
|
|
4168
4194
|
var e3 = C(x, t3);
|
|
4169
|
-
r2.from_greenwich = (e3 || parseFloat(t3)) *
|
|
4195
|
+
r2.from_greenwich = (e3 || parseFloat(t3)) * p;
|
|
4170
4196
|
}, nadgrids: function(t3) {
|
|
4171
4197
|
"@null" === t3 ? r2.datumCode = "none" : r2.nadgrids = t3;
|
|
4172
4198
|
}, axis: function(t3) {
|
|
@@ -4304,7 +4330,7 @@ proj4Src.exports = function() {
|
|
|
4304
4330
|
return super.convert(t2, e2), "Cartesian" === ((_a2 = e2.coordinate_system) == null ? void 0 : _a2.subtype) && delete e2.coordinate_system, e2.usage && delete e2.usage, e2;
|
|
4305
4331
|
}
|
|
4306
4332
|
}
|
|
4307
|
-
class
|
|
4333
|
+
class A2 extends P {
|
|
4308
4334
|
static convert(t2, e2 = {}) {
|
|
4309
4335
|
var _a2, _b, _c;
|
|
4310
4336
|
super.convert(t2, e2);
|
|
@@ -4314,11 +4340,11 @@ proj4Src.exports = function() {
|
|
|
4314
4340
|
return i2 && (e2.usage = { scope: (_a2 = i2.find((t3) => Array.isArray(t3) && "SCOPE" === t3[0])) == null ? void 0 : _a2[1], area: (_b = i2.find((t3) => Array.isArray(t3) && "AREA" === t3[0])) == null ? void 0 : _b[1], bbox: (_c = i2.find((t3) => Array.isArray(t3) && "BBOX" === t3[0])) == null ? void 0 : _c.slice(1) }), e2;
|
|
4315
4341
|
}
|
|
4316
4342
|
}
|
|
4317
|
-
function
|
|
4343
|
+
function v(t2) {
|
|
4318
4344
|
return t2.find((t3) => Array.isArray(t3) && "USAGE" === t3[0]) ? "2019" : (t2.find((t3) => Array.isArray(t3) && "CS" === t3[0]) || "BOUNDCRS" === t2[0] || "PROJCRS" === t2[0] || t2[0], "2015");
|
|
4319
4345
|
}
|
|
4320
4346
|
function T(t2) {
|
|
4321
|
-
return ("2019" ===
|
|
4347
|
+
return ("2019" === v(t2) ? A2 : b).convert(t2);
|
|
4322
4348
|
}
|
|
4323
4349
|
function I(t2) {
|
|
4324
4350
|
const e2 = t2.toUpperCase();
|
|
@@ -4656,11 +4682,11 @@ proj4Src.exports = function() {
|
|
|
4656
4682
|
var i2 = t2 * e2;
|
|
4657
4683
|
return s2 / Math.sqrt(1 - i2 * i2);
|
|
4658
4684
|
}
|
|
4659
|
-
function
|
|
4685
|
+
function pt(t2) {
|
|
4660
4686
|
return t2 < 0 ? -1 : 1;
|
|
4661
4687
|
}
|
|
4662
|
-
function
|
|
4663
|
-
return Math.abs(t2) <= M ? t2 : t2 -
|
|
4688
|
+
function ft(t2) {
|
|
4689
|
+
return Math.abs(t2) <= M ? t2 : t2 - pt(t2) * g;
|
|
4664
4690
|
}
|
|
4665
4691
|
function yt(t2, e2, s2) {
|
|
4666
4692
|
var i2 = t2 * s2, r2 = 0.5 * t2;
|
|
@@ -4678,15 +4704,15 @@ proj4Src.exports = function() {
|
|
|
4678
4704
|
}
|
|
4679
4705
|
function xt(t2) {
|
|
4680
4706
|
var e2, s2, i2 = t2.x, r2 = t2.y;
|
|
4681
|
-
if (r2 *
|
|
4707
|
+
if (r2 * f > 90 && r2 * f < -90 && i2 * f > 180 && i2 * f < -180)
|
|
4682
4708
|
return null;
|
|
4683
4709
|
if (Math.abs(Math.abs(r2) - l) <= m)
|
|
4684
4710
|
return null;
|
|
4685
4711
|
if (this.sphere)
|
|
4686
|
-
e2 = this.x0 + this.a * this.k0 *
|
|
4712
|
+
e2 = this.x0 + this.a * this.k0 * ft(i2 - this.long0), s2 = this.y0 + this.a * this.k0 * Math.log(Math.tan(y + 0.5 * r2));
|
|
4687
4713
|
else {
|
|
4688
4714
|
var a2 = Math.sin(r2), n2 = yt(this.e, r2, a2);
|
|
4689
|
-
e2 = this.x0 + this.a * this.k0 *
|
|
4715
|
+
e2 = this.x0 + this.a * this.k0 * ft(i2 - this.long0), s2 = this.y0 - this.a * this.k0 * Math.log(n2);
|
|
4690
4716
|
}
|
|
4691
4717
|
return t2.x = e2, t2.y = s2, t2;
|
|
4692
4718
|
}
|
|
@@ -4699,7 +4725,7 @@ proj4Src.exports = function() {
|
|
|
4699
4725
|
if (-9999 === (s2 = gt(this.e, a2)))
|
|
4700
4726
|
return null;
|
|
4701
4727
|
}
|
|
4702
|
-
return e2 =
|
|
4728
|
+
return e2 = ft(this.long0 + i2 / (this.a * this.k0)), t2.x = e2, t2.y = s2, t2;
|
|
4703
4729
|
}
|
|
4704
4730
|
function St() {
|
|
4705
4731
|
}
|
|
@@ -4707,25 +4733,25 @@ proj4Src.exports = function() {
|
|
|
4707
4733
|
return t2;
|
|
4708
4734
|
}
|
|
4709
4735
|
var Et = [{ init: Mt, forward: xt, inverse: wt, names: ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"] }, { init: St, forward: Ct, inverse: Ct, names: ["longlat", "identity"] }], Pt = {}, bt = [];
|
|
4710
|
-
function
|
|
4736
|
+
function At(t2, e2) {
|
|
4711
4737
|
var s2 = bt.length;
|
|
4712
4738
|
return t2.names ? (bt[s2] = t2, t2.names.forEach(function(t3) {
|
|
4713
4739
|
Pt[t3.toLowerCase()] = s2;
|
|
4714
4740
|
}), this) : (console.log(e2), true);
|
|
4715
4741
|
}
|
|
4716
|
-
function
|
|
4742
|
+
function vt(t2) {
|
|
4717
4743
|
return t2.replace(/[-\(\)\s]+/g, " ").trim().replace(/ /g, "_");
|
|
4718
4744
|
}
|
|
4719
4745
|
function Tt(t2) {
|
|
4720
4746
|
if (!t2)
|
|
4721
4747
|
return false;
|
|
4722
4748
|
var e2 = t2.toLowerCase();
|
|
4723
|
-
return void 0 !== Pt[e2] && bt[Pt[e2]] || (e2 =
|
|
4749
|
+
return void 0 !== Pt[e2] && bt[Pt[e2]] || (e2 = vt(e2)) in Pt && bt[Pt[e2]] ? bt[Pt[e2]] : void 0;
|
|
4724
4750
|
}
|
|
4725
4751
|
function It() {
|
|
4726
|
-
Et.forEach(
|
|
4752
|
+
Et.forEach(At);
|
|
4727
4753
|
}
|
|
4728
|
-
var zt = { start: It, add:
|
|
4754
|
+
var zt = { start: It, add: At, get: Tt }, Ot = { MERIT: { a: 6378137, rf: 298.257, ellipseName: "MERIT 1983" }, SGS85: { a: 6378136, rf: 298.257, ellipseName: "Soviet Geodetic System 85" }, GRS80: { a: 6378137, rf: 298.257222101, ellipseName: "GRS 1980(IUGG, 1980)" }, IAU76: { a: 6378140, rf: 298.257, ellipseName: "IAU 1976" }, airy: { a: 6377563396e-3, b: 635625691e-2, ellipseName: "Airy 1830" }, APL4: { a: 6378137, rf: 298.25, ellipseName: "Appl. Physics. 1965" }, NWL9D: { a: 6378145, rf: 298.25, ellipseName: "Naval Weapons Lab., 1965" }, mod_airy: { a: 6377340189e-3, b: 6356034446e-3, ellipseName: "Modified Airy" }, andrae: { a: 637710443e-2, rf: 300, ellipseName: "Andrae 1876 (Den., Iclnd.)" }, aust_SA: { a: 6378160, rf: 298.25, ellipseName: "Australian Natl & S. Amer. 1969" }, GRS67: { a: 6378160, rf: 298.247167427, ellipseName: "GRS 67(IUGG 1967)" }, bessel: { a: 6377397155e-3, rf: 299.1528128, ellipseName: "Bessel 1841" }, bess_nam: { a: 6377483865e-3, rf: 299.1528128, ellipseName: "Bessel 1841 (Namibia)" }, clrk66: { a: 63782064e-1, b: 63565838e-1, ellipseName: "Clarke 1866" }, clrk80: { a: 6378249145e-3, rf: 293.4663, ellipseName: "Clarke 1880 mod." }, clrk80ign: { a: 63782492e-1, b: 6356515, rf: 293.4660213, ellipseName: "Clarke 1880 (IGN)" }, clrk58: { a: 6378293645208759e-9, rf: 294.2606763692654, ellipseName: "Clarke 1858" }, CPM: { a: 63757387e-1, rf: 334.29, ellipseName: "Comm. des Poids et Mesures 1799" }, delmbr: { a: 6376428, rf: 311.5, ellipseName: "Delambre 1810 (Belgium)" }, engelis: { a: 637813605e-2, rf: 298.2566, ellipseName: "Engelis 1985" }, evrst30: { a: 6377276345e-3, rf: 300.8017, ellipseName: "Everest 1830" }, evrst48: { a: 6377304063e-3, rf: 300.8017, ellipseName: "Everest 1948" }, evrst56: { a: 6377301243e-3, rf: 300.8017, ellipseName: "Everest 1956" }, evrst69: { a: 6377295664e-3, rf: 300.8017, ellipseName: "Everest 1969" }, evrstSS: { a: 6377298556e-3, rf: 300.8017, ellipseName: "Everest (Sabah & Sarawak)" }, fschr60: { a: 6378166, rf: 298.3, ellipseName: "Fischer (Mercury Datum) 1960" }, fschr60m: { a: 6378155, rf: 298.3, ellipseName: "Fischer 1960" }, fschr68: { a: 6378150, rf: 298.3, ellipseName: "Fischer 1968" }, helmert: { a: 6378200, rf: 298.3, ellipseName: "Helmert 1906" }, hough: { a: 6378270, rf: 297, ellipseName: "Hough" }, intl: { a: 6378388, rf: 297, ellipseName: "International 1909 (Hayford)" }, kaula: { a: 6378163, rf: 298.24, ellipseName: "Kaula 1961" }, lerch: { a: 6378139, rf: 298.257, ellipseName: "Lerch 1979" }, mprts: { a: 6397300, rf: 191, ellipseName: "Maupertius 1738" }, new_intl: { a: 63781575e-1, b: 63567722e-1, ellipseName: "New International 1967" }, plessis: { a: 6376523, rf: 6355863, ellipseName: "Plessis 1817 (France)" }, krass: { a: 6378245, rf: 298.3, ellipseName: "Krassovsky, 1942" }, SEasia: { a: 6378155, b: 63567733205e-4, ellipseName: "Southeast Asia" }, walbeck: { a: 6376896, b: 63558348467e-4, ellipseName: "Walbeck" }, WGS60: { a: 6378165, rf: 298.3, ellipseName: "WGS 60" }, WGS66: { a: 6378145, rf: 298.25, ellipseName: "WGS 66" }, WGS7: { a: 6378135, rf: 298.26, ellipseName: "WGS 72" }, WGS84: { a: 6378137, rf: 298.257223563, ellipseName: "WGS 84" }, sphere: { a: 6370997, b: 6370997, ellipseName: "Normal Sphere (r=6370997)" } };
|
|
4729
4755
|
const Nt = Ot.WGS84;
|
|
4730
4756
|
function Gt(t2, e2, s2, i2) {
|
|
4731
4757
|
var r2 = t2 * t2, a2 = e2 * e2, n2 = (r2 - a2) / r2, o2 = 0;
|
|
@@ -4762,13 +4788,13 @@ proj4Src.exports = function() {
|
|
|
4762
4788
|
var a2 = await e2.getImage(r2), n2 = await a2.readRasters(), o2 = [a2.getWidth(), a2.getHeight()], h2 = a2.getBoundingBox().map(Wt), c2 = [a2.fileDirectory.ModelPixelScale[0], a2.fileDirectory.ModelPixelScale[1]].map(Wt), l2 = h2[0] + (o2[0] - 1) * c2[0], u2 = h2[3] - (o2[1] - 1) * c2[1], d2 = n2[0], _2 = n2[1], m2 = [];
|
|
4763
4789
|
for (let t3 = o2[1] - 1; t3 >= 0; t3--)
|
|
4764
4790
|
for (let e3 = o2[0] - 1; e3 >= 0; e3--) {
|
|
4765
|
-
var
|
|
4766
|
-
m2.push([-Yt(_2[
|
|
4791
|
+
var p2 = t3 * o2[0] + e3;
|
|
4792
|
+
m2.push([-Yt(_2[p2]), Yt(d2[p2])]);
|
|
4767
4793
|
}
|
|
4768
4794
|
s2.push({ del: c2, lim: o2, ll: [-l2, u2], cvs: m2 });
|
|
4769
4795
|
}
|
|
4770
|
-
var
|
|
4771
|
-
return jt[t2] =
|
|
4796
|
+
var f2 = { header: { nSubgrids: i2 }, subgrids: s2 };
|
|
4797
|
+
return jt[t2] = f2, f2;
|
|
4772
4798
|
}
|
|
4773
4799
|
function Ft(t2) {
|
|
4774
4800
|
return void 0 === t2 ? null : t2.split(",").map(Ut);
|
|
@@ -4862,16 +4888,16 @@ proj4Src.exports = function() {
|
|
|
4862
4888
|
return o2 > Math.PI && (o2 -= 2 * Math.PI), r2 = Math.sin(h2), n2 = Math.cos(h2), a2 = r2 * r2, { x: ((i2 = s2 / Math.sqrt(1 - e2 * a2)) + c2) * n2 * Math.cos(o2), y: (i2 + c2) * n2 * Math.sin(o2), z: (i2 * (1 - e2) + c2) * r2 };
|
|
4863
4889
|
}
|
|
4864
4890
|
function re(t2, e2, s2, i2) {
|
|
4865
|
-
var r2, a2, n2, o2, h2, c2, l2, u2, d2, _2, m2,
|
|
4891
|
+
var r2, a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, p2, f2, y2, g2, M2 = 1e-12, x2 = M2 * M2, w2 = 30, S2 = t2.x, C2 = t2.y, E2 = t2.z ? t2.z : 0;
|
|
4866
4892
|
if (r2 = Math.sqrt(S2 * S2 + C2 * C2), a2 = Math.sqrt(S2 * S2 + C2 * C2 + E2 * E2), r2 / s2 < M2) {
|
|
4867
4893
|
if (y2 = 0, a2 / s2 < M2)
|
|
4868
4894
|
return g2 = -i2, { x: t2.x, y: t2.y, z: t2.z };
|
|
4869
4895
|
} else
|
|
4870
4896
|
y2 = Math.atan2(C2, S2);
|
|
4871
|
-
n2 = E2 / a2, u2 = (o2 = r2 / a2) * (1 - e2) * (h2 = 1 / Math.sqrt(1 - e2 * (2 - e2) * o2 * o2)), d2 = n2 * h2,
|
|
4897
|
+
n2 = E2 / a2, u2 = (o2 = r2 / a2) * (1 - e2) * (h2 = 1 / Math.sqrt(1 - e2 * (2 - e2) * o2 * o2)), d2 = n2 * h2, f2 = 0;
|
|
4872
4898
|
do {
|
|
4873
|
-
|
|
4874
|
-
} while (
|
|
4899
|
+
f2++, c2 = e2 * (l2 = s2 / Math.sqrt(1 - e2 * d2 * d2)) / (l2 + (g2 = r2 * u2 + E2 * d2 - l2 * (1 - e2 * d2 * d2))), p2 = (m2 = n2 * (h2 = 1 / Math.sqrt(1 - c2 * (2 - c2) * o2 * o2))) * u2 - (_2 = o2 * (1 - c2) * h2) * d2, u2 = _2, d2 = m2;
|
|
4900
|
+
} while (p2 * p2 > x2 && f2 < w2);
|
|
4875
4901
|
return { x: y2, y: Math.atan(m2 / Math.abs(_2)), z: g2 };
|
|
4876
4902
|
}
|
|
4877
4903
|
function ae(t2, i2, r2) {
|
|
@@ -4920,21 +4946,21 @@ proj4Src.exports = function() {
|
|
|
4920
4946
|
}
|
|
4921
4947
|
if (null !== o2.grid)
|
|
4922
4948
|
for (var h2 = o2.grid.subgrids, c2 = 0, l2 = h2.length; c2 < l2; c2++) {
|
|
4923
|
-
var u2 = h2[c2], d2 = (Math.abs(u2.del[1]) + Math.abs(u2.del[0])) / 1e4, _2 = u2.ll[0] - d2, m2 = u2.ll[1] - d2,
|
|
4924
|
-
if (!(m2 > i2.y || _2 > i2.x || y2 < i2.y ||
|
|
4949
|
+
var u2 = h2[c2], d2 = (Math.abs(u2.del[1]) + Math.abs(u2.del[0])) / 1e4, _2 = u2.ll[0] - d2, m2 = u2.ll[1] - d2, p2 = u2.ll[0] + (u2.lim[0] - 1) * u2.del[0] + d2, y2 = u2.ll[1] + (u2.lim[1] - 1) * u2.del[1] + d2;
|
|
4950
|
+
if (!(m2 > i2.y || _2 > i2.x || y2 < i2.y || p2 < i2.x || (r2 = le(i2, e2, u2), isNaN(r2.x))))
|
|
4925
4951
|
break t;
|
|
4926
4952
|
}
|
|
4927
4953
|
else if (o2.mandatory)
|
|
4928
4954
|
return console.log("Unable to find mandatory grid '" + o2.name + "'"), -1;
|
|
4929
4955
|
}
|
|
4930
|
-
return isNaN(r2.x) ? (console.log("Failed to find a grid shift table for location '" + -i2.x *
|
|
4956
|
+
return isNaN(r2.x) ? (console.log("Failed to find a grid shift table for location '" + -i2.x * f + " " + i2.y * f + " tried: '" + a2 + "'"), -1) : (s2.x = -r2.x, s2.y = r2.y, 0);
|
|
4931
4957
|
}
|
|
4932
4958
|
function le(t2, e2, s2) {
|
|
4933
4959
|
var i2 = { x: Number.NaN, y: Number.NaN };
|
|
4934
4960
|
if (isNaN(t2.x))
|
|
4935
4961
|
return i2;
|
|
4936
4962
|
var r2 = { x: t2.x, y: t2.y };
|
|
4937
|
-
r2.x -= s2.ll[0], r2.y -= s2.ll[1], r2.x =
|
|
4963
|
+
r2.x -= s2.ll[0], r2.y -= s2.ll[1], r2.x = ft(r2.x - Math.PI) + Math.PI;
|
|
4938
4964
|
var a2 = ue(r2, s2);
|
|
4939
4965
|
if (e2) {
|
|
4940
4966
|
if (isNaN(a2.x))
|
|
@@ -4950,7 +4976,7 @@ proj4Src.exports = function() {
|
|
|
4950
4976
|
} while (h2-- && Math.abs(n2.x) > c2 && Math.abs(n2.y) > c2);
|
|
4951
4977
|
if (h2 < 0)
|
|
4952
4978
|
return console.log("Inverse grid shift iterator failed to converge."), i2;
|
|
4953
|
-
i2.x =
|
|
4979
|
+
i2.x = ft(a2.x + s2.ll[0]), i2.y = a2.y + s2.ll[1];
|
|
4954
4980
|
} else
|
|
4955
4981
|
isNaN(a2.x) || (i2.x = t2.x + a2.x, i2.y = t2.y + a2.y);
|
|
4956
4982
|
return i2;
|
|
@@ -5000,9 +5026,9 @@ proj4Src.exports = function() {
|
|
|
5000
5026
|
return t2.length > 2 && (e2.z = t2[2]), t2.length > 3 && (e2.m = t2[3]), e2;
|
|
5001
5027
|
}
|
|
5002
5028
|
function me(t2) {
|
|
5003
|
-
|
|
5029
|
+
pe(t2.x), pe(t2.y);
|
|
5004
5030
|
}
|
|
5005
|
-
function
|
|
5031
|
+
function pe(t2) {
|
|
5006
5032
|
if ("function" == typeof Number.isFinite) {
|
|
5007
5033
|
if (Number.isFinite(t2))
|
|
5008
5034
|
return;
|
|
@@ -5011,17 +5037,17 @@ proj4Src.exports = function() {
|
|
|
5011
5037
|
if ("number" != typeof t2 || t2 != t2 || !isFinite(t2))
|
|
5012
5038
|
throw new TypeError("coordinates must be finite numbers");
|
|
5013
5039
|
}
|
|
5014
|
-
function
|
|
5040
|
+
function fe(t2, r2) {
|
|
5015
5041
|
return (t2.datum.datum_type === e || t2.datum.datum_type === s || t2.datum.datum_type === i) && "WGS84" !== r2.datumCode || (r2.datum.datum_type === e || r2.datum.datum_type === s || r2.datum.datum_type === i) && "WGS84" !== t2.datumCode;
|
|
5016
5042
|
}
|
|
5017
5043
|
function ye(t2, e2, s2, i2) {
|
|
5018
5044
|
var r2, a2 = void 0 !== (s2 = Array.isArray(s2) ? _e(s2) : { x: s2.x, y: s2.y, z: s2.z, m: s2.m }).z;
|
|
5019
|
-
if (me(s2), t2.datum && e2.datum &&
|
|
5020
|
-
s2 = { x: s2.x *
|
|
5045
|
+
if (me(s2), t2.datum && e2.datum && fe(t2, e2) && (s2 = ye(t2, r2 = new ee("WGS84"), s2, i2), t2 = r2), i2 && "enu" !== t2.axis && (s2 = de(t2, false, s2)), "longlat" === t2.projName)
|
|
5046
|
+
s2 = { x: s2.x * p, y: s2.y * p, z: s2.z || 0 };
|
|
5021
5047
|
else if (t2.to_meter && (s2 = { x: s2.x * t2.to_meter, y: s2.y * t2.to_meter, z: s2.z || 0 }), !(s2 = t2.inverse(s2)))
|
|
5022
5048
|
return;
|
|
5023
5049
|
if (t2.from_greenwich && (s2.x += t2.from_greenwich), s2 = he(t2.datum, e2.datum, s2))
|
|
5024
|
-
return e2.from_greenwich && (s2 = { x: s2.x - e2.from_greenwich, y: s2.y, z: s2.z || 0 }), "longlat" === e2.projName ? s2 = { x: s2.x *
|
|
5050
|
+
return e2.from_greenwich && (s2 = { x: s2.x - e2.from_greenwich, y: s2.y, z: s2.z || 0 }), "longlat" === e2.projName ? s2 = { x: s2.x * f, y: s2.y * f, z: s2.z || 0 } : (s2 = e2.forward(s2), e2.to_meter && (s2 = { x: s2.x / e2.to_meter, y: s2.y / e2.to_meter, z: s2.z || 0 })), i2 && "enu" !== e2.axis ? de(e2, true, s2) : (s2 && !a2 && delete s2.z, s2);
|
|
5025
5051
|
}
|
|
5026
5052
|
ee.projections = zt, ee.projections.start();
|
|
5027
5053
|
var ge = ee("WGS84");
|
|
@@ -5048,7 +5074,7 @@ proj4Src.exports = function() {
|
|
|
5048
5074
|
return Me(e2, t2, s3, i3);
|
|
5049
5075
|
} }, r2 && (i2.oProj = e2), i2);
|
|
5050
5076
|
}
|
|
5051
|
-
var Se = 6, Ce = "AJSAJS", Ee = "AFAFAF", Pe = 65, be = 73,
|
|
5077
|
+
var Se = 6, Ce = "AJSAJS", Ee = "AFAFAF", Pe = 65, be = 73, Ae = 79, ve = 86, Te = 90, Ie = { forward: ze, inverse: Oe, toPoint: Ne };
|
|
5052
5078
|
function ze(t2, e2) {
|
|
5053
5079
|
return e2 = e2 || 5, qe(Le({ lat: t2[1], lon: t2[0] }), e2);
|
|
5054
5080
|
}
|
|
@@ -5069,15 +5095,15 @@ proj4Src.exports = function() {
|
|
|
5069
5095
|
function Le(t2) {
|
|
5070
5096
|
var e2, s2, i2, r2, a2, n2, o2, h2 = t2.lat, c2 = t2.lon, l2 = 6378137, u2 = 669438e-8, d2 = 0.9996, _2 = Ge(h2), m2 = Ge(c2);
|
|
5071
5097
|
o2 = Math.floor((c2 + 180) / 6) + 1, 180 === c2 && (o2 = 60), h2 >= 56 && h2 < 64 && c2 >= 3 && c2 < 12 && (o2 = 32), h2 >= 72 && h2 < 84 && (c2 >= 0 && c2 < 9 ? o2 = 31 : c2 >= 9 && c2 < 21 ? o2 = 33 : c2 >= 21 && c2 < 33 ? o2 = 35 : c2 >= 33 && c2 < 42 && (o2 = 37)), n2 = Ge(6 * (o2 - 1) - 180 + 3), e2 = u2 / (1 - u2), s2 = l2 / Math.sqrt(1 - u2 * Math.sin(_2) * Math.sin(_2)), i2 = Math.tan(_2) * Math.tan(_2), r2 = e2 * Math.cos(_2) * Math.cos(_2);
|
|
5072
|
-
var
|
|
5073
|
-
return h2 < 0 && (
|
|
5098
|
+
var p2 = d2 * s2 * ((a2 = Math.cos(_2) * (m2 - n2)) + (1 - i2 + r2) * a2 * a2 * a2 / 6 + (5 - 18 * i2 + i2 * i2 + 72 * r2 - 58 * e2) * a2 * a2 * a2 * a2 * a2 / 120) + 5e5, f2 = d2 * (l2 * ((1 - u2 / 4 - 3 * u2 * u2 / 64 - 5 * u2 * u2 * u2 / 256) * _2 - (3 * u2 / 8 + 3 * u2 * u2 / 32 + 45 * u2 * u2 * u2 / 1024) * Math.sin(2 * _2) + (15 * u2 * u2 / 256 + 45 * u2 * u2 * u2 / 1024) * Math.sin(4 * _2) - 35 * u2 * u2 * u2 / 3072 * Math.sin(6 * _2)) + s2 * Math.tan(_2) * (a2 * a2 / 2 + (5 - i2 + 9 * r2 + 4 * r2 * r2) * a2 * a2 * a2 * a2 / 24 + (61 - 58 * i2 + i2 * i2 + 600 * r2 - 330 * e2) * a2 * a2 * a2 * a2 * a2 * a2 / 720));
|
|
5099
|
+
return h2 < 0 && (f2 += 1e7), { northing: Math.round(f2), easting: Math.round(p2), zoneNumber: o2, zoneLetter: Ve(h2) };
|
|
5074
5100
|
}
|
|
5075
5101
|
function $e(t2) {
|
|
5076
5102
|
var e2 = t2.northing, s2 = t2.easting, i2 = t2.zoneLetter, r2 = t2.zoneNumber;
|
|
5077
5103
|
if (r2 < 0 || r2 > 60)
|
|
5078
5104
|
return null;
|
|
5079
|
-
var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2 = 0.9996,
|
|
5080
|
-
i2 < "N" && (M2 -= 1e7), u2 = 6 * (r2 - 1) - 180 + 3, a2 =
|
|
5105
|
+
var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2 = 0.9996, p2 = 6378137, f2 = 669438e-8, y2 = (1 - Math.sqrt(1 - f2)) / (1 + Math.sqrt(1 - f2)), g2 = s2 - 5e5, M2 = e2;
|
|
5106
|
+
i2 < "N" && (M2 -= 1e7), u2 = 6 * (r2 - 1) - 180 + 3, a2 = f2 / (1 - f2), _2 = (d2 = M2 / m2 / (p2 * (1 - f2 / 4 - 3 * f2 * f2 / 64 - 5 * f2 * f2 * f2 / 256))) + (3 * y2 / 2 - 27 * y2 * y2 * y2 / 32) * Math.sin(2 * d2) + (21 * y2 * y2 / 16 - 55 * y2 * y2 * y2 * y2 / 32) * Math.sin(4 * d2) + 151 * y2 * y2 * y2 / 96 * Math.sin(6 * d2), n2 = p2 / Math.sqrt(1 - f2 * Math.sin(_2) * Math.sin(_2)), o2 = Math.tan(_2) * Math.tan(_2), h2 = a2 * Math.cos(_2) * Math.cos(_2), c2 = p2 * (1 - f2) / Math.pow(1 - f2 * Math.sin(_2) * Math.sin(_2), 1.5), l2 = g2 / (n2 * m2);
|
|
5081
5107
|
var x2 = _2 - n2 * Math.tan(_2) / c2 * (l2 * l2 / 2 - (5 + 3 * o2 + 10 * h2 - 4 * h2 * h2 - 9 * a2) * l2 * l2 * l2 * l2 / 24 + (61 + 90 * o2 + 298 * h2 + 45 * o2 * o2 - 252 * a2 - 3 * h2 * h2) * l2 * l2 * l2 * l2 * l2 * l2 / 720);
|
|
5082
5108
|
x2 = Re(x2);
|
|
5083
5109
|
var w2, S2 = (l2 - (1 + 2 * o2 + h2) * l2 * l2 * l2 / 6 + (5 - 2 * h2 + 28 * o2 - 3 * h2 * h2 + 8 * a2 + 24 * o2 * o2) * l2 * l2 * l2 * l2 * l2 / 120) / Math.cos(_2);
|
|
@@ -5106,7 +5132,7 @@ proj4Src.exports = function() {
|
|
|
5106
5132
|
}
|
|
5107
5133
|
function Be(t2, e2, s2) {
|
|
5108
5134
|
var i2 = s2 - 1, r2 = Ce.charCodeAt(i2), a2 = Ee.charCodeAt(i2), n2 = r2 + t2 - 1, o2 = a2 + e2, h2 = false;
|
|
5109
|
-
return n2 > Te && (n2 = n2 - Te + Pe - 1, h2 = true), (n2 === be || r2 < be && n2 > be || (n2 > be || r2 < be) && h2) && n2++, (n2 ===
|
|
5135
|
+
return n2 > Te && (n2 = n2 - Te + Pe - 1, h2 = true), (n2 === be || r2 < be && n2 > be || (n2 > be || r2 < be) && h2) && n2++, (n2 === Ae || r2 < Ae && n2 > Ae || (n2 > Ae || r2 < Ae) && h2) && ++n2 === be && n2++, n2 > Te && (n2 = n2 - Te + Pe - 1), o2 > ve ? (o2 = o2 - ve + Pe - 1, h2 = true) : h2 = false, (o2 === be || a2 < be && o2 > be || (o2 > be || a2 < be) && h2) && o2++, (o2 === Ae || a2 < Ae && o2 > Ae || (o2 > Ae || a2 < Ae) && h2) && ++o2 === be && o2++, o2 > ve && (o2 = o2 - ve + Pe - 1), String.fromCharCode(n2) + String.fromCharCode(o2);
|
|
5110
5136
|
}
|
|
5111
5137
|
function ke(t2) {
|
|
5112
5138
|
if (t2 && 0 === t2.length)
|
|
@@ -5128,12 +5154,12 @@ proj4Src.exports = function() {
|
|
|
5128
5154
|
var u2 = s2 - a2;
|
|
5129
5155
|
if (u2 % 2 != 0)
|
|
5130
5156
|
throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + t2;
|
|
5131
|
-
var d2, _2, m2,
|
|
5132
|
-
return
|
|
5157
|
+
var d2, _2, m2, p2 = u2 / 2, f2 = 0, y2 = 0;
|
|
5158
|
+
return p2 > 0 && (d2 = 1e5 / Math.pow(10, p2), _2 = t2.substring(a2, a2 + p2), f2 = parseFloat(_2) * d2, m2 = t2.substring(a2 + p2), y2 = parseFloat(m2) * d2), { easting: f2 + c2, northing: y2 + l2, zoneLetter: o2, zoneNumber: n2, accuracy: d2 };
|
|
5133
5159
|
}
|
|
5134
5160
|
function Fe(t2, e2) {
|
|
5135
5161
|
for (var s2 = Ce.charCodeAt(e2 - 1), i2 = 1e5, r2 = false; s2 !== t2.charCodeAt(0); ) {
|
|
5136
|
-
if (++s2 === be && s2++, s2 ===
|
|
5162
|
+
if (++s2 === be && s2++, s2 === Ae && s2++, s2 > Te) {
|
|
5137
5163
|
if (r2)
|
|
5138
5164
|
throw "Bad character: " + t2;
|
|
5139
5165
|
s2 = Pe, r2 = true;
|
|
@@ -5146,7 +5172,7 @@ proj4Src.exports = function() {
|
|
|
5146
5172
|
if (t2 > "V")
|
|
5147
5173
|
throw "MGRSPoint given invalid Northing " + t2;
|
|
5148
5174
|
for (var s2 = Ee.charCodeAt(e2 - 1), i2 = 0, r2 = false; s2 !== t2.charCodeAt(0); ) {
|
|
5149
|
-
if (++s2 === be && s2++, s2 ===
|
|
5175
|
+
if (++s2 === be && s2++, s2 === Ae && s2++, s2 > ve) {
|
|
5150
5176
|
if (r2)
|
|
5151
5177
|
throw "Bad character: " + t2;
|
|
5152
5178
|
s2 = Pe, r2 = true;
|
|
@@ -5267,12 +5293,12 @@ proj4Src.exports = function() {
|
|
|
5267
5293
|
this.x0 = void 0 !== this.x0 ? this.x0 : 0, this.y0 = void 0 !== this.y0 ? this.y0 : 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0, this.lat0 = void 0 !== this.lat0 ? this.lat0 : 0, this.es && (this.en = ns(this.es), this.ml0 = os(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
|
|
5268
5294
|
}
|
|
5269
5295
|
function us(t2) {
|
|
5270
|
-
var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 =
|
|
5296
|
+
var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 = ft(r2 - this.long0), o2 = Math.sin(a2), h2 = Math.cos(a2);
|
|
5271
5297
|
if (this.es) {
|
|
5272
|
-
var c2 = h2 * n2, l2 = Math.pow(c2, 2), u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.abs(h2) > m ? Math.tan(a2) : 0,
|
|
5298
|
+
var c2 = h2 * n2, l2 = Math.pow(c2, 2), u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.abs(h2) > m ? Math.tan(a2) : 0, p2 = Math.pow(_2, 2), f2 = Math.pow(p2, 2);
|
|
5273
5299
|
e2 = 1 - this.es * Math.pow(o2, 2), c2 /= Math.sqrt(e2);
|
|
5274
5300
|
var y2 = os(a2, o2, h2, this.en);
|
|
5275
|
-
s2 = this.a * (this.k0 * c2 * (1 + l2 / 6 * (1 -
|
|
5301
|
+
s2 = this.a * (this.k0 * c2 * (1 + l2 / 6 * (1 - p2 + u2 + l2 / 20 * (5 - 18 * p2 + f2 + 14 * u2 - 58 * p2 * u2 + l2 / 42 * (61 + 179 * f2 - f2 * p2 - 479 * p2))))) + this.x0, i2 = this.a * (this.k0 * (y2 - this.ml0 + o2 * n2 * c2 / 2 * (1 + l2 / 12 * (5 - p2 + 9 * u2 + 4 * d2 + l2 / 30 * (61 + f2 - 58 * p2 + 270 * u2 - 330 * p2 * u2 + l2 / 56 * (1385 + 543 * f2 - f2 * p2 - 3111 * p2)))))) + this.y0;
|
|
5276
5302
|
} else {
|
|
5277
5303
|
var g2 = h2 * Math.sin(n2);
|
|
5278
5304
|
if (Math.abs(Math.abs(g2) - 1) < m)
|
|
@@ -5291,15 +5317,15 @@ proj4Src.exports = function() {
|
|
|
5291
5317
|
var e2, s2, i2, r2, a2 = (t2.x - this.x0) * (1 / this.a), n2 = (t2.y - this.y0) * (1 / this.a);
|
|
5292
5318
|
if (this.es)
|
|
5293
5319
|
if (s2 = cs(e2 = this.ml0 + n2 / this.k0, this.es, this.en), Math.abs(s2) < l) {
|
|
5294
|
-
var o2 = Math.sin(s2), h2 = Math.cos(s2), c2 = Math.abs(h2) > m ? Math.tan(s2) : 0, u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.pow(c2, 2),
|
|
5320
|
+
var o2 = Math.sin(s2), h2 = Math.cos(s2), c2 = Math.abs(h2) > m ? Math.tan(s2) : 0, u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.pow(c2, 2), p2 = Math.pow(_2, 2);
|
|
5295
5321
|
e2 = 1 - this.es * Math.pow(o2, 2);
|
|
5296
|
-
var
|
|
5297
|
-
i2 = s2 - (e2 *= c2) * y2 / (1 - this.es) * 0.5 * (1 - y2 / 12 * (5 + 3 * _2 - 9 * u2 * _2 + u2 - 4 * d2 - y2 / 30 * (61 + 90 * _2 - 252 * u2 * _2 + 45 *
|
|
5322
|
+
var f2 = a2 * Math.sqrt(e2) / this.k0, y2 = Math.pow(f2, 2);
|
|
5323
|
+
i2 = s2 - (e2 *= c2) * y2 / (1 - this.es) * 0.5 * (1 - y2 / 12 * (5 + 3 * _2 - 9 * u2 * _2 + u2 - 4 * d2 - y2 / 30 * (61 + 90 * _2 - 252 * u2 * _2 + 45 * p2 + 46 * u2 - y2 / 56 * (1385 + 3633 * _2 + 4095 * p2 + 1574 * p2 * _2)))), r2 = ft(this.long0 + f2 * (1 - y2 / 6 * (1 + 2 * _2 + u2 - y2 / 20 * (5 + 28 * _2 + 24 * p2 + 8 * u2 * _2 + 6 * u2 - y2 / 42 * (61 + 662 * _2 + 1320 * p2 + 720 * p2 * _2)))) / h2);
|
|
5298
5324
|
} else
|
|
5299
|
-
i2 = l *
|
|
5325
|
+
i2 = l * pt(n2), r2 = 0;
|
|
5300
5326
|
else {
|
|
5301
5327
|
var g2 = Math.exp(a2 / this.k0), M2 = 0.5 * (g2 - 1 / g2), x2 = this.lat0 + n2 / this.k0, w2 = Math.cos(x2);
|
|
5302
|
-
e2 = Math.sqrt((1 - Math.pow(w2, 2)) / (1 + Math.pow(M2, 2))), i2 = Math.asin(e2), n2 < 0 && (i2 = -i2), r2 = 0 === M2 && 0 === w2 ? 0 :
|
|
5328
|
+
e2 = Math.sqrt((1 - Math.pow(w2, 2)) / (1 + Math.pow(M2, 2))), i2 = Math.asin(e2), n2 < 0 && (i2 = -i2), r2 = 0 === M2 && 0 === w2 ? 0 : ft(Math.atan2(M2, w2) + this.long0);
|
|
5303
5329
|
}
|
|
5304
5330
|
return t2.x = r2, t2.y = i2, t2;
|
|
5305
5331
|
}
|
|
@@ -5308,18 +5334,18 @@ proj4Src.exports = function() {
|
|
|
5308
5334
|
var e2 = Math.exp(t2);
|
|
5309
5335
|
return e2 = (e2 - 1 / e2) / 2;
|
|
5310
5336
|
}
|
|
5311
|
-
function
|
|
5337
|
+
function ps(t2, e2) {
|
|
5312
5338
|
t2 = Math.abs(t2), e2 = Math.abs(e2);
|
|
5313
5339
|
var s2 = Math.max(t2, e2), i2 = Math.min(t2, e2) / (s2 || 1);
|
|
5314
5340
|
return s2 * Math.sqrt(1 + Math.pow(i2, 2));
|
|
5315
5341
|
}
|
|
5316
|
-
function
|
|
5342
|
+
function fs(t2) {
|
|
5317
5343
|
var e2 = 1 + t2, s2 = e2 - 1;
|
|
5318
5344
|
return 0 === s2 ? t2 : t2 * Math.log(e2) / s2;
|
|
5319
5345
|
}
|
|
5320
5346
|
function ys(t2) {
|
|
5321
5347
|
var e2 = Math.abs(t2);
|
|
5322
|
-
return e2 =
|
|
5348
|
+
return e2 = fs(e2 * (1 + e2 / (ps(1, e2) + 1))), t2 < 0 ? -e2 : e2;
|
|
5323
5349
|
}
|
|
5324
5350
|
function gs(t2, e2) {
|
|
5325
5351
|
for (var s2, i2 = 2 * Math.cos(2 * e2), r2 = t2.length - 1, a2 = t2[r2], n2 = 0; --r2 >= 0; )
|
|
@@ -5336,9 +5362,9 @@ proj4Src.exports = function() {
|
|
|
5336
5362
|
return e2 = (e2 + 1 / e2) / 2;
|
|
5337
5363
|
}
|
|
5338
5364
|
function ws(t2, e2, s2) {
|
|
5339
|
-
for (var i2, r2, a2 = Math.sin(e2), n2 = Math.cos(e2), o2 = ms(s2), h2 = xs(s2), c2 = 2 * n2 * h2, l2 = -2 * a2 * o2, u2 = t2.length - 1, d2 = t2[u2], _2 = 0, m2 = 0,
|
|
5340
|
-
i2 = m2, r2 = _2, d2 = c2 * (m2 = d2) - i2 - l2 * (_2 =
|
|
5341
|
-
return [(c2 = a2 * h2) * d2 - (l2 = n2 * o2) *
|
|
5365
|
+
for (var i2, r2, a2 = Math.sin(e2), n2 = Math.cos(e2), o2 = ms(s2), h2 = xs(s2), c2 = 2 * n2 * h2, l2 = -2 * a2 * o2, u2 = t2.length - 1, d2 = t2[u2], _2 = 0, m2 = 0, p2 = 0; --u2 >= 0; )
|
|
5366
|
+
i2 = m2, r2 = _2, d2 = c2 * (m2 = d2) - i2 - l2 * (_2 = p2) + t2[u2], p2 = l2 * m2 - r2 + c2 * _2;
|
|
5367
|
+
return [(c2 = a2 * h2) * d2 - (l2 = n2 * o2) * p2, c2 * p2 + l2 * d2];
|
|
5342
5368
|
}
|
|
5343
5369
|
function Ss() {
|
|
5344
5370
|
if (!this.approx && (isNaN(this.es) || this.es <= 0))
|
|
@@ -5350,10 +5376,10 @@ proj4Src.exports = function() {
|
|
|
5350
5376
|
this.Zb = -this.Qn * (i2 + Ms(this.gtu, 2 * i2));
|
|
5351
5377
|
}
|
|
5352
5378
|
function Cs(t2) {
|
|
5353
|
-
var e2 =
|
|
5379
|
+
var e2 = ft(t2.x - this.long0), s2 = t2.y;
|
|
5354
5380
|
s2 = gs(this.cbg, s2);
|
|
5355
5381
|
var i2 = Math.sin(s2), r2 = Math.cos(s2), a2 = Math.sin(e2), n2 = Math.cos(e2);
|
|
5356
|
-
s2 = Math.atan2(i2, n2 * r2), e2 = Math.atan2(a2 * r2,
|
|
5382
|
+
s2 = Math.atan2(i2, n2 * r2), e2 = Math.atan2(a2 * r2, ps(i2, r2 * n2)), e2 = ys(Math.tan(e2));
|
|
5357
5383
|
var o2, h2, c2 = ws(this.gtu, 2 * s2, 2 * e2);
|
|
5358
5384
|
return s2 += c2[0], e2 += c2[1], Math.abs(e2) <= 2.623395162778 ? (o2 = this.a * (this.Qn * e2) + this.x0, h2 = this.a * (this.Qn * s2 + this.Zb) + this.y0) : (o2 = 1 / 0, h2 = 1 / 0), t2.x = o2, t2.y = h2, t2;
|
|
5359
5385
|
}
|
|
@@ -5363,7 +5389,7 @@ proj4Src.exports = function() {
|
|
|
5363
5389
|
var a2 = ws(this.utg, 2 * r2, 2 * i2);
|
|
5364
5390
|
r2 += a2[0], i2 += a2[1], i2 = Math.atan(ms(i2));
|
|
5365
5391
|
var n2 = Math.sin(r2), o2 = Math.cos(r2), h2 = Math.sin(i2), c2 = Math.cos(i2);
|
|
5366
|
-
r2 = Math.atan2(n2 * c2,
|
|
5392
|
+
r2 = Math.atan2(n2 * c2, ps(h2, c2 * o2)), e2 = ft((i2 = Math.atan2(h2, c2 * o2)) + this.long0), s2 = gs(this.cgb, r2);
|
|
5367
5393
|
} else
|
|
5368
5394
|
e2 = 1 / 0, s2 = 1 / 0;
|
|
5369
5395
|
return t2.x = e2, t2.y = s2, t2;
|
|
@@ -5371,20 +5397,20 @@ proj4Src.exports = function() {
|
|
|
5371
5397
|
var Ps = { init: Ss, forward: Cs, inverse: Es, names: ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"] };
|
|
5372
5398
|
function bs(t2, e2) {
|
|
5373
5399
|
if (void 0 === t2) {
|
|
5374
|
-
if ((t2 = Math.floor(30 * (
|
|
5400
|
+
if ((t2 = Math.floor(30 * (ft(e2) + Math.PI) / Math.PI) + 1) < 0)
|
|
5375
5401
|
return 0;
|
|
5376
5402
|
if (t2 > 60)
|
|
5377
5403
|
return 60;
|
|
5378
5404
|
}
|
|
5379
5405
|
return t2;
|
|
5380
5406
|
}
|
|
5381
|
-
function
|
|
5407
|
+
function As() {
|
|
5382
5408
|
var t2 = bs(this.zone, this.long0);
|
|
5383
5409
|
if (void 0 === t2)
|
|
5384
5410
|
throw new Error("unknown utm zone");
|
|
5385
|
-
this.lat0 = 0, this.long0 = (6 * Math.abs(t2) - 183) *
|
|
5411
|
+
this.lat0 = 0, this.long0 = (6 * Math.abs(t2) - 183) * p, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, Ps.init.apply(this), this.forward = Ps.forward, this.inverse = Ps.inverse;
|
|
5386
5412
|
}
|
|
5387
|
-
var
|
|
5413
|
+
var vs = { init: As, names: ["Universal Transverse Mercator System", "utm"], dependsOn: "etmerc" };
|
|
5388
5414
|
function Ts(t2, e2) {
|
|
5389
5415
|
return Math.pow((1 - t2) / (1 + t2), e2);
|
|
5390
5416
|
}
|
|
@@ -5408,26 +5434,26 @@ proj4Src.exports = function() {
|
|
|
5408
5434
|
}
|
|
5409
5435
|
function Ls(t2) {
|
|
5410
5436
|
var e2, s2, i2, r2;
|
|
5411
|
-
return t2.x =
|
|
5437
|
+
return t2.x = ft(t2.x - this.long0), Gs.forward.apply(this, [t2]), e2 = Math.sin(t2.y), s2 = Math.cos(t2.y), i2 = Math.cos(t2.x), r2 = this.k0 * this.R2 / (1 + this.sinc0 * e2 + this.cosc0 * s2 * i2), t2.x = r2 * s2 * Math.sin(t2.x), t2.y = r2 * (this.cosc0 * e2 - this.sinc0 * s2 * i2), t2.x = this.a * t2.x + this.x0, t2.y = this.a * t2.y + this.y0, t2;
|
|
5412
5438
|
}
|
|
5413
5439
|
function $s(t2) {
|
|
5414
5440
|
var e2, s2, i2, r2, a2;
|
|
5415
|
-
if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, a2 =
|
|
5441
|
+
if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, a2 = ps(t2.x, t2.y)) {
|
|
5416
5442
|
var n2 = 2 * Math.atan2(a2, this.R2);
|
|
5417
5443
|
e2 = Math.sin(n2), s2 = Math.cos(n2), r2 = Math.asin(s2 * this.sinc0 + t2.y * e2 * this.cosc0 / a2), i2 = Math.atan2(t2.x * e2, a2 * this.cosc0 * s2 - t2.y * this.sinc0 * e2);
|
|
5418
5444
|
} else
|
|
5419
5445
|
r2 = this.phic0, i2 = 0;
|
|
5420
|
-
return t2.x = i2, t2.y = r2, Gs.inverse.apply(this, [t2]), t2.x =
|
|
5446
|
+
return t2.x = i2, t2.y = r2, Gs.inverse.apply(this, [t2]), t2.x = ft(t2.x + this.long0), t2;
|
|
5421
5447
|
}
|
|
5422
5448
|
var Vs = { init: Rs, forward: Ls, inverse: $s, names: ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"] };
|
|
5423
5449
|
function qs(t2, e2, s2) {
|
|
5424
5450
|
return e2 *= s2, Math.tan(0.5 * (l + t2)) * Math.pow((1 - e2) / (1 + e2), 0.5 * s2);
|
|
5425
5451
|
}
|
|
5426
5452
|
function js() {
|
|
5427
|
-
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && (this.k0 = 0.5 * (1 +
|
|
5453
|
+
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && (this.k0 = 0.5 * (1 + pt(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= m && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && Math.abs(Math.cos(this.lat_ts)) > m && (this.k0 = 0.5 * this.cons * mt(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / yt(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = mt(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - l, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
|
|
5428
5454
|
}
|
|
5429
5455
|
function Ds(t2) {
|
|
5430
|
-
var e2, s2, i2, r2, a2, n2, o2 = t2.x, h2 = t2.y, c2 = Math.sin(h2), u2 = Math.cos(h2), d2 =
|
|
5456
|
+
var e2, s2, i2, r2, a2, n2, o2 = t2.x, h2 = t2.y, c2 = Math.sin(h2), u2 = Math.cos(h2), d2 = ft(o2 - this.long0);
|
|
5431
5457
|
return Math.abs(Math.abs(o2 - this.long0) - Math.PI) <= m && Math.abs(h2 + this.lat0) <= m ? (t2.x = NaN, t2.y = NaN, t2) : this.sphere ? (e2 = 2 * this.k0 / (1 + this.sinlat0 * c2 + this.coslat0 * u2 * Math.cos(d2)), t2.x = this.a * e2 * u2 * Math.sin(d2) + this.x0, t2.y = this.a * e2 * (this.coslat0 * c2 - this.sinlat0 * u2 * Math.cos(d2)) + this.y0, t2) : (s2 = 2 * Math.atan(this.ssfn_(h2, c2, this.e)) - l, r2 = Math.cos(s2), i2 = Math.sin(s2), Math.abs(this.coslat0) <= m ? (a2 = yt(this.e, h2 * this.con, this.con * c2), n2 = 2 * this.a * this.k0 * a2 / this.cons, t2.x = this.x0 + n2 * Math.sin(o2 - this.long0), t2.y = this.y0 - this.con * n2 * Math.cos(o2 - this.long0), t2) : (Math.abs(this.sinlat0) < m ? (e2 = 2 * this.a * this.k0 / (1 + r2 * Math.cos(d2)), t2.y = e2 * i2) : (e2 = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * i2 + this.cosX0 * r2 * Math.cos(d2))), t2.y = e2 * (this.cosX0 * i2 - this.sinX0 * r2 * Math.cos(d2)) + this.y0), t2.x = e2 * r2 * Math.sin(d2) + this.x0, t2));
|
|
5432
5458
|
}
|
|
5433
5459
|
function Bs(t2) {
|
|
@@ -5436,14 +5462,14 @@ proj4Src.exports = function() {
|
|
|
5436
5462
|
var n2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y);
|
|
5437
5463
|
if (this.sphere) {
|
|
5438
5464
|
var o2 = 2 * Math.atan(n2 / (2 * this.a * this.k0));
|
|
5439
|
-
return e2 = this.long0, s2 = this.lat0, n2 <= m ? (t2.x = e2, t2.y = s2, t2) : (s2 = Math.asin(Math.cos(o2) * this.sinlat0 + t2.y * Math.sin(o2) * this.coslat0 / n2), e2 = Math.abs(this.coslat0) < m ? this.lat0 > 0 ?
|
|
5465
|
+
return e2 = this.long0, s2 = this.lat0, n2 <= m ? (t2.x = e2, t2.y = s2, t2) : (s2 = Math.asin(Math.cos(o2) * this.sinlat0 + t2.y * Math.sin(o2) * this.coslat0 / n2), e2 = Math.abs(this.coslat0) < m ? this.lat0 > 0 ? ft(this.long0 + Math.atan2(t2.x, -1 * t2.y)) : ft(this.long0 + Math.atan2(t2.x, t2.y)) : ft(this.long0 + Math.atan2(t2.x * Math.sin(o2), n2 * this.coslat0 * Math.cos(o2) - t2.y * this.sinlat0 * Math.sin(o2))), t2.x = e2, t2.y = s2, t2);
|
|
5440
5466
|
}
|
|
5441
5467
|
if (Math.abs(this.coslat0) <= m) {
|
|
5442
5468
|
if (n2 <= m)
|
|
5443
5469
|
return s2 = this.lat0, e2 = this.long0, t2.x = e2, t2.y = s2, t2;
|
|
5444
|
-
t2.x *= this.con, t2.y *= this.con, i2 = n2 * this.cons / (2 * this.a * this.k0), s2 = this.con * gt(this.e, i2), e2 = this.con *
|
|
5470
|
+
t2.x *= this.con, t2.y *= this.con, i2 = n2 * this.cons / (2 * this.a * this.k0), s2 = this.con * gt(this.e, i2), e2 = this.con * ft(this.con * this.long0 + Math.atan2(t2.x, -1 * t2.y));
|
|
5445
5471
|
} else
|
|
5446
|
-
r2 = 2 * Math.atan(n2 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), e2 = this.long0, n2 <= m ? a2 = this.X0 : (a2 = Math.asin(Math.cos(r2) * this.sinX0 + t2.y * Math.sin(r2) * this.cosX0 / n2), e2 =
|
|
5472
|
+
r2 = 2 * Math.atan(n2 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), e2 = this.long0, n2 <= m ? a2 = this.X0 : (a2 = Math.asin(Math.cos(r2) * this.sinX0 + t2.y * Math.sin(r2) * this.cosX0 / n2), e2 = ft(this.long0 + Math.atan2(t2.x * Math.sin(r2), n2 * this.cosX0 * Math.cos(r2) - t2.y * this.sinX0 * Math.sin(r2)))), s2 = -1 * gt(this.e, Math.tan(0.5 * (l + a2)));
|
|
5447
5473
|
return t2.x = e2, t2.y = s2, t2;
|
|
5448
5474
|
}
|
|
5449
5475
|
var ks = { init: js, forward: Ds, inverse: Bs, names: ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"], ssfn_: qs };
|
|
@@ -5470,20 +5496,20 @@ proj4Src.exports = function() {
|
|
|
5470
5496
|
var Ys = { init: Fs, forward: Us, inverse: Ws, names: ["somerc"] }, Qs = 1e-7;
|
|
5471
5497
|
function Xs(t2) {
|
|
5472
5498
|
var e2 = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], s2 = "object" == typeof t2.projName ? Object.keys(t2.projName)[0] : t2.projName;
|
|
5473
|
-
return "no_uoff" in t2 || "no_off" in t2 || -1 !== e2.indexOf(s2) || -1 !== e2.indexOf(
|
|
5499
|
+
return "no_uoff" in t2 || "no_off" in t2 || -1 !== e2.indexOf(s2) || -1 !== e2.indexOf(vt(s2));
|
|
5474
5500
|
}
|
|
5475
5501
|
function Hs() {
|
|
5476
|
-
var t2, e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2 = 0, _2 = 0,
|
|
5502
|
+
var t2, e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2 = 0, _2 = 0, p2 = 0, f2 = 0, M2 = 0, x2 = 0, w2 = 0;
|
|
5477
5503
|
this.no_off = Xs(this), this.no_rot = "no_rot" in this;
|
|
5478
5504
|
var S2 = false;
|
|
5479
5505
|
"alpha" in this && (S2 = true);
|
|
5480
5506
|
var C2 = false;
|
|
5481
5507
|
if ("rectified_grid_angle" in this && (C2 = true), S2 && (w2 = this.alpha), C2 && (d2 = this.rectified_grid_angle), S2 || C2)
|
|
5482
5508
|
_2 = this.longc;
|
|
5483
|
-
else if (
|
|
5509
|
+
else if (p2 = this.long1, M2 = this.lat1, f2 = this.long2, x2 = this.lat2, Math.abs(M2 - x2) <= Qs || (t2 = Math.abs(M2)) <= Qs || Math.abs(t2 - l) <= Qs || Math.abs(Math.abs(this.lat0) - l) <= Qs || Math.abs(Math.abs(x2) - l) <= Qs)
|
|
5484
5510
|
throw new Error();
|
|
5485
5511
|
var E2 = 1 - this.es;
|
|
5486
|
-
e2 = Math.sqrt(E2), Math.abs(this.lat0) > m ? (o2 = Math.sin(this.lat0), s2 = Math.cos(this.lat0), t2 = 1 - this.es * o2 * o2, this.B = s2 * s2, this.B = Math.sqrt(1 + this.es * this.B * this.B / E2), this.A = this.B * this.k0 * e2 / t2, (r2 = (i2 = this.B * e2 / (s2 * Math.sqrt(t2))) * i2 - 1) <= 0 ? r2 = 0 : (r2 = Math.sqrt(r2), this.lat0 < 0 && (r2 = -r2)), this.E = r2 += i2, this.E *= Math.pow(yt(this.e, this.lat0, o2), this.B)) : (this.B = 1 / e2, this.A = this.k0, this.E = i2 = r2 = 1), S2 || C2 ? (S2 ? (u2 = Math.asin(Math.sin(w2) / i2), C2 || (d2 = w2)) : (u2 = d2, w2 = Math.asin(i2 * Math.sin(u2))), this.lam0 = _2 - Math.asin(0.5 * (r2 - 1 / r2) * Math.tan(u2)) / this.B) : (a2 = Math.pow(yt(this.e, M2, Math.sin(M2)), this.B), n2 = Math.pow(yt(this.e, x2, Math.sin(x2)), this.B), r2 = this.E / a2, h2 = (n2 - a2) / (n2 + a2), c2 = ((c2 = this.E * this.E) - n2 * a2) / (c2 + n2 * a2), (t2 =
|
|
5512
|
+
e2 = Math.sqrt(E2), Math.abs(this.lat0) > m ? (o2 = Math.sin(this.lat0), s2 = Math.cos(this.lat0), t2 = 1 - this.es * o2 * o2, this.B = s2 * s2, this.B = Math.sqrt(1 + this.es * this.B * this.B / E2), this.A = this.B * this.k0 * e2 / t2, (r2 = (i2 = this.B * e2 / (s2 * Math.sqrt(t2))) * i2 - 1) <= 0 ? r2 = 0 : (r2 = Math.sqrt(r2), this.lat0 < 0 && (r2 = -r2)), this.E = r2 += i2, this.E *= Math.pow(yt(this.e, this.lat0, o2), this.B)) : (this.B = 1 / e2, this.A = this.k0, this.E = i2 = r2 = 1), S2 || C2 ? (S2 ? (u2 = Math.asin(Math.sin(w2) / i2), C2 || (d2 = w2)) : (u2 = d2, w2 = Math.asin(i2 * Math.sin(u2))), this.lam0 = _2 - Math.asin(0.5 * (r2 - 1 / r2) * Math.tan(u2)) / this.B) : (a2 = Math.pow(yt(this.e, M2, Math.sin(M2)), this.B), n2 = Math.pow(yt(this.e, x2, Math.sin(x2)), this.B), r2 = this.E / a2, h2 = (n2 - a2) / (n2 + a2), c2 = ((c2 = this.E * this.E) - n2 * a2) / (c2 + n2 * a2), (t2 = p2 - f2) < -Math.pi ? f2 -= g : t2 > Math.pi && (f2 += g), this.lam0 = ft(0.5 * (p2 + f2) - Math.atan(c2 * Math.tan(0.5 * this.B * (p2 - f2)) / h2) / this.B), u2 = Math.atan(2 * Math.sin(this.B * ft(p2 - this.lam0)) / (r2 - 1 / r2)), d2 = w2 = Math.asin(i2 * Math.sin(u2))), this.singam = Math.sin(u2), this.cosgam = Math.cos(u2), this.sinrot = Math.sin(d2), this.cosrot = Math.cos(d2), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(i2 * i2 - 1) / Math.cos(w2))), this.lat0 < 0 && (this.u_0 = -this.u_0)), r2 = 0.5 * u2, this.v_pole_n = this.ArB * Math.log(Math.tan(y - r2)), this.v_pole_s = this.ArB * Math.log(Math.tan(y + r2));
|
|
5487
5513
|
}
|
|
5488
5514
|
function Zs(t2) {
|
|
5489
5515
|
var e2, s2, i2, r2, a2, n2, o2, h2, c2 = {};
|
|
@@ -5517,7 +5543,7 @@ proj4Src.exports = function() {
|
|
|
5517
5543
|
}
|
|
5518
5544
|
function ei(t2) {
|
|
5519
5545
|
var e2 = t2.x, s2 = t2.y;
|
|
5520
|
-
Math.abs(2 * Math.abs(s2) - Math.PI) <= m && (s2 =
|
|
5546
|
+
Math.abs(2 * Math.abs(s2) - Math.PI) <= m && (s2 = pt(s2) * (l - 2 * m));
|
|
5521
5547
|
var i2, r2, a2 = Math.abs(Math.abs(s2) - l);
|
|
5522
5548
|
if (a2 > m)
|
|
5523
5549
|
i2 = yt(this.e, s2, Math.sin(s2)), r2 = this.a * this.f0 * Math.pow(i2, this.ns);
|
|
@@ -5526,7 +5552,7 @@ proj4Src.exports = function() {
|
|
|
5526
5552
|
return null;
|
|
5527
5553
|
r2 = 0;
|
|
5528
5554
|
}
|
|
5529
|
-
var n2 = this.ns *
|
|
5555
|
+
var n2 = this.ns * ft(e2 - this.long0);
|
|
5530
5556
|
return t2.x = this.k0 * (r2 * Math.sin(n2)) + this.x0, t2.y = this.k0 * (this.rh - r2 * Math.cos(n2)) + this.y0, t2;
|
|
5531
5557
|
}
|
|
5532
5558
|
function si(t2) {
|
|
@@ -5538,14 +5564,14 @@ proj4Src.exports = function() {
|
|
|
5538
5564
|
return null;
|
|
5539
5565
|
} else
|
|
5540
5566
|
r2 = -l;
|
|
5541
|
-
return a2 =
|
|
5567
|
+
return a2 = ft(h2 / this.ns + this.long0), t2.x = a2, t2.y = r2, t2;
|
|
5542
5568
|
}
|
|
5543
5569
|
var ii = { init: ti, forward: ei, inverse: si, names: ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_1SP", "Lambert_Conformal_Conic_2SP", "lcc", "Lambert Conic Conformal (1SP)", "Lambert Conic Conformal (2SP)"] };
|
|
5544
5570
|
function ri() {
|
|
5545
5571
|
this.a = 6377397155e-3, this.es = 0.006674372230614, this.e = Math.sqrt(this.es), this.lat0 || (this.lat0 = 0.863937979737193), this.long0 || (this.long0 = 0.4334234309119251), this.k0 || (this.k0 = 0.9999), this.s45 = 0.785398163397448, this.s90 = 2 * this.s45, this.fi0 = this.lat0, this.e2 = this.es, this.e = Math.sqrt(this.e2), this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2)), this.uq = 1.04216856380474, this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa), this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2), this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g, this.k1 = this.k0, this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)), this.s0 = 1.37008346281555, this.n = Math.sin(this.s0), this.ro0 = this.k1 * this.n0 / Math.tan(this.s0), this.ad = this.s90 - this.uq;
|
|
5546
5572
|
}
|
|
5547
5573
|
function ai(t2) {
|
|
5548
|
-
var e2, s2, i2, r2, a2, n2, o2, h2 = t2.x, c2 = t2.y, l2 =
|
|
5574
|
+
var e2, s2, i2, r2, a2, n2, o2, h2 = t2.x, c2 = t2.y, l2 = ft(h2 - this.long0);
|
|
5549
5575
|
return e2 = Math.pow((1 + this.e * Math.sin(c2)) / (1 - this.e * Math.sin(c2)), this.alfa * this.e / 2), s2 = 2 * (Math.atan(this.k * Math.pow(Math.tan(c2 / 2 + this.s45), this.alfa) / e2) - this.s45), i2 = -l2 * this.alfa, r2 = Math.asin(Math.cos(this.ad) * Math.sin(s2) + Math.sin(this.ad) * Math.cos(s2) * Math.cos(i2)), a2 = Math.asin(Math.cos(s2) * Math.sin(i2) / Math.cos(r2)), n2 = this.n * a2, o2 = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(r2 / 2 + this.s45), this.n), t2.y = o2 * Math.cos(n2) / 1, t2.x = o2 * Math.sin(n2) / 1, this.czech || (t2.y *= -1, t2.x *= -1), t2;
|
|
5550
5576
|
}
|
|
5551
5577
|
function ni(t2) {
|
|
@@ -5578,9 +5604,9 @@ proj4Src.exports = function() {
|
|
|
5578
5604
|
return t2 / Math.sqrt(1 - i2 * i2);
|
|
5579
5605
|
}
|
|
5580
5606
|
function mi(t2) {
|
|
5581
|
-
return Math.abs(t2) < l ? t2 : t2 -
|
|
5607
|
+
return Math.abs(t2) < l ? t2 : t2 - pt(t2) * Math.PI;
|
|
5582
5608
|
}
|
|
5583
|
-
function
|
|
5609
|
+
function pi(t2, e2, s2, i2, r2) {
|
|
5584
5610
|
var a2, n2;
|
|
5585
5611
|
a2 = t2 / e2;
|
|
5586
5612
|
for (var o2 = 0; o2 < 15; o2++)
|
|
@@ -5588,12 +5614,12 @@ proj4Src.exports = function() {
|
|
|
5588
5614
|
return a2;
|
|
5589
5615
|
return NaN;
|
|
5590
5616
|
}
|
|
5591
|
-
function
|
|
5617
|
+
function fi() {
|
|
5592
5618
|
this.sphere || (this.e0 = ci(this.es), this.e1 = li(this.es), this.e2 = ui(this.es), this.e3 = di(this.es), this.ml0 = this.a * hi(this.e0, this.e1, this.e2, this.e3, this.lat0));
|
|
5593
5619
|
}
|
|
5594
5620
|
function yi(t2) {
|
|
5595
5621
|
var e2, s2, i2 = t2.x, r2 = t2.y;
|
|
5596
|
-
if (i2 =
|
|
5622
|
+
if (i2 = ft(i2 - this.long0), this.sphere)
|
|
5597
5623
|
e2 = this.a * Math.asin(Math.cos(r2) * Math.sin(i2)), s2 = this.a * (Math.atan2(Math.tan(r2), Math.cos(i2)) - this.lat0);
|
|
5598
5624
|
else {
|
|
5599
5625
|
var a2 = Math.sin(r2), n2 = Math.cos(r2), o2 = _i(this.a, this.e, a2), h2 = Math.tan(r2) * Math.tan(r2), c2 = i2 * Math.cos(r2), l2 = c2 * c2, u2 = this.es * n2 * n2 / (1 - this.es);
|
|
@@ -5608,15 +5634,15 @@ proj4Src.exports = function() {
|
|
|
5608
5634
|
var a2 = r2 + this.lat0;
|
|
5609
5635
|
e2 = Math.asin(Math.sin(a2) * Math.cos(i2)), s2 = Math.atan2(Math.tan(i2), Math.cos(a2));
|
|
5610
5636
|
} else {
|
|
5611
|
-
var n2 =
|
|
5637
|
+
var n2 = pi(this.ml0 / this.a + r2, this.e0, this.e1, this.e2, this.e3);
|
|
5612
5638
|
if (Math.abs(Math.abs(n2) - l) <= m)
|
|
5613
5639
|
return t2.x = this.long0, t2.y = l, r2 < 0 && (t2.y *= -1), t2;
|
|
5614
5640
|
var o2 = _i(this.a, this.e, Math.sin(n2)), h2 = o2 * o2 * o2 / this.a / this.a * (1 - this.es), c2 = Math.pow(Math.tan(n2), 2), u2 = i2 * this.a / o2, d2 = u2 * u2;
|
|
5615
5641
|
e2 = n2 - o2 * Math.tan(n2) / h2 * u2 * u2 * (0.5 - (1 + 3 * c2) * u2 * u2 / 24), s2 = u2 * (1 - d2 * (c2 / 3 + (1 + 3 * c2) * c2 * d2 / 15)) / Math.cos(n2);
|
|
5616
5642
|
}
|
|
5617
|
-
return t2.x =
|
|
5643
|
+
return t2.x = ft(s2 + this.long0), t2.y = mi(e2), t2;
|
|
5618
5644
|
}
|
|
5619
|
-
var Mi = { init:
|
|
5645
|
+
var Mi = { init: fi, forward: yi, inverse: gi, names: ["Cassini", "Cassini_Soldner", "cass"] };
|
|
5620
5646
|
function xi(t2, e2) {
|
|
5621
5647
|
var s2;
|
|
5622
5648
|
return t2 > 1e-7 ? (1 - t2 * t2) * (e2 / (1 - (s2 = t2 * e2) * s2) - 0.5 / t2 * Math.log((1 - s2) / (1 + s2))) : 2 * e2;
|
|
@@ -5640,7 +5666,7 @@ proj4Src.exports = function() {
|
|
|
5640
5666
|
}
|
|
5641
5667
|
function Si(t2) {
|
|
5642
5668
|
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2 = t2.x, _2 = t2.y;
|
|
5643
|
-
if (d2 =
|
|
5669
|
+
if (d2 = ft(d2 - this.long0), this.sphere) {
|
|
5644
5670
|
if (a2 = Math.sin(_2), u2 = Math.cos(_2), i2 = Math.cos(d2), this.mode === this.OBLIQ || this.mode === this.EQUIT) {
|
|
5645
5671
|
if ((s2 = this.mode === this.EQUIT ? 1 + u2 * i2 : 1 + this.sinph0 * a2 + this.cosph0 * u2 * i2) <= m)
|
|
5646
5672
|
return null;
|
|
@@ -5711,12 +5737,12 @@ proj4Src.exports = function() {
|
|
|
5711
5737
|
}
|
|
5712
5738
|
e2 = Math.atan2(h2, c2), s2 = zi(Math.asin(o2), this.apa);
|
|
5713
5739
|
}
|
|
5714
|
-
return t2.x =
|
|
5740
|
+
return t2.x = ft(this.long0 + e2), t2.y = s2, t2;
|
|
5715
5741
|
}
|
|
5716
|
-
var Ei = 0.3333333333333333, Pi = 0.17222222222222222, bi = 0.10257936507936508,
|
|
5742
|
+
var Ei = 0.3333333333333333, Pi = 0.17222222222222222, bi = 0.10257936507936508, Ai = 0.06388888888888888, vi = 0.0664021164021164, Ti = 0.016415012942191543;
|
|
5717
5743
|
function Ii(t2) {
|
|
5718
5744
|
var e2, s2 = [];
|
|
5719
|
-
return s2[0] = t2 * Ei, e2 = t2 * t2, s2[0] += e2 * Pi, s2[1] = e2 *
|
|
5745
|
+
return s2[0] = t2 * Ei, e2 = t2 * t2, s2[0] += e2 * Pi, s2[1] = e2 * Ai, e2 *= t2, s2[0] += e2 * bi, s2[1] += e2 * vi, s2[2] = e2 * Ti, s2;
|
|
5720
5746
|
}
|
|
5721
5747
|
function zi(t2, e2) {
|
|
5722
5748
|
var s2 = t2 + t2;
|
|
@@ -5732,12 +5758,12 @@ proj4Src.exports = function() {
|
|
|
5732
5758
|
function Ri(t2) {
|
|
5733
5759
|
var e2 = t2.x, s2 = t2.y;
|
|
5734
5760
|
this.sin_phi = Math.sin(s2), this.cos_phi = Math.cos(s2);
|
|
5735
|
-
var i2 = xi(this.e3, this.sin_phi), r2 = this.a * Math.sqrt(this.c - this.ns0 * i2) / this.ns0, a2 = this.ns0 *
|
|
5761
|
+
var i2 = xi(this.e3, this.sin_phi), r2 = this.a * Math.sqrt(this.c - this.ns0 * i2) / this.ns0, a2 = this.ns0 * ft(e2 - this.long0), n2 = r2 * Math.sin(a2) + this.x0, o2 = this.rh - r2 * Math.cos(a2) + this.y0;
|
|
5736
5762
|
return t2.x = n2, t2.y = o2, t2;
|
|
5737
5763
|
}
|
|
5738
5764
|
function Li(t2) {
|
|
5739
5765
|
var e2, s2, i2, r2, a2, n2;
|
|
5740
|
-
return t2.x -= this.x0, t2.y = this.rh - t2.y + this.y0, this.ns0 >= 0 ? (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = 1) : (e2 = -Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = -1), r2 = 0, 0 !== e2 && (r2 = Math.atan2(i2 * t2.x, i2 * t2.y)), i2 = e2 * this.ns0 / this.a, this.sphere ? n2 = Math.asin((this.c - i2 * i2) / (2 * this.ns0)) : (s2 = (this.c - i2 * i2) / this.ns0, n2 = this.phi1z(this.e3, s2)), a2 =
|
|
5766
|
+
return t2.x -= this.x0, t2.y = this.rh - t2.y + this.y0, this.ns0 >= 0 ? (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = 1) : (e2 = -Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = -1), r2 = 0, 0 !== e2 && (r2 = Math.atan2(i2 * t2.x, i2 * t2.y)), i2 = e2 * this.ns0 / this.a, this.sphere ? n2 = Math.asin((this.c - i2 * i2) / (2 * this.ns0)) : (s2 = (this.c - i2 * i2) / this.ns0, n2 = this.phi1z(this.e3, s2)), a2 = ft(r2 / this.ns0 + this.long0), t2.x = a2, t2.y = n2, t2;
|
|
5741
5767
|
}
|
|
5742
5768
|
function $i(t2, e2) {
|
|
5743
5769
|
var s2, i2, r2, a2, n2 = Ni(0.5 * e2);
|
|
@@ -5754,11 +5780,11 @@ proj4Src.exports = function() {
|
|
|
5754
5780
|
}
|
|
5755
5781
|
function ji(t2) {
|
|
5756
5782
|
var e2, s2, i2, r2, a2, n2, o2, h2, c2 = t2.x, l2 = t2.y;
|
|
5757
|
-
return i2 =
|
|
5783
|
+
return i2 = ft(c2 - this.long0), e2 = Math.sin(l2), s2 = Math.cos(l2), r2 = Math.cos(i2), a2 = 1, (n2 = this.sin_p14 * e2 + this.cos_p14 * s2 * r2) > 0 || Math.abs(n2) <= m ? (o2 = this.x0 + this.a * a2 * s2 * Math.sin(i2) / n2, h2 = this.y0 + this.a * a2 * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2) / n2) : (o2 = this.x0 + this.infinity_dist * s2 * Math.sin(i2), h2 = this.y0 + this.infinity_dist * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2)), t2.x = o2, t2.y = h2, t2;
|
|
5758
5784
|
}
|
|
5759
5785
|
function Di(t2) {
|
|
5760
5786
|
var e2, s2, i2, r2, a2, n2;
|
|
5761
|
-
return t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) ? (r2 = Math.atan2(e2, this.rc), s2 = Math.sin(r2), n2 = Ni((i2 = Math.cos(r2)) * this.sin_p14 + t2.y * s2 * this.cos_p14 / e2), a2 = Math.atan2(t2.x * s2, e2 * this.cos_p14 * i2 - t2.y * this.sin_p14 * s2), a2 =
|
|
5787
|
+
return t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) ? (r2 = Math.atan2(e2, this.rc), s2 = Math.sin(r2), n2 = Ni((i2 = Math.cos(r2)) * this.sin_p14 + t2.y * s2 * this.cos_p14 / e2), a2 = Math.atan2(t2.x * s2, e2 * this.cos_p14 * i2 - t2.y * this.sin_p14 * s2), a2 = ft(this.long0 + a2)) : (n2 = this.phic0, a2 = 0), t2.x = a2, t2.y = n2, t2;
|
|
5762
5788
|
}
|
|
5763
5789
|
var Bi = { init: qi, forward: ji, inverse: Di, names: ["gnom"] };
|
|
5764
5790
|
function ki(t2, e2) {
|
|
@@ -5774,7 +5800,7 @@ proj4Src.exports = function() {
|
|
|
5774
5800
|
this.sphere || (this.k0 = mt(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
|
|
5775
5801
|
}
|
|
5776
5802
|
function Ui(t2) {
|
|
5777
|
-
var e2, s2, i2 = t2.x, r2 = t2.y, a2 =
|
|
5803
|
+
var e2, s2, i2 = t2.x, r2 = t2.y, a2 = ft(i2 - this.long0);
|
|
5778
5804
|
if (this.sphere)
|
|
5779
5805
|
e2 = this.x0 + this.a * a2 * Math.cos(this.lat_ts), s2 = this.y0 + this.a * Math.sin(r2) / Math.cos(this.lat_ts);
|
|
5780
5806
|
else {
|
|
@@ -5785,26 +5811,26 @@ proj4Src.exports = function() {
|
|
|
5785
5811
|
}
|
|
5786
5812
|
function Wi(t2) {
|
|
5787
5813
|
var e2, s2;
|
|
5788
|
-
return t2.x -= this.x0, t2.y -= this.y0, this.sphere ? (e2 =
|
|
5814
|
+
return t2.x -= this.x0, t2.y -= this.y0, this.sphere ? (e2 = ft(this.long0 + t2.x / this.a / Math.cos(this.lat_ts)), s2 = Math.asin(t2.y / this.a * Math.cos(this.lat_ts))) : (s2 = ki(this.e, 2 * t2.y * this.k0 / this.a), e2 = ft(this.long0 + t2.x / (this.a * this.k0))), t2.x = e2, t2.y = s2, t2;
|
|
5789
5815
|
}
|
|
5790
5816
|
var Yi = { init: Fi, forward: Ui, inverse: Wi, names: ["cea"] };
|
|
5791
5817
|
function Qi() {
|
|
5792
5818
|
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
|
|
5793
5819
|
}
|
|
5794
5820
|
function Xi(t2) {
|
|
5795
|
-
var e2 = t2.x, s2 = t2.y, i2 =
|
|
5821
|
+
var e2 = t2.x, s2 = t2.y, i2 = ft(e2 - this.long0), r2 = mi(s2 - this.lat0);
|
|
5796
5822
|
return t2.x = this.x0 + this.a * i2 * this.rc, t2.y = this.y0 + this.a * r2, t2;
|
|
5797
5823
|
}
|
|
5798
5824
|
function Hi(t2) {
|
|
5799
5825
|
var e2 = t2.x, s2 = t2.y;
|
|
5800
|
-
return t2.x =
|
|
5826
|
+
return t2.x = ft(this.long0 + (e2 - this.x0) / (this.a * this.rc)), t2.y = mi(this.lat0 + (s2 - this.y0) / this.a), t2;
|
|
5801
5827
|
}
|
|
5802
5828
|
var Zi = { init: Qi, forward: Xi, inverse: Hi, names: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"] }, Ki = 20;
|
|
5803
5829
|
function Ji() {
|
|
5804
5830
|
this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ci(this.es), this.e1 = li(this.es), this.e2 = ui(this.es), this.e3 = di(this.es), this.ml0 = this.a * hi(this.e0, this.e1, this.e2, this.e3, this.lat0);
|
|
5805
5831
|
}
|
|
5806
5832
|
function tr(t2) {
|
|
5807
|
-
var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 =
|
|
5833
|
+
var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 = ft(r2 - this.long0);
|
|
5808
5834
|
if (i2 = n2 * Math.sin(a2), this.sphere)
|
|
5809
5835
|
Math.abs(a2) <= m ? (e2 = this.a * n2, s2 = -1 * this.a * this.lat0) : (e2 = this.a * Math.sin(i2) / Math.tan(a2), s2 = this.a * (mi(a2 - this.lat0) + (1 - Math.cos(i2)) / Math.tan(a2)));
|
|
5810
5836
|
else if (Math.abs(a2) <= m)
|
|
@@ -5819,7 +5845,7 @@ proj4Src.exports = function() {
|
|
|
5819
5845
|
var e2, s2, i2, r2, a2, n2, o2, h2, c2;
|
|
5820
5846
|
if (i2 = t2.x - this.x0, r2 = t2.y - this.y0, this.sphere)
|
|
5821
5847
|
if (Math.abs(r2 + this.a * this.lat0) <= m)
|
|
5822
|
-
e2 =
|
|
5848
|
+
e2 = ft(i2 / this.a + this.long0), s2 = 0;
|
|
5823
5849
|
else {
|
|
5824
5850
|
var l2;
|
|
5825
5851
|
for (n2 = this.lat0 + r2 / this.a, o2 = i2 * i2 / this.a / this.a + n2 * n2, h2 = n2, a2 = Ki; a2; --a2)
|
|
@@ -5827,18 +5853,18 @@ proj4Src.exports = function() {
|
|
|
5827
5853
|
s2 = h2;
|
|
5828
5854
|
break;
|
|
5829
5855
|
}
|
|
5830
|
-
e2 =
|
|
5856
|
+
e2 = ft(this.long0 + Math.asin(i2 * Math.tan(h2) / this.a) / Math.sin(s2));
|
|
5831
5857
|
}
|
|
5832
5858
|
else if (Math.abs(r2 + this.ml0) <= m)
|
|
5833
|
-
s2 = 0, e2 =
|
|
5859
|
+
s2 = 0, e2 = ft(this.long0 + i2 / this.a);
|
|
5834
5860
|
else {
|
|
5835
|
-
var u2, d2, _2,
|
|
5861
|
+
var u2, d2, _2, p2, f2;
|
|
5836
5862
|
for (n2 = (this.ml0 + r2) / this.a, o2 = i2 * i2 / this.a / this.a + n2 * n2, h2 = n2, a2 = Ki; a2; --a2)
|
|
5837
|
-
if (
|
|
5863
|
+
if (f2 = this.e * Math.sin(h2), u2 = Math.sqrt(1 - f2 * f2) * Math.tan(h2), d2 = this.a * hi(this.e0, this.e1, this.e2, this.e3, h2), _2 = this.e0 - 2 * this.e1 * Math.cos(2 * h2) + 4 * this.e2 * Math.cos(4 * h2) - 6 * this.e3 * Math.cos(6 * h2), h2 -= c2 = (n2 * (u2 * (p2 = d2 / this.a) + 1) - p2 - 0.5 * u2 * (p2 * p2 + o2)) / (this.es * Math.sin(2 * h2) * (p2 * p2 + o2 - 2 * n2 * p2) / (4 * u2) + (n2 - p2) * (u2 * _2 - 2 / Math.sin(2 * h2)) - _2), Math.abs(c2) <= m) {
|
|
5838
5864
|
s2 = h2;
|
|
5839
5865
|
break;
|
|
5840
5866
|
}
|
|
5841
|
-
u2 = Math.sqrt(1 - this.es * Math.pow(Math.sin(s2), 2)) * Math.tan(s2), e2 =
|
|
5867
|
+
u2 = Math.sqrt(1 - this.es * Math.pow(Math.sin(s2), 2)) * Math.tan(s2), e2 = ft(this.long0 + Math.asin(i2 * u2 / this.a) / Math.sin(s2));
|
|
5842
5868
|
}
|
|
5843
5869
|
return t2.x = e2, t2.y = s2, t2;
|
|
5844
5870
|
}
|
|
@@ -5850,42 +5876,42 @@ proj4Src.exports = function() {
|
|
|
5850
5876
|
var e2, s2 = t2.x, i2 = t2.y - this.lat0, r2 = s2 - this.long0, a2 = i2 / c * 1e-5, n2 = r2, o2 = 1, h2 = 0;
|
|
5851
5877
|
for (e2 = 1; e2 <= 10; e2++)
|
|
5852
5878
|
o2 *= a2, h2 += this.A[e2] * o2;
|
|
5853
|
-
var l2, u2 = h2, d2 = n2, _2 = 1, m2 = 0,
|
|
5879
|
+
var l2, u2 = h2, d2 = n2, _2 = 1, m2 = 0, p2 = 0, f2 = 0;
|
|
5854
5880
|
for (e2 = 1; e2 <= 6; e2++)
|
|
5855
|
-
l2 = m2 * u2 + _2 * d2, _2 = _2 * u2 - m2 * d2, m2 = l2,
|
|
5856
|
-
return t2.x =
|
|
5881
|
+
l2 = m2 * u2 + _2 * d2, _2 = _2 * u2 - m2 * d2, m2 = l2, p2 = p2 + this.B_re[e2] * _2 - this.B_im[e2] * m2, f2 = f2 + this.B_im[e2] * _2 + this.B_re[e2] * m2;
|
|
5882
|
+
return t2.x = f2 * this.a + this.x0, t2.y = p2 * this.a + this.y0, t2;
|
|
5857
5883
|
}
|
|
5858
5884
|
function ar(t2) {
|
|
5859
5885
|
var e2, s2, i2 = t2.x, r2 = t2.y, a2 = i2 - this.x0, n2 = (r2 - this.y0) / this.a, o2 = a2 / this.a, h2 = 1, l2 = 0, u2 = 0, d2 = 0;
|
|
5860
5886
|
for (e2 = 1; e2 <= 6; e2++)
|
|
5861
5887
|
s2 = l2 * n2 + h2 * o2, h2 = h2 * n2 - l2 * o2, l2 = s2, u2 = u2 + this.C_re[e2] * h2 - this.C_im[e2] * l2, d2 = d2 + this.C_im[e2] * h2 + this.C_re[e2] * l2;
|
|
5862
5888
|
for (var _2 = 0; _2 < this.iterations; _2++) {
|
|
5863
|
-
var m2,
|
|
5889
|
+
var m2, p2 = u2, f2 = d2, y2 = n2, g2 = o2;
|
|
5864
5890
|
for (e2 = 2; e2 <= 6; e2++)
|
|
5865
|
-
m2 =
|
|
5866
|
-
|
|
5891
|
+
m2 = f2 * u2 + p2 * d2, p2 = p2 * u2 - f2 * d2, f2 = m2, y2 += (e2 - 1) * (this.B_re[e2] * p2 - this.B_im[e2] * f2), g2 += (e2 - 1) * (this.B_im[e2] * p2 + this.B_re[e2] * f2);
|
|
5892
|
+
p2 = 1, f2 = 0;
|
|
5867
5893
|
var M2 = this.B_re[1], x2 = this.B_im[1];
|
|
5868
5894
|
for (e2 = 2; e2 <= 6; e2++)
|
|
5869
|
-
m2 =
|
|
5895
|
+
m2 = f2 * u2 + p2 * d2, p2 = p2 * u2 - f2 * d2, f2 = m2, M2 += e2 * (this.B_re[e2] * p2 - this.B_im[e2] * f2), x2 += e2 * (this.B_im[e2] * p2 + this.B_re[e2] * f2);
|
|
5870
5896
|
var w2 = M2 * M2 + x2 * x2;
|
|
5871
5897
|
u2 = (y2 * M2 + g2 * x2) / w2, d2 = (g2 * M2 - y2 * x2) / w2;
|
|
5872
5898
|
}
|
|
5873
5899
|
var S2 = u2, C2 = d2, E2 = 1, P2 = 0;
|
|
5874
5900
|
for (e2 = 1; e2 <= 9; e2++)
|
|
5875
5901
|
E2 *= S2, P2 += this.D[e2] * E2;
|
|
5876
|
-
var b2 = this.lat0 + P2 * c * 1e5,
|
|
5877
|
-
return t2.x =
|
|
5902
|
+
var b2 = this.lat0 + P2 * c * 1e5, A3 = this.long0 + C2;
|
|
5903
|
+
return t2.x = A3, t2.y = b2, t2;
|
|
5878
5904
|
}
|
|
5879
5905
|
var nr = { init: ir, forward: rr, inverse: ar, names: ["New_Zealand_Map_Grid", "nzmg"] };
|
|
5880
5906
|
function or() {
|
|
5881
5907
|
}
|
|
5882
5908
|
function hr(t2) {
|
|
5883
|
-
var e2 = t2.x, s2 = t2.y, i2 =
|
|
5909
|
+
var e2 = t2.x, s2 = t2.y, i2 = ft(e2 - this.long0), r2 = this.x0 + this.a * i2, a2 = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + s2 / 2.5)) * 1.25;
|
|
5884
5910
|
return t2.x = r2, t2.y = a2, t2;
|
|
5885
5911
|
}
|
|
5886
5912
|
function cr(t2) {
|
|
5887
5913
|
t2.x -= this.x0, t2.y -= this.y0;
|
|
5888
|
-
var e2 =
|
|
5914
|
+
var e2 = ft(this.long0 + t2.x / this.a), s2 = 2.5 * (Math.atan(Math.exp(0.8 * t2.y / this.a)) - Math.PI / 4);
|
|
5889
5915
|
return t2.x = e2, t2.y = s2, t2;
|
|
5890
5916
|
}
|
|
5891
5917
|
var lr = { init: or, forward: hr, inverse: cr, names: ["Miller_Cylindrical", "mill"] }, ur = 20;
|
|
@@ -5894,7 +5920,7 @@ proj4Src.exports = function() {
|
|
|
5894
5920
|
}
|
|
5895
5921
|
function _r(t2) {
|
|
5896
5922
|
var e2, s2, i2 = t2.x, r2 = t2.y;
|
|
5897
|
-
if (i2 =
|
|
5923
|
+
if (i2 = ft(i2 - this.long0), this.sphere) {
|
|
5898
5924
|
if (this.m)
|
|
5899
5925
|
for (var a2 = this.n * Math.sin(r2), n2 = ur; n2; --n2) {
|
|
5900
5926
|
var o2 = (this.m * r2 + Math.sin(r2) - a2) / (this.m + Math.cos(r2));
|
|
@@ -5912,13 +5938,13 @@ proj4Src.exports = function() {
|
|
|
5912
5938
|
}
|
|
5913
5939
|
function mr(t2) {
|
|
5914
5940
|
var e2, s2, i2;
|
|
5915
|
-
return t2.x -= this.x0, s2 = t2.x / this.a, t2.y -= this.y0, e2 = t2.y / this.a, this.sphere ? (e2 /= this.C_y, s2 /= this.C_x * (this.m + Math.cos(e2)), this.m ? e2 = Ni((this.m * e2 + Math.sin(e2)) / this.n) : 1 !== this.n && (e2 = Ni(Math.sin(e2) / this.n)), s2 =
|
|
5941
|
+
return t2.x -= this.x0, s2 = t2.x / this.a, t2.y -= this.y0, e2 = t2.y / this.a, this.sphere ? (e2 /= this.C_y, s2 /= this.C_x * (this.m + Math.cos(e2)), this.m ? e2 = Ni((this.m * e2 + Math.sin(e2)) / this.n) : 1 !== this.n && (e2 = Ni(Math.sin(e2) / this.n)), s2 = ft(s2 + this.long0), e2 = mi(e2)) : (e2 = cs(t2.y / this.a, this.es, this.en), (i2 = Math.abs(e2)) < l ? (i2 = Math.sin(e2), s2 = ft(this.long0 + t2.x * Math.sqrt(1 - this.es * i2 * i2) / (this.a * Math.cos(e2)))) : i2 - m < l && (s2 = this.long0)), t2.x = s2, t2.y = e2, t2;
|
|
5916
5942
|
}
|
|
5917
|
-
var
|
|
5918
|
-
function
|
|
5943
|
+
var pr = { init: dr, forward: _r, inverse: mr, names: ["Sinusoidal", "sinu"] };
|
|
5944
|
+
function fr() {
|
|
5919
5945
|
}
|
|
5920
5946
|
function yr(t2) {
|
|
5921
|
-
for (var e2 = t2.x, s2 = t2.y, i2 =
|
|
5947
|
+
for (var e2 = t2.x, s2 = t2.y, i2 = ft(e2 - this.long0), r2 = s2, a2 = Math.PI * Math.sin(s2); ; ) {
|
|
5922
5948
|
var n2 = -(r2 + Math.sin(r2) - a2) / (1 + Math.cos(r2));
|
|
5923
5949
|
if (r2 += n2, Math.abs(n2) < m)
|
|
5924
5950
|
break;
|
|
@@ -5930,12 +5956,12 @@ proj4Src.exports = function() {
|
|
|
5930
5956
|
function gr(t2) {
|
|
5931
5957
|
var e2, s2;
|
|
5932
5958
|
t2.x -= this.x0, t2.y -= this.y0, s2 = t2.y / (1.4142135623731 * this.a), Math.abs(s2) > 0.999999999999 && (s2 = 0.999999999999), e2 = Math.asin(s2);
|
|
5933
|
-
var i2 =
|
|
5959
|
+
var i2 = ft(this.long0 + t2.x / (0.900316316158 * this.a * Math.cos(e2)));
|
|
5934
5960
|
i2 < -Math.PI && (i2 = -Math.PI), i2 > Math.PI && (i2 = Math.PI), s2 = (2 * e2 + Math.sin(2 * e2)) / Math.PI, Math.abs(s2) > 1 && (s2 = 1);
|
|
5935
5961
|
var r2 = Math.asin(s2);
|
|
5936
5962
|
return t2.x = i2, t2.y = r2, t2;
|
|
5937
5963
|
}
|
|
5938
|
-
var Mr = { init:
|
|
5964
|
+
var Mr = { init: fr, forward: yr, inverse: gr, names: ["Mollweide", "moll"] };
|
|
5939
5965
|
function xr() {
|
|
5940
5966
|
Math.abs(this.lat1 + this.lat2) < m || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ci(this.es), this.e1 = li(this.es), this.e2 = ui(this.es), this.e3 = di(this.es), this.sinphi = Math.sin(this.lat1), this.cosphi = Math.cos(this.lat1), this.ms1 = mt(this.e, this.sinphi, this.cosphi), this.ml1 = hi(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < m ? this.ns = this.sinphi : (this.sinphi = Math.sin(this.lat2), this.cosphi = Math.cos(this.lat2), this.ms2 = mt(this.e, this.sinphi, this.cosphi), this.ml2 = hi(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = hi(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
|
|
5941
5967
|
}
|
|
@@ -5947,36 +5973,36 @@ proj4Src.exports = function() {
|
|
|
5947
5973
|
var r2 = hi(this.e0, this.e1, this.e2, this.e3, i2);
|
|
5948
5974
|
e2 = this.a * (this.g - r2);
|
|
5949
5975
|
}
|
|
5950
|
-
var a2 = this.ns *
|
|
5976
|
+
var a2 = this.ns * ft(s2 - this.long0), n2 = this.x0 + e2 * Math.sin(a2), o2 = this.y0 + this.rh - e2 * Math.cos(a2);
|
|
5951
5977
|
return t2.x = n2, t2.y = o2, t2;
|
|
5952
5978
|
}
|
|
5953
5979
|
function Sr(t2) {
|
|
5954
5980
|
var e2, s2, i2, r2;
|
|
5955
5981
|
t2.x -= this.x0, t2.y = this.rh - t2.y + this.y0, this.ns >= 0 ? (s2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), e2 = 1) : (s2 = -Math.sqrt(t2.x * t2.x + t2.y * t2.y), e2 = -1);
|
|
5956
5982
|
var a2 = 0;
|
|
5957
|
-
return 0 !== s2 && (a2 = Math.atan2(e2 * t2.x, e2 * t2.y)), this.sphere ? (r2 =
|
|
5983
|
+
return 0 !== s2 && (a2 = Math.atan2(e2 * t2.x, e2 * t2.y)), this.sphere ? (r2 = ft(this.long0 + a2 / this.ns), i2 = mi(this.g - s2 / this.a), t2.x = r2, t2.y = i2, t2) : (i2 = pi(this.g - s2 / this.a, this.e0, this.e1, this.e2, this.e3), r2 = ft(this.long0 + a2 / this.ns), t2.x = r2, t2.y = i2, t2);
|
|
5958
5984
|
}
|
|
5959
5985
|
var Cr = { init: xr, forward: wr, inverse: Sr, names: ["Equidistant_Conic", "eqdc"] };
|
|
5960
5986
|
function Er() {
|
|
5961
5987
|
this.R = this.a;
|
|
5962
5988
|
}
|
|
5963
5989
|
function Pr(t2) {
|
|
5964
|
-
var e2, s2, i2 = t2.x, r2 = t2.y, a2 =
|
|
5990
|
+
var e2, s2, i2 = t2.x, r2 = t2.y, a2 = ft(i2 - this.long0);
|
|
5965
5991
|
Math.abs(r2) <= m && (e2 = this.x0 + this.R * a2, s2 = this.y0);
|
|
5966
5992
|
var n2 = Ni(2 * Math.abs(r2 / Math.PI));
|
|
5967
5993
|
(Math.abs(a2) <= m || Math.abs(Math.abs(r2) - l) <= m) && (e2 = this.x0, s2 = r2 >= 0 ? this.y0 + Math.PI * this.R * Math.tan(0.5 * n2) : this.y0 + Math.PI * this.R * -Math.tan(0.5 * n2));
|
|
5968
|
-
var o2 = 0.5 * Math.abs(Math.PI / a2 - a2 / Math.PI), h2 = o2 * o2, c2 = Math.sin(n2), u2 = Math.cos(n2), d2 = u2 / (c2 + u2 - 1), _2 = d2 * d2,
|
|
5994
|
+
var o2 = 0.5 * Math.abs(Math.PI / a2 - a2 / Math.PI), h2 = o2 * o2, c2 = Math.sin(n2), u2 = Math.cos(n2), d2 = u2 / (c2 + u2 - 1), _2 = d2 * d2, p2 = d2 * (2 / c2 - 1), f2 = p2 * p2, y2 = Math.PI * this.R * (o2 * (d2 - f2) + Math.sqrt(h2 * (d2 - f2) * (d2 - f2) - (f2 + h2) * (_2 - f2))) / (f2 + h2);
|
|
5969
5995
|
a2 < 0 && (y2 = -y2), e2 = this.x0 + y2;
|
|
5970
5996
|
var g2 = h2 + d2;
|
|
5971
|
-
return y2 = Math.PI * this.R * (
|
|
5997
|
+
return y2 = Math.PI * this.R * (p2 * g2 - o2 * Math.sqrt((f2 + h2) * (h2 + 1) - g2 * g2)) / (f2 + h2), s2 = r2 >= 0 ? this.y0 + y2 : this.y0 - y2, t2.x = e2, t2.y = s2, t2;
|
|
5972
5998
|
}
|
|
5973
5999
|
function br(t2) {
|
|
5974
6000
|
var e2, s2, i2, r2, a2, n2, o2, h2, c2, l2, u2, d2;
|
|
5975
|
-
return t2.x -= this.x0, t2.y -= this.y0, u2 = Math.PI * this.R, a2 = (i2 = t2.x / u2) * i2 + (r2 = t2.y / u2) * r2, u2 = 3 * (r2 * r2 / (h2 = -2 * (n2 = -Math.abs(r2) * (1 + a2)) + 1 + 2 * r2 * r2 + a2 * a2) + (2 * (o2 = n2 - 2 * r2 * r2 + i2 * i2) * o2 * o2 / h2 / h2 / h2 - 9 * n2 * o2 / h2 / h2) / 27) / (c2 = (n2 - o2 * o2 / 3 / h2) / h2) / (l2 = 2 * Math.sqrt(-c2 / 3)), Math.abs(u2) > 1 && (u2 = u2 >= 0 ? 1 : -1), d2 = Math.acos(u2) / 3, s2 = t2.y >= 0 ? (-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI : -(-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI, e2 = Math.abs(i2) < m ? this.long0 :
|
|
6001
|
+
return t2.x -= this.x0, t2.y -= this.y0, u2 = Math.PI * this.R, a2 = (i2 = t2.x / u2) * i2 + (r2 = t2.y / u2) * r2, u2 = 3 * (r2 * r2 / (h2 = -2 * (n2 = -Math.abs(r2) * (1 + a2)) + 1 + 2 * r2 * r2 + a2 * a2) + (2 * (o2 = n2 - 2 * r2 * r2 + i2 * i2) * o2 * o2 / h2 / h2 / h2 - 9 * n2 * o2 / h2 / h2) / 27) / (c2 = (n2 - o2 * o2 / 3 / h2) / h2) / (l2 = 2 * Math.sqrt(-c2 / 3)), Math.abs(u2) > 1 && (u2 = u2 >= 0 ? 1 : -1), d2 = Math.acos(u2) / 3, s2 = t2.y >= 0 ? (-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI : -(-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI, e2 = Math.abs(i2) < m ? this.long0 : ft(this.long0 + Math.PI * (a2 - 1 + Math.sqrt(1 + 2 * (i2 * i2 - r2 * r2) + a2 * a2)) / 2 / i2), t2.x = e2, t2.y = s2, t2;
|
|
5976
6002
|
}
|
|
5977
|
-
var
|
|
6003
|
+
var Ar, vr = { init: Er, forward: Pr, inverse: br, names: ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"] }, Tr = { exports: {} };
|
|
5978
6004
|
function Ir() {
|
|
5979
|
-
return
|
|
6005
|
+
return Ar || (Ar = 1, function(t2) {
|
|
5980
6006
|
var e2, s2, i2, r2;
|
|
5981
6007
|
e2 = function(e3) {
|
|
5982
6008
|
t2.exports ? t2.exports = e3 : window.geodesic = e3;
|
|
@@ -6077,15 +6103,15 @@ proj4Src.exports = function() {
|
|
|
6077
6103
|
this._s = e3.remainder(this._s, t4), this.Add(0);
|
|
6078
6104
|
};
|
|
6079
6105
|
}(r2.Accumulator, r2.Math), r2.Geodesic = {}, r2.GeodesicLine = {}, r2.PolygonArea = {}, function(t3, e3, s3, i3, r3) {
|
|
6080
|
-
var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2,
|
|
6081
|
-
t3.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t3.nC1_ =
|
|
6106
|
+
var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, p2, f2 = 6, y2 = f2, g2 = f2, M2 = f2, x2 = M2, w2 = 20, S2 = w2 + i3.digits + 10, C2 = i3.epsilon, E2 = 200 * C2, P2 = Math.sqrt(C2), b2 = C2, A3 = 1e3 * P2, v2 = 0, T2 = 31, I2 = 32640;
|
|
6107
|
+
t3.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t3.nC1_ = f2, t3.nC1p_ = f2, t3.nC2_ = f2, t3.nC3_ = f2, t3.nC4_ = f2, a2 = t3.nC3_ * (t3.nC3_ - 1) / 2, n2 = t3.nC4_ * (t3.nC4_ + 1) / 2, t3.CAP_C1 = 1, t3.CAP_C1p = 2, t3.CAP_C2 = 4, t3.CAP_C3 = 8, t3.CAP_C4 = 16, t3.NONE = 0, t3.ARC = 64, t3.LATITUDE = 128 | v2, t3.LONGITUDE = 256 | t3.CAP_C3, t3.AZIMUTH = 512 | v2, t3.DISTANCE = 1024 | t3.CAP_C1, t3.STANDARD = t3.LATITUDE | t3.LONGITUDE | t3.AZIMUTH | t3.DISTANCE, t3.DISTANCE_IN = 2048 | t3.CAP_C1 | t3.CAP_C1p, t3.REDUCEDLENGTH = 4096 | t3.CAP_C1 | t3.CAP_C2, t3.GEODESICSCALE = 8192 | t3.CAP_C1 | t3.CAP_C2, t3.AREA = 16384 | t3.CAP_C4, t3.ALL = I2 | T2, t3.LONG_UNROLL = 32768, t3.OUT_MASK = I2 | t3.LONG_UNROLL, t3.SinCosSeries = function(t4, e4, s4, i4) {
|
|
6082
6108
|
var r4 = i4.length, a3 = r4 - (t4 ? 1 : 0), n3 = 2 * (s4 - e4) * (s4 + e4), o3 = 1 & a3 ? i4[--r4] : 0, h3 = 0;
|
|
6083
6109
|
for (a3 = Math.floor(a3 / 2); a3--; )
|
|
6084
6110
|
o3 = n3 * (h3 = n3 * o3 - h3 + i4[--r4]) - o3 + i4[--r4];
|
|
6085
6111
|
return t4 ? 2 * e4 * s4 * o3 : s4 * (o3 - h3);
|
|
6086
6112
|
}, o2 = function(t4, e4) {
|
|
6087
|
-
var s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3,
|
|
6088
|
-
return 0 ===
|
|
6113
|
+
var s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3, p3 = i3.sq(t4), f3 = i3.sq(e4), y3 = (p3 + f3 - 1) / 6;
|
|
6114
|
+
return 0 === f3 && y3 <= 0 ? s4 = 0 : (h3 = y3, (o3 = (r4 = p3 * f3 / 4) * (r4 + 2 * (n3 = y3 * (a3 = i3.sq(y3))))) >= 0 ? (c3 = r4 + n3, c3 += c3 < 0 ? -Math.sqrt(o3) : Math.sqrt(o3), h3 += (l3 = i3.cbrt(c3)) + (0 !== l3 ? a3 / l3 : 0)) : (u3 = Math.atan2(Math.sqrt(-o3), -(r4 + n3)), h3 += 2 * y3 * Math.cos(u3 / 3)), d3 = Math.sqrt(i3.sq(h3) + f3), m3 = ((_3 = h3 < 0 ? f3 / (d3 - h3) : h3 + d3) - f3) / (2 * d3), s4 = _3 / (Math.sqrt(_3 + i3.sq(m3)) + m3)), s4;
|
|
6089
6115
|
}, h2 = [1, 4, 64, 0, 256], t3.A1m1f = function(t4) {
|
|
6090
6116
|
var e4 = Math.floor(y2 / 2);
|
|
6091
6117
|
return (i3.polyval(e4, h2, 0, i3.sq(t4)) / h2[e4 + 1] + t4) / (1 - t4);
|
|
@@ -6119,11 +6145,11 @@ proj4Src.exports = function() {
|
|
|
6119
6145
|
for (e4 = 1; e4 < t3.nC3_; ++e4)
|
|
6120
6146
|
for (s4 = t3.nC3_ - 1; s4 >= e4; --s4)
|
|
6121
6147
|
r4 = Math.min(t3.nC3_ - s4 - 1, s4), this._C3x[n3++] = i3.polyval(r4, m2, a3, this._n) / m2[a3 + r4 + 1], a3 += r4 + 2;
|
|
6122
|
-
},
|
|
6148
|
+
}, p2 = [97, 15015, 1088, 156, 45045, -224, -4784, 1573, 45045, -10656, 14144, -4576, -858, 45045, 64, 624, -4576, 6864, -3003, 15015, 100, 208, 572, 3432, -12012, 30030, 45045, 1, 9009, -2944, 468, 135135, 5792, 1040, -1287, 135135, 5952, -11648, 9152, -2574, 135135, -64, -624, 4576, -6864, 3003, 135135, 8, 10725, 1856, -936, 225225, -8448, 4992, -1144, 225225, -1440, 4160, -4576, 1716, 225225, -136, 63063, 1024, -208, 105105, 3584, -3328, 1144, 315315, -128, 135135, -2560, 832, 405405, 128, 99099], t3.Geodesic.prototype.C4coeff = function() {
|
|
6123
6149
|
var e4, s4, r4, a3 = 0, n3 = 0;
|
|
6124
6150
|
for (e4 = 0; e4 < t3.nC4_; ++e4)
|
|
6125
6151
|
for (s4 = t3.nC4_ - 1; s4 >= e4; --s4)
|
|
6126
|
-
r4 = t3.nC4_ - s4 - 1, this._C4x[n3++] = i3.polyval(r4,
|
|
6152
|
+
r4 = t3.nC4_ - s4 - 1, this._C4x[n3++] = i3.polyval(r4, p2, a3, this._n) / p2[a3 + r4 + 1], a3 += r4 + 2;
|
|
6127
6153
|
}, t3.Geodesic.prototype.A3f = function(t4) {
|
|
6128
6154
|
return i3.polyval(x2 - 1, this._A3x, 0, t4);
|
|
6129
6155
|
}, t3.Geodesic.prototype.C3f = function(e4, s4) {
|
|
@@ -6135,37 +6161,37 @@ proj4Src.exports = function() {
|
|
|
6135
6161
|
for (r4 = 0; r4 < t3.nC4_; ++r4)
|
|
6136
6162
|
a3 = t3.nC4_ - r4 - 1, s4[r4] = n3 * i3.polyval(a3, this._C4x, o3, e4), o3 += a3 + 1, n3 *= e4;
|
|
6137
6163
|
}, t3.Geodesic.prototype.Lengths = function(e4, s4, i4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3) {
|
|
6138
|
-
var m3,
|
|
6164
|
+
var m3, p3, f3, y3, g3 = {}, M3 = 0, x3 = 0, w3 = 0, S3 = 0;
|
|
6139
6165
|
if ((u3 &= t3.OUT_MASK) & (t3.DISTANCE | t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (w3 = t3.A1m1f(e4), t3.C1f(e4, d3), u3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (S3 = t3.A2m1f(e4), t3.C2f(e4, _3), M3 = w3 - S3, S3 = 1 + S3), w3 = 1 + w3), u3 & t3.DISTANCE)
|
|
6140
6166
|
m3 = t3.SinCosSeries(true, n3, o3, d3) - t3.SinCosSeries(true, i4, r4, d3), g3.s12b = w3 * (s4 + m3), u3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (x3 = M3 * s4 + (w3 * m3 - S3 * (t3.SinCosSeries(true, n3, o3, _3) - t3.SinCosSeries(true, i4, r4, _3))));
|
|
6141
6167
|
else if (u3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE)) {
|
|
6142
|
-
for (
|
|
6143
|
-
_3[
|
|
6168
|
+
for (p3 = 1; p3 <= t3.nC2_; ++p3)
|
|
6169
|
+
_3[p3] = w3 * d3[p3] - S3 * _3[p3];
|
|
6144
6170
|
x3 = M3 * s4 + (t3.SinCosSeries(true, n3, o3, _3) - t3.SinCosSeries(true, i4, r4, _3));
|
|
6145
6171
|
}
|
|
6146
|
-
return u3 & t3.REDUCEDLENGTH && (g3.m0 = M3, g3.m12b = h3 * (r4 * n3) - a3 * (i4 * o3) - r4 * o3 * x3), u3 & t3.GEODESICSCALE && (
|
|
6172
|
+
return u3 & t3.REDUCEDLENGTH && (g3.m0 = M3, g3.m12b = h3 * (r4 * n3) - a3 * (i4 * o3) - r4 * o3 * x3), u3 & t3.GEODESICSCALE && (f3 = r4 * o3 + i4 * n3, y3 = this._ep2 * (c3 - l3) * (c3 + l3) / (a3 + h3), g3.M12 = f3 + (y3 * n3 - o3 * x3) * i4 / a3, g3.M21 = f3 - (y3 * i4 - r4 * x3) * n3 / h3), g3;
|
|
6147
6173
|
}, t3.Geodesic.prototype.InverseStart = function(e4, s4, r4, a3, n3, h3, c3, l3, u3, d3, _3) {
|
|
6148
|
-
var m3,
|
|
6149
|
-
return L2.sig12 = -1, m3 = a3 * s4, m3 += n3 * e4, (
|
|
6150
|
-
}, t3.Geodesic.prototype.Lambda12 = function(e4, s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3,
|
|
6151
|
-
var
|
|
6152
|
-
return 0 === e4 && 0 === c3 && (c3 = -t3.tiny_), y3 = h3 * s4, g3 = i3.hypot(c3, h3 * e4), T3.ssig1 = e4, M3 = y3 * e4, T3.csig1 = x3 = c3 * s4,
|
|
6174
|
+
var m3, p3, f3, y3, g3, M3, x3, w3, S3, C3, P3, b3, v3, T3, I3, z2, O2, N2, G2, R2, L2 = {}, $2 = a3 * s4 - n3 * e4, V2 = n3 * s4 + a3 * e4;
|
|
6175
|
+
return L2.sig12 = -1, m3 = a3 * s4, m3 += n3 * e4, (p3 = V2 >= 0 && $2 < 0.5 && n3 * c3 < 0.5) ? (y3 = i3.sq(e4 + a3), y3 /= y3 + i3.sq(s4 + n3), L2.dnm = Math.sqrt(1 + this._ep2 * y3), f3 = c3 / (this._f1 * L2.dnm), g3 = Math.sin(f3), M3 = Math.cos(f3)) : (g3 = l3, M3 = u3), L2.salp1 = n3 * g3, L2.calp1 = M3 >= 0 ? $2 + n3 * e4 * i3.sq(g3) / (1 + M3) : m3 - n3 * e4 * i3.sq(g3) / (1 - M3), w3 = i3.hypot(L2.salp1, L2.calp1), S3 = e4 * a3 + s4 * n3 * M3, p3 && w3 < this._etol2 ? (L2.salp2 = s4 * g3, L2.calp2 = $2 - s4 * a3 * (M3 >= 0 ? i3.sq(g3) / (1 + M3) : 1 - M3), x3 = i3.hypot(L2.salp2, L2.calp2), L2.salp2 /= x3, L2.calp2 /= x3, L2.sig12 = Math.atan2(w3, S3)) : Math.abs(this._n) > 0.1 || S3 >= 0 || w3 >= 6 * Math.abs(this._n) * Math.PI * i3.sq(s4) || (R2 = Math.atan2(-l3, -u3), this.f >= 0 ? (T3 = (v3 = i3.sq(e4) * this._ep2) / (2 * (1 + Math.sqrt(1 + v3)) + v3), C3 = R2 / (b3 = this.f * s4 * this.A3f(T3) * Math.PI), P3 = m3 / (b3 * s4)) : (I3 = n3 * s4 - a3 * e4, z2 = Math.atan2(m3, I3), P3 = c3 / (b3 = ((C3 = (O2 = this.Lengths(this._n, Math.PI + z2, e4, -s4, r4, a3, n3, h3, s4, n3, t3.REDUCEDLENGTH, d3, _3)).m12b / (s4 * n3 * O2.m0 * Math.PI) - 1) < -0.01 ? m3 / C3 : -this.f * i3.sq(s4) * Math.PI) / s4)), P3 > -E2 && C3 > -1 - A3 ? this.f >= 0 ? (L2.salp1 = Math.min(1, -C3), L2.calp1 = -Math.sqrt(1 - i3.sq(L2.salp1))) : (L2.calp1 = Math.max(C3 > -E2 ? 0 : -1, C3), L2.salp1 = Math.sqrt(1 - i3.sq(L2.calp1))) : (N2 = o2(C3, P3), G2 = b3 * (this.f >= 0 ? -C3 * N2 / (1 + N2) : -P3 * (1 + N2) / N2), g3 = Math.sin(G2), M3 = -Math.cos(G2), L2.salp1 = n3 * g3, L2.calp1 = m3 - n3 * e4 * i3.sq(g3) / (1 - M3))), L2.salp1 <= 0 ? (L2.salp1 = 1, L2.calp1 = 0) : (x3 = i3.hypot(L2.salp1, L2.calp1), L2.salp1 /= x3, L2.calp1 /= x3), L2;
|
|
6176
|
+
}, t3.Geodesic.prototype.Lambda12 = function(e4, s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3, p3) {
|
|
6177
|
+
var f3, y3, g3, M3, x3, w3, S3, C3, E3, P3, b3, A4, v3, T3 = {};
|
|
6178
|
+
return 0 === e4 && 0 === c3 && (c3 = -t3.tiny_), y3 = h3 * s4, g3 = i3.hypot(c3, h3 * e4), T3.ssig1 = e4, M3 = y3 * e4, T3.csig1 = x3 = c3 * s4, f3 = i3.hypot(T3.ssig1, T3.csig1), T3.ssig1 /= f3, T3.csig1 /= f3, T3.salp2 = n3 !== s4 ? y3 / n3 : h3, T3.calp2 = n3 !== s4 || Math.abs(a3) !== -e4 ? Math.sqrt(i3.sq(c3 * s4) + (s4 < -e4 ? (n3 - s4) * (s4 + n3) : (e4 - a3) * (e4 + a3))) / n3 : Math.abs(c3), T3.ssig2 = a3, w3 = y3 * a3, T3.csig2 = S3 = T3.calp2 * n3, f3 = i3.hypot(T3.ssig2, T3.csig2), T3.ssig2 /= f3, T3.csig2 /= f3, T3.sig12 = Math.atan2(Math.max(0, T3.csig1 * T3.ssig2 - T3.ssig1 * T3.csig2), T3.csig1 * T3.csig2 + T3.ssig1 * T3.ssig2), C3 = Math.max(0, x3 * w3 - M3 * S3), E3 = x3 * S3 + M3 * w3, b3 = Math.atan2(C3 * u3 - E3 * l3, E3 * u3 + C3 * l3), A4 = i3.sq(g3) * this._ep2, T3.eps = A4 / (2 * (1 + Math.sqrt(1 + A4)) + A4), this.C3f(T3.eps, p3), P3 = t3.SinCosSeries(true, T3.ssig2, T3.csig2, p3) - t3.SinCosSeries(true, T3.ssig1, T3.csig1, p3), T3.domg12 = -this.f * this.A3f(T3.eps) * y3 * (T3.sig12 + P3), T3.lam12 = b3 + T3.domg12, d3 && (0 === T3.calp2 ? T3.dlam12 = -2 * this._f1 * r4 / e4 : (v3 = this.Lengths(T3.eps, T3.sig12, T3.ssig1, T3.csig1, r4, T3.ssig2, T3.csig2, o3, s4, n3, t3.REDUCEDLENGTH, _3, m3), T3.dlam12 = v3.m12b, T3.dlam12 *= this._f1 / (T3.calp2 * n3))), T3;
|
|
6153
6179
|
}, t3.Geodesic.prototype.Inverse = function(e4, s4, r4, a3, n3) {
|
|
6154
6180
|
var o3, h3;
|
|
6155
6181
|
return n3 || (n3 = t3.STANDARD), n3 === t3.LONG_UNROLL && (n3 |= t3.STANDARD), n3 &= t3.OUT_MASK, h3 = (o3 = this.InverseInt(e4, s4, r4, a3, n3)).vals, n3 & t3.AZIMUTH && (h3.azi1 = i3.atan2d(o3.salp1, o3.calp1), h3.azi2 = i3.atan2d(o3.salp2, o3.calp2)), h3;
|
|
6156
6182
|
}, t3.Geodesic.prototype.InverseInt = function(e4, s4, r4, a3, n3) {
|
|
6157
|
-
var o3, h3, c3, l3, u3, d3, _3, m3,
|
|
6158
|
-
if (St2.lat1 = e4 = i3.LatFix(e4), St2.lat2 = r4 = i3.LatFix(r4), e4 = i3.AngRound(e4), r4 = i3.AngRound(r4), h3 = (o3 = i3.AngDiff(s4, a3)).e, o3 = o3.d, n3 & t3.LONG_UNROLL ? (St2.lon1 = s4, St2.lon2 = s4 + o3 + h3) : (St2.lon1 = i3.AngNormalize(s4), St2.lon2 = i3.AngNormalize(a3)), h3 *= c3 = i3.copysign(1, o3), E3 = (o3 *= c3) * i3.degree, P3 = (l3 = i3.sincosde(o3, h3)).s,
|
|
6159
|
-
T3 = z2 = 0, I3 = O2 = 1, y3 = this.a * E3,
|
|
6183
|
+
var o3, h3, c3, l3, u3, d3, _3, m3, p3, f3, y3, g3, M3, x3, E3, P3, A4, v3, T3, I3, z2, O2, N2, G2, R2, L2, $2, V2, q2, j2, D2, B2, k2, F2, U2, W2, Y2, Q2, X2, H2, Z2, K2, J2, tt2, et2, st2, it2, rt2, at2, nt2, ot2, ht2, ct2, lt2, ut2, dt2, _t2, mt2, pt2, ft2, yt2, gt2, Mt2, xt2, wt2, St2 = {};
|
|
6184
|
+
if (St2.lat1 = e4 = i3.LatFix(e4), St2.lat2 = r4 = i3.LatFix(r4), e4 = i3.AngRound(e4), r4 = i3.AngRound(r4), h3 = (o3 = i3.AngDiff(s4, a3)).e, o3 = o3.d, n3 & t3.LONG_UNROLL ? (St2.lon1 = s4, St2.lon2 = s4 + o3 + h3) : (St2.lon1 = i3.AngNormalize(s4), St2.lon2 = i3.AngNormalize(a3)), h3 *= c3 = i3.copysign(1, o3), E3 = (o3 *= c3) * i3.degree, P3 = (l3 = i3.sincosde(o3, h3)).s, A4 = l3.c, h3 = 180 - o3 - h3, (u3 = Math.abs(e4) < Math.abs(r4) || isNaN(r4) ? -1 : 1) < 0 && (c3 *= -1, [r4, e4] = [e4, r4]), e4 *= d3 = i3.copysign(1, -e4), r4 *= d3, l3 = i3.sincosd(e4), _3 = this._f1 * l3.s, m3 = l3.c, _3 /= l3 = i3.hypot(_3, m3), m3 /= l3, m3 = Math.max(t3.tiny_, m3), l3 = i3.sincosd(r4), p3 = this._f1 * l3.s, f3 = l3.c, p3 /= l3 = i3.hypot(p3, f3), f3 /= l3, f3 = Math.max(t3.tiny_, f3), m3 < -_3 ? f3 === m3 && (p3 = i3.copysign(_3, p3)) : Math.abs(p3) === -_3 && (f3 = m3), M3 = Math.sqrt(1 + this._ep2 * i3.sq(_3)), x3 = Math.sqrt(1 + this._ep2 * i3.sq(p3)), N2 = new Array(t3.nC1_ + 1), G2 = new Array(t3.nC2_ + 1), R2 = new Array(t3.nC3_), (L2 = -90 === e4 || 0 === P3) && (I3 = P3, O2 = 0, V2 = _3, q2 = (T3 = A4) * m3, j2 = p3, D2 = (z2 = 1) * f3, v3 = Math.atan2(Math.max(0, q2 * j2 - V2 * D2), q2 * D2 + V2 * j2), y3 = ($2 = this.Lengths(this._n, v3, V2, q2, M3, j2, D2, x3, m3, f3, n3 | t3.DISTANCE | t3.REDUCEDLENGTH, N2, G2)).s12b, g3 = $2.m12b, n3 & t3.GEODESICSCALE && (St2.M12 = $2.M12, St2.M21 = $2.M21), v3 < 1 || g3 >= 0 ? ((v3 < 3 * t3.tiny_ || v3 < C2 && (y3 < 0 || g3 < 0)) && (v3 = g3 = y3 = 0), g3 *= this._b, y3 *= this._b, St2.a12 = v3 / i3.degree) : L2 = false), _t2 = 2, !L2 && 0 === _3 && (this.f <= 0 || h3 >= 180 * this.f))
|
|
6185
|
+
T3 = z2 = 0, I3 = O2 = 1, y3 = this.a * E3, v3 = k2 = E3 / this._f1, g3 = this._b * Math.sin(v3), n3 & t3.GEODESICSCALE && (St2.M12 = St2.M21 = Math.cos(v3)), St2.a12 = o3 / this._f1;
|
|
6160
6186
|
else if (!L2)
|
|
6161
|
-
if (
|
|
6162
|
-
O2 = $2.salp2, z2 = $2.calp2, F2 = $2.dnm, y3 =
|
|
6187
|
+
if (v3 = ($2 = this.InverseStart(_3, m3, M3, p3, f3, x3, E3, P3, A4, N2, G2)).sig12, I3 = $2.salp1, T3 = $2.calp1, v3 >= 0)
|
|
6188
|
+
O2 = $2.salp2, z2 = $2.calp2, F2 = $2.dnm, y3 = v3 * this._b * F2, g3 = i3.sq(F2) * this._b * Math.sin(v3 / F2), n3 & t3.GEODESICSCALE && (St2.M12 = St2.M21 = Math.cos(v3 / F2)), St2.a12 = v3 / i3.degree, k2 = E3 / (this._f1 * F2);
|
|
6163
6189
|
else {
|
|
6164
|
-
for (U2 = 0, W2 = t3.tiny_, Y2 = 1, Q2 = t3.tiny_, X2 = -1, H2 = false, Z2 = false; K2 = ($2 = this.Lambda12(_3, m3, M3,
|
|
6190
|
+
for (U2 = 0, W2 = t3.tiny_, Y2 = 1, Q2 = t3.tiny_, X2 = -1, H2 = false, Z2 = false; K2 = ($2 = this.Lambda12(_3, m3, M3, p3, f3, x3, I3, T3, P3, A4, U2 < w2, N2, G2, R2)).lam12, O2 = $2.salp2, z2 = $2.calp2, v3 = $2.sig12, V2 = $2.ssig1, q2 = $2.csig1, j2 = $2.ssig2, D2 = $2.csig2, B2 = $2.eps, pt2 = $2.domg12, J2 = $2.dlam12, !Z2 && Math.abs(K2) >= (H2 ? 8 : 1) * C2 && U2 != S2; ++U2)
|
|
6165
6191
|
K2 > 0 && (U2 < w2 || T3 / I3 > X2 / Q2) ? (Q2 = I3, X2 = T3) : K2 < 0 && (U2 < w2 || T3 / I3 < Y2 / W2) && (W2 = I3, Y2 = T3), U2 < w2 && J2 > 0 && (tt2 = -K2 / J2, Math.abs(tt2) < Math.PI && (et2 = Math.sin(tt2), (it2 = I3 * (st2 = Math.cos(tt2)) + T3 * et2) > 0)) ? (T3 = T3 * st2 - I3 * et2, I3 = it2, I3 /= l3 = i3.hypot(I3, T3), T3 /= l3, H2 = Math.abs(K2) <= 16 * C2) : (I3 = (W2 + Q2) / 2, T3 = (Y2 + X2) / 2, I3 /= l3 = i3.hypot(I3, T3), T3 /= l3, H2 = false, Z2 = Math.abs(W2 - I3) + (Y2 - T3) < b2 || Math.abs(I3 - Q2) + (T3 - X2) < b2);
|
|
6166
|
-
rt2 = n3 | (n3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) ? t3.DISTANCE : t3.NONE), y3 = ($2 = this.Lengths(B2,
|
|
6192
|
+
rt2 = n3 | (n3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) ? t3.DISTANCE : t3.NONE), y3 = ($2 = this.Lengths(B2, v3, V2, q2, M3, j2, D2, x3, m3, f3, rt2, N2, G2)).s12b, g3 = $2.m12b, n3 & t3.GEODESICSCALE && (St2.M12 = $2.M12, St2.M21 = $2.M21), g3 *= this._b, y3 *= this._b, St2.a12 = v3 / i3.degree, n3 & t3.AREA && (xt2 = Math.sin(pt2), _t2 = P3 * (wt2 = Math.cos(pt2)) - A4 * xt2, mt2 = A4 * wt2 + P3 * xt2);
|
|
6167
6193
|
}
|
|
6168
|
-
return n3 & t3.DISTANCE && (St2.s12 = 0 + y3), n3 & t3.REDUCEDLENGTH && (St2.m12 = 0 + g3), n3 & t3.AREA && (at2 = I3 * m3, 0 !== (nt2 = i3.hypot(T3, I3 * _3)) && 0 !== at2 ? (V2 = _3, q2 = T3 * m3, j2 =
|
|
6194
|
+
return n3 & t3.DISTANCE && (St2.s12 = 0 + y3), n3 & t3.REDUCEDLENGTH && (St2.m12 = 0 + g3), n3 & t3.AREA && (at2 = I3 * m3, 0 !== (nt2 = i3.hypot(T3, I3 * _3)) && 0 !== at2 ? (V2 = _3, q2 = T3 * m3, j2 = p3, D2 = z2 * f3, B2 = (ht2 = i3.sq(nt2) * this._ep2) / (2 * (1 + Math.sqrt(1 + ht2)) + ht2), ct2 = i3.sq(this.a) * nt2 * at2 * this._e2, V2 /= l3 = i3.hypot(V2, q2), q2 /= l3, j2 /= l3 = i3.hypot(j2, D2), D2 /= l3, lt2 = new Array(t3.nC4_), this.C4f(B2, lt2), ut2 = t3.SinCosSeries(false, V2, q2, lt2), dt2 = t3.SinCosSeries(false, j2, D2, lt2), St2.S12 = ct2 * (dt2 - ut2)) : St2.S12 = 0, L2 || 2 != _t2 || (_t2 = Math.sin(k2), mt2 = Math.cos(k2)), !L2 && mt2 > -0.7071 && p3 - _3 < 1.75 ? (pt2 = 1 + mt2, ft2 = 1 + m3, yt2 = 1 + f3, ot2 = 2 * Math.atan2(_t2 * (_3 * yt2 + p3 * ft2), pt2 * (_3 * p3 + ft2 * yt2))) : (Mt2 = z2 * T3 + O2 * I3, 0 === (gt2 = O2 * T3 - z2 * I3) && Mt2 < 0 && (gt2 = t3.tiny_ * T3, Mt2 = -1), ot2 = Math.atan2(gt2, Mt2)), St2.S12 += this._c2 * ot2, St2.S12 *= u3 * c3 * d3, St2.S12 += 0), u3 < 0 && ([O2, I3] = [I3, O2], [z2, T3] = [T3, z2], n3 & t3.GEODESICSCALE && ([St2.M21, St2.M12] = [St2.M12, St2.M21])), { vals: St2, salp1: I3 *= u3 * c3, calp1: T3 *= u3 * d3, salp2: O2 *= u3 * c3, calp2: z2 *= u3 * d3 };
|
|
6169
6195
|
}, t3.Geodesic.prototype.GenDirect = function(s4, i4, r4, a3, n3, o3) {
|
|
6170
6196
|
return o3 ? o3 === t3.LONG_UNROLL && (o3 |= t3.STANDARD) : o3 = t3.STANDARD, a3 || (o3 |= t3.DISTANCE_IN), new e3.GeodesicLine(this, s4, i4, r4, o3).GenPosition(a3, n3, o3);
|
|
6171
6197
|
}, t3.Geodesic.prototype.Direct = function(t4, e4, s4, i4, r4) {
|
|
@@ -6192,8 +6218,8 @@ proj4Src.exports = function() {
|
|
|
6192
6218
|
var c2, l2, u2, d2, _2, m2;
|
|
6193
6219
|
n2 || (n2 = t3.STANDARD | t3.DISTANCE_IN), this.a = e4.a, this.f = e4.f, this._b = e4._b, this._c2 = e4._c2, this._f1 = e4._f1, this.caps = n2 | t3.LATITUDE | t3.AZIMUTH | t3.LONG_UNROLL, this.lat1 = s3.LatFix(i3), this.lon1 = r3, void 0 === o2 || void 0 === h2 ? (this.azi1 = s3.AngNormalize(a2), c2 = s3.sincosd(s3.AngRound(this.azi1)), this.salp1 = c2.s, this.calp1 = c2.c) : (this.azi1 = a2, this.salp1 = o2, this.calp1 = h2), c2 = s3.sincosd(s3.AngRound(this.lat1)), u2 = this._f1 * c2.s, l2 = c2.c, u2 /= c2 = s3.hypot(u2, l2), l2 /= c2, l2 = Math.max(t3.tiny_, l2), this._dn1 = Math.sqrt(1 + e4._ep2 * s3.sq(u2)), this._salp0 = this.salp1 * l2, this._calp0 = s3.hypot(this.calp1, this.salp1 * u2), this._ssig1 = u2, this._somg1 = this._salp0 * u2, this._csig1 = this._comg1 = 0 !== u2 || 0 !== this.calp1 ? l2 * this.calp1 : 1, c2 = s3.hypot(this._ssig1, this._csig1), this._ssig1 /= c2, this._csig1 /= c2, this._k2 = s3.sq(this._calp0) * e4._ep2, d2 = this._k2 / (2 * (1 + Math.sqrt(1 + this._k2)) + this._k2), this.caps & t3.CAP_C1 && (this._A1m1 = t3.A1m1f(d2), this._C1a = new Array(t3.nC1_ + 1), t3.C1f(d2, this._C1a), this._B11 = t3.SinCosSeries(true, this._ssig1, this._csig1, this._C1a), _2 = Math.sin(this._B11), m2 = Math.cos(this._B11), this._stau1 = this._ssig1 * m2 + this._csig1 * _2, this._ctau1 = this._csig1 * m2 - this._ssig1 * _2), this.caps & t3.CAP_C1p && (this._C1pa = new Array(t3.nC1p_ + 1), t3.C1pf(d2, this._C1pa)), this.caps & t3.CAP_C2 && (this._A2m1 = t3.A2m1f(d2), this._C2a = new Array(t3.nC2_ + 1), t3.C2f(d2, this._C2a), this._B21 = t3.SinCosSeries(true, this._ssig1, this._csig1, this._C2a)), this.caps & t3.CAP_C3 && (this._C3a = new Array(t3.nC3_), e4.C3f(d2, this._C3a), this._A3c = -this.f * this._salp0 * e4.A3f(d2), this._B31 = t3.SinCosSeries(true, this._ssig1, this._csig1, this._C3a)), this.caps & t3.CAP_C4 && (this._C4a = new Array(t3.nC4_), e4.C4f(d2, this._C4a), this._A4 = s3.sq(this.a) * this._calp0 * this._salp0 * e4._e2, this._B41 = t3.SinCosSeries(false, this._ssig1, this._csig1, this._C4a)), this.a13 = this.s13 = NaN;
|
|
6194
6220
|
}, e3.GeodesicLine.prototype.GenPosition = function(e4, i3, r3) {
|
|
6195
|
-
var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2,
|
|
6196
|
-
return r3 ? r3 === t3.LONG_UNROLL && (r3 |= t3.STANDARD) : r3 = t3.STANDARD, r3 &= this.caps & t3.OUT_MASK, z2.lat1 = this.lat1, z2.azi1 = this.azi1, z2.lon1 = r3 & t3.LONG_UNROLL ? this.lon1 : s3.AngNormalize(this.lon1), e4 ? z2.a12 = i3 : z2.s12 = i3, e4 || this.caps & t3.DISTANCE_IN & t3.OUT_MASK ? (h2 = 0, c2 = 0, e4 ? (a2 = i3 * s3.degree, n2 = (
|
|
6221
|
+
var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, p2, f2, y2, g2, M2, x2, w2, S2, C2, E2, P2, b2, A3, v2, T2, I2, z2 = {};
|
|
6222
|
+
return r3 ? r3 === t3.LONG_UNROLL && (r3 |= t3.STANDARD) : r3 = t3.STANDARD, r3 &= this.caps & t3.OUT_MASK, z2.lat1 = this.lat1, z2.azi1 = this.azi1, z2.lon1 = r3 & t3.LONG_UNROLL ? this.lon1 : s3.AngNormalize(this.lon1), e4 ? z2.a12 = i3 : z2.s12 = i3, e4 || this.caps & t3.DISTANCE_IN & t3.OUT_MASK ? (h2 = 0, c2 = 0, e4 ? (a2 = i3 * s3.degree, n2 = (A3 = s3.sincosd(i3)).s, o2 = A3.c) : (d2 = i3 / (this._b * (1 + this._A1m1)), _2 = Math.sin(d2), m2 = Math.cos(d2), a2 = d2 - ((h2 = -t3.SinCosSeries(true, this._stau1 * m2 + this._ctau1 * _2, this._ctau1 * m2 - this._stau1 * _2, this._C1pa)) - this._B11), n2 = Math.sin(a2), o2 = Math.cos(a2), Math.abs(this.f) > 0.01 && (l2 = this._ssig1 * o2 + this._csig1 * n2, u2 = this._csig1 * o2 - this._ssig1 * n2, h2 = t3.SinCosSeries(true, l2, u2, this._C1a), a2 -= ((1 + this._A1m1) * (a2 + (h2 - this._B11)) - i3 / this._b) / Math.sqrt(1 + this._k2 * s3.sq(l2)), n2 = Math.sin(a2), o2 = Math.cos(a2))), l2 = this._ssig1 * o2 + this._csig1 * n2, u2 = this._csig1 * o2 - this._ssig1 * n2, C2 = Math.sqrt(1 + this._k2 * s3.sq(l2)), r3 & (t3.DISTANCE | t3.REDUCEDLENGTH | t3.GEODESICSCALE) && ((e4 || Math.abs(this.f) > 0.01) && (h2 = t3.SinCosSeries(true, l2, u2, this._C1a)), c2 = (1 + this._A1m1) * (h2 - this._B11)), y2 = this._calp0 * l2, 0 === (g2 = s3.hypot(this._salp0, this._calp0 * u2)) && (g2 = u2 = t3.tiny_), w2 = this._salp0, S2 = this._calp0 * u2, e4 && r3 & t3.DISTANCE && (z2.s12 = this._b * ((1 + this._A1m1) * a2 + c2)), r3 & t3.LONGITUDE && (M2 = this._salp0 * l2, x2 = u2, f2 = s3.copysign(1, this._salp0), p2 = ((r3 & t3.LONG_UNROLL ? f2 * (a2 - (Math.atan2(l2, u2) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(f2 * M2, x2) - Math.atan2(f2 * this._somg1, this._comg1))) : Math.atan2(M2 * this._comg1 - x2 * this._somg1, x2 * this._comg1 + M2 * this._somg1)) + this._A3c * (a2 + (t3.SinCosSeries(true, l2, u2, this._C3a) - this._B31))) / s3.degree, z2.lon2 = r3 & t3.LONG_UNROLL ? this.lon1 + p2 : s3.AngNormalize(s3.AngNormalize(this.lon1) + s3.AngNormalize(p2))), r3 & t3.LATITUDE && (z2.lat2 = s3.atan2d(y2, this._f1 * g2)), r3 & t3.AZIMUTH && (z2.azi2 = s3.atan2d(w2, S2)), r3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (E2 = t3.SinCosSeries(true, l2, u2, this._C2a), P2 = (1 + this._A2m1) * (E2 - this._B21), b2 = (this._A1m1 - this._A2m1) * a2 + (c2 - P2), r3 & t3.REDUCEDLENGTH && (z2.m12 = this._b * (C2 * (this._csig1 * l2) - this._dn1 * (this._ssig1 * u2) - this._csig1 * u2 * b2)), r3 & t3.GEODESICSCALE && (A3 = this._k2 * (l2 - this._ssig1) * (l2 + this._ssig1) / (this._dn1 + C2), z2.M12 = o2 + (A3 * l2 - u2 * b2) * this._ssig1 / this._dn1, z2.M21 = o2 - (A3 * this._ssig1 - this._csig1 * b2) * l2 / C2)), r3 & t3.AREA && (v2 = t3.SinCosSeries(false, l2, u2, this._C4a), 0 === this._calp0 || 0 === this._salp0 ? (T2 = w2 * this.calp1 - S2 * this.salp1, I2 = S2 * this.calp1 + w2 * this.salp1) : (T2 = this._calp0 * this._salp0 * (o2 <= 0 ? this._csig1 * (1 - o2) + n2 * this._ssig1 : n2 * (this._csig1 * n2 / (1 + o2) + this._ssig1)), I2 = s3.sq(this._salp0) + s3.sq(this._calp0) * this._csig1 * u2), z2.S12 = this._c2 * Math.atan2(T2, I2) + this._A4 * (v2 - this._B41)), e4 || (z2.a12 = a2 / s3.degree), z2) : (z2.a12 = NaN, z2);
|
|
6197
6223
|
}, e3.GeodesicLine.prototype.Position = function(t4, e4) {
|
|
6198
6224
|
return this.GenPosition(false, t4, e4);
|
|
6199
6225
|
}, e3.GeodesicLine.prototype.ArcPosition = function(t4, e4) {
|
|
@@ -6250,17 +6276,17 @@ proj4Src.exports = function() {
|
|
|
6250
6276
|
this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.g = new zr.Geodesic.Geodesic(this.a, this.es / (1 + Math.sqrt(1 - this.es)));
|
|
6251
6277
|
}
|
|
6252
6278
|
function Nr(t2) {
|
|
6253
|
-
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2,
|
|
6254
|
-
return this.sphere ? Math.abs(this.sin_p12 - 1) <= m ? (t2.x = this.x0 + this.a * (l - x2) * Math.sin(C2), t2.y = this.y0 - this.a * (l - x2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (t2.x = this.x0 + this.a * (l + x2) * Math.sin(C2), t2.y = this.y0 + this.a * (l + x2) * Math.cos(C2), t2) : (c2 = this.sin_p12 * w2 + this.cos_p12 * S2 * Math.cos(C2), h2 = (o2 = Math.acos(c2)) ? o2 / Math.sin(o2) : 1, t2.x = this.x0 + this.a * h2 * S2 * Math.sin(C2), t2.y = this.y0 + this.a * h2 * (this.cos_p12 * w2 - this.sin_p12 * S2 * Math.cos(C2)), t2) : (e2 = ci(this.es), s2 = li(this.es), i2 = ui(this.es), r2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 - n2) * Math.sin(C2), t2.y = this.y0 - (a2 - n2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 + n2) * Math.sin(C2), t2.y = this.y0 + (a2 + n2) * Math.cos(C2), t2) : Math.abs(M2) < m && Math.abs(x2 - this.lat0) < m ? (t2.x = t2.y = 0, t2) : (u2 = this.lat0 /
|
|
6279
|
+
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, f2, y2, g2, M2 = t2.x, x2 = t2.y, w2 = Math.sin(t2.y), S2 = Math.cos(t2.y), C2 = ft(M2 - this.long0);
|
|
6280
|
+
return this.sphere ? Math.abs(this.sin_p12 - 1) <= m ? (t2.x = this.x0 + this.a * (l - x2) * Math.sin(C2), t2.y = this.y0 - this.a * (l - x2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (t2.x = this.x0 + this.a * (l + x2) * Math.sin(C2), t2.y = this.y0 + this.a * (l + x2) * Math.cos(C2), t2) : (c2 = this.sin_p12 * w2 + this.cos_p12 * S2 * Math.cos(C2), h2 = (o2 = Math.acos(c2)) ? o2 / Math.sin(o2) : 1, t2.x = this.x0 + this.a * h2 * S2 * Math.sin(C2), t2.y = this.y0 + this.a * h2 * (this.cos_p12 * w2 - this.sin_p12 * S2 * Math.cos(C2)), t2) : (e2 = ci(this.es), s2 = li(this.es), i2 = ui(this.es), r2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 - n2) * Math.sin(C2), t2.y = this.y0 - (a2 - n2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 + n2) * Math.sin(C2), t2.y = this.y0 + (a2 + n2) * Math.cos(C2), t2) : Math.abs(M2) < m && Math.abs(x2 - this.lat0) < m ? (t2.x = t2.y = 0, t2) : (u2 = this.lat0 / p, d2 = this.long0 / p, _2 = x2 / p, f2 = M2 / p, g2 = (y2 = this.g.Inverse(u2, d2, _2, f2, this.g.AZIMUTH)).azi1 * p, t2.x = y2.s12 * Math.sin(g2), t2.y = y2.s12 * Math.cos(g2), t2));
|
|
6255
6281
|
}
|
|
6256
6282
|
function Gr(t2) {
|
|
6257
|
-
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2,
|
|
6283
|
+
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, f2, y2, g2, M2, x2;
|
|
6258
6284
|
if (t2.x -= this.x0, t2.y -= this.y0, this.sphere) {
|
|
6259
6285
|
if ((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) > 2 * l * this.a)
|
|
6260
6286
|
return;
|
|
6261
|
-
return s2 = e2 / this.a, i2 = Math.sin(s2), r2 = Math.cos(s2), a2 = this.long0, Math.abs(e2) <= m ? n2 = this.lat0 : (n2 = Ni(r2 * this.sin_p12 + t2.y * i2 * this.cos_p12 / e2), o2 = Math.abs(this.lat0) - l, a2 = Math.abs(o2) <= m ? this.lat0 >= 0 ?
|
|
6287
|
+
return s2 = e2 / this.a, i2 = Math.sin(s2), r2 = Math.cos(s2), a2 = this.long0, Math.abs(e2) <= m ? n2 = this.lat0 : (n2 = Ni(r2 * this.sin_p12 + t2.y * i2 * this.cos_p12 / e2), o2 = Math.abs(this.lat0) - l, a2 = Math.abs(o2) <= m ? this.lat0 >= 0 ? ft(this.long0 + Math.atan2(t2.x, -t2.y)) : ft(this.long0 - Math.atan2(-t2.x, t2.y)) : ft(this.long0 + Math.atan2(t2.x * i2, e2 * this.cos_p12 * r2 - t2.y * this.sin_p12 * i2))), t2.x = a2, t2.y = n2, t2;
|
|
6262
6288
|
}
|
|
6263
|
-
return h2 = ci(this.es), c2 = li(this.es), u2 = ui(this.es), d2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (n2 =
|
|
6289
|
+
return h2 = ci(this.es), c2 = li(this.es), u2 = ui(this.es), d2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (n2 = pi(((_2 = this.a * hi(h2, c2, u2, d2, l)) - (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y))) / this.a, h2, c2, u2, d2), a2 = ft(this.long0 + Math.atan2(t2.x, -1 * t2.y)), t2.x = a2, t2.y = n2, t2) : Math.abs(this.sin_p12 + 1) <= m ? (_2 = this.a * hi(h2, c2, u2, d2, l), n2 = pi(((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) - _2) / this.a, h2, c2, u2, d2), a2 = ft(this.long0 + Math.atan2(t2.x, t2.y)), t2.x = a2, t2.y = n2, t2) : (f2 = this.lat0 / p, y2 = this.long0 / p, g2 = Math.atan2(t2.x, t2.y) / p, M2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), x2 = this.g.Direct(f2, y2, g2, M2, this.g.STANDARD), t2.x = x2.lon2 * p, t2.y = x2.lat2 * p, t2);
|
|
6264
6290
|
}
|
|
6265
6291
|
var Rr = { init: Or, forward: Nr, inverse: Gr, names: ["Azimuthal_Equidistant", "aeqd"] };
|
|
6266
6292
|
function Lr() {
|
|
@@ -6268,11 +6294,11 @@ proj4Src.exports = function() {
|
|
|
6268
6294
|
}
|
|
6269
6295
|
function $r(t2) {
|
|
6270
6296
|
var e2, s2, i2, r2, a2, n2, o2, h2, c2 = t2.x, l2 = t2.y;
|
|
6271
|
-
return i2 =
|
|
6297
|
+
return i2 = ft(c2 - this.long0), e2 = Math.sin(l2), s2 = Math.cos(l2), r2 = Math.cos(i2), a2 = 1, ((n2 = this.sin_p14 * e2 + this.cos_p14 * s2 * r2) > 0 || Math.abs(n2) <= m) && (o2 = this.a * a2 * s2 * Math.sin(i2), h2 = this.y0 + this.a * a2 * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2)), t2.x = o2, t2.y = h2, t2;
|
|
6272
6298
|
}
|
|
6273
6299
|
function Vr(t2) {
|
|
6274
6300
|
var e2, s2, i2, r2, a2, n2, o2;
|
|
6275
|
-
return t2.x -= this.x0, t2.y -= this.y0, s2 = Ni((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) / this.a), i2 = Math.sin(s2), r2 = Math.cos(s2), n2 = this.long0, Math.abs(e2) <= m ? (o2 = this.lat0, t2.x = n2, t2.y = o2, t2) : (o2 = Ni(r2 * this.sin_p14 + t2.y * i2 * this.cos_p14 / e2), a2 = Math.abs(this.lat0) - l, Math.abs(a2) <= m ? (n2 = this.lat0 >= 0 ?
|
|
6301
|
+
return t2.x -= this.x0, t2.y -= this.y0, s2 = Ni((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) / this.a), i2 = Math.sin(s2), r2 = Math.cos(s2), n2 = this.long0, Math.abs(e2) <= m ? (o2 = this.lat0, t2.x = n2, t2.y = o2, t2) : (o2 = Ni(r2 * this.sin_p14 + t2.y * i2 * this.cos_p14 / e2), a2 = Math.abs(this.lat0) - l, Math.abs(a2) <= m ? (n2 = this.lat0 >= 0 ? ft(this.long0 + Math.atan2(t2.x, -t2.y)) : ft(this.long0 - Math.atan2(-t2.x, t2.y)), t2.x = n2, t2.y = o2, t2) : (n2 = ft(this.long0 + Math.atan2(t2.x * i2, e2 * this.cos_p14 * r2 - t2.y * this.sin_p14 * i2)), t2.x = n2, t2.y = o2, t2));
|
|
6276
6302
|
}
|
|
6277
6303
|
var qr = { init: Lr, forward: $r, inverse: Vr, names: ["ortho"] }, jr = { FRONT: 1, RIGHT: 2, BACK: 3, LEFT: 4, TOP: 5, BOTTOM: 6 }, Dr = { AREA_0: 1, AREA_1: 2, AREA_2: 3, AREA_3: 4 };
|
|
6278
6304
|
function Br() {
|
|
@@ -6285,20 +6311,20 @@ proj4Src.exports = function() {
|
|
|
6285
6311
|
else if (this.face === jr.BOTTOM)
|
|
6286
6312
|
r2 = l + e2, s2 >= y && s2 <= l + y ? (h2.value = Dr.AREA_0, i2 = -s2 + l) : s2 < y && s2 >= -y ? (h2.value = Dr.AREA_1, i2 = -s2) : s2 < -y && s2 >= -(l + y) ? (h2.value = Dr.AREA_2, i2 = -s2 - l) : (h2.value = Dr.AREA_3, i2 = s2 > 0 ? -s2 + M : -s2 - M);
|
|
6287
6313
|
else {
|
|
6288
|
-
var c2, u2, d2, _2, m2,
|
|
6289
|
-
this.face === jr.RIGHT ? s2 = Wr(s2, +l) : this.face === jr.BACK ? s2 = Wr(s2, 3.14159265359) : this.face === jr.LEFT && (s2 = Wr(s2, -l)), _2 = Math.sin(e2), m2 = Math.cos(e2),
|
|
6314
|
+
var c2, u2, d2, _2, m2, p2;
|
|
6315
|
+
this.face === jr.RIGHT ? s2 = Wr(s2, +l) : this.face === jr.BACK ? s2 = Wr(s2, 3.14159265359) : this.face === jr.LEFT && (s2 = Wr(s2, -l)), _2 = Math.sin(e2), m2 = Math.cos(e2), p2 = Math.sin(s2), c2 = m2 * Math.cos(s2), u2 = m2 * p2, d2 = _2, this.face === jr.FRONT ? i2 = Ur(r2 = Math.acos(c2), d2, u2, h2) : this.face === jr.RIGHT ? i2 = Ur(r2 = Math.acos(u2), d2, -c2, h2) : this.face === jr.BACK ? i2 = Ur(r2 = Math.acos(-c2), d2, -u2, h2) : this.face === jr.LEFT ? i2 = Ur(r2 = Math.acos(-u2), d2, c2, h2) : (r2 = i2 = 0, h2.value = Dr.AREA_0);
|
|
6290
6316
|
}
|
|
6291
6317
|
return n2 = Math.atan(12 / M * (i2 + Math.acos(Math.sin(i2) * Math.cos(y)) - l)), a2 = Math.sqrt((1 - Math.cos(r2)) / (Math.cos(n2) * Math.cos(n2)) / (1 - Math.cos(Math.atan(1 / Math.cos(i2))))), h2.value === Dr.AREA_1 ? n2 += l : h2.value === Dr.AREA_2 ? n2 += M : h2.value === Dr.AREA_3 && (n2 += 1.5 * M), o2.x = a2 * Math.cos(n2), o2.y = a2 * Math.sin(n2), o2.x = o2.x * this.a + this.x0, o2.y = o2.y * this.a + this.y0, t2.x = o2.x, t2.y = o2.y, t2;
|
|
6292
6318
|
}
|
|
6293
6319
|
function Fr(t2) {
|
|
6294
|
-
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, m2 = { lam: 0, phi: 0 },
|
|
6295
|
-
if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, s2 = Math.atan(Math.sqrt(t2.x * t2.x + t2.y * t2.y)), e2 = Math.atan2(t2.y, t2.x), t2.x >= 0 && t2.x >= Math.abs(t2.y) ?
|
|
6296
|
-
h2 = Math.acos(o2), m2.phi = l - h2,
|
|
6320
|
+
var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, m2 = { lam: 0, phi: 0 }, p2 = { value: 0 };
|
|
6321
|
+
if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, s2 = Math.atan(Math.sqrt(t2.x * t2.x + t2.y * t2.y)), e2 = Math.atan2(t2.y, t2.x), t2.x >= 0 && t2.x >= Math.abs(t2.y) ? p2.value = Dr.AREA_0 : t2.y >= 0 && t2.y >= Math.abs(t2.x) ? (p2.value = Dr.AREA_1, e2 -= l) : t2.x < 0 && -t2.x >= Math.abs(t2.y) ? (p2.value = Dr.AREA_2, e2 = e2 < 0 ? e2 + M : e2 - M) : (p2.value = Dr.AREA_3, e2 += l), c2 = M / 12 * Math.tan(e2), a2 = Math.sin(c2) / (Math.cos(c2) - 1 / Math.sqrt(2)), n2 = Math.atan(a2), (o2 = 1 - (i2 = Math.cos(e2)) * i2 * (r2 = Math.tan(s2)) * r2 * (1 - Math.cos(Math.atan(1 / Math.cos(n2))))) < -1 ? o2 = -1 : o2 > 1 && (o2 = 1), this.face === jr.TOP)
|
|
6322
|
+
h2 = Math.acos(o2), m2.phi = l - h2, p2.value === Dr.AREA_0 ? m2.lam = n2 + l : p2.value === Dr.AREA_1 ? m2.lam = n2 < 0 ? n2 + M : n2 - M : p2.value === Dr.AREA_2 ? m2.lam = n2 - l : m2.lam = n2;
|
|
6297
6323
|
else if (this.face === jr.BOTTOM)
|
|
6298
|
-
h2 = Math.acos(o2), m2.phi = h2 - l,
|
|
6324
|
+
h2 = Math.acos(o2), m2.phi = h2 - l, p2.value === Dr.AREA_0 ? m2.lam = -n2 + l : p2.value === Dr.AREA_1 ? m2.lam = -n2 : p2.value === Dr.AREA_2 ? m2.lam = -n2 - l : m2.lam = n2 < 0 ? -n2 - M : -n2 + M;
|
|
6299
6325
|
else {
|
|
6300
|
-
var
|
|
6301
|
-
c2 = (
|
|
6326
|
+
var f2, y2, g2;
|
|
6327
|
+
c2 = (f2 = o2) * f2, y2 = (c2 += (g2 = c2 >= 1 ? 0 : Math.sqrt(1 - c2) * Math.sin(n2)) * g2) >= 1 ? 0 : Math.sqrt(1 - c2), p2.value === Dr.AREA_1 ? (c2 = y2, y2 = -g2, g2 = c2) : p2.value === Dr.AREA_2 ? (y2 = -y2, g2 = -g2) : p2.value === Dr.AREA_3 && (c2 = y2, y2 = g2, g2 = -c2), this.face === jr.RIGHT ? (c2 = f2, f2 = -y2, y2 = c2) : this.face === jr.BACK ? (f2 = -f2, y2 = -y2) : this.face === jr.LEFT && (c2 = f2, f2 = y2, y2 = -c2), m2.phi = Math.acos(-g2) - l, m2.lam = Math.atan2(y2, f2), this.face === jr.RIGHT ? m2.lam = Wr(m2.lam, -l) : this.face === jr.BACK ? m2.lam = Wr(m2.lam, -3.14159265359) : this.face === jr.LEFT && (m2.lam = Wr(m2.lam, +l));
|
|
6302
6328
|
}
|
|
6303
6329
|
return 0 !== this.es && (u2 = m2.phi < 0 ? 1 : 0, d2 = Math.tan(m2.phi), _2 = this.b / Math.sqrt(d2 * d2 + this.one_minus_f_squared), m2.phi = Math.atan(Math.sqrt(this.a * this.a - _2 * _2) / (this.one_minus_f * _2)), u2 && (m2.phi = -m2.phi)), m2.lam += this.long0, t2.x = m2.lam, t2.y = m2.phi, t2;
|
|
6304
6330
|
}
|
|
@@ -6310,7 +6336,7 @@ proj4Src.exports = function() {
|
|
|
6310
6336
|
var s2 = t2 + e2;
|
|
6311
6337
|
return s2 < -3.14159265359 ? s2 += g : s2 > 3.14159265359 && (s2 -= g), s2;
|
|
6312
6338
|
}
|
|
6313
|
-
var Yr = { init: Br, forward: kr, inverse: Fr, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Qr = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Xr = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Hr = 0.8487, Zr = 1.3523, Kr =
|
|
6339
|
+
var Yr = { init: Br, forward: kr, inverse: Fr, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Qr = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Xr = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Hr = 0.8487, Zr = 1.3523, Kr = f / 5, Jr = 1 / Kr, ta = 18, ea = function(t2, e2) {
|
|
6314
6340
|
return t2[0] + e2 * (t2[1] + e2 * (t2[2] + e2 * t2[3]));
|
|
6315
6341
|
}, sa = function(t2, e2) {
|
|
6316
6342
|
return t2[1] + e2 * (2 * t2[2] + 3 * e2 * t2[3]);
|
|
@@ -6327,8 +6353,8 @@ proj4Src.exports = function() {
|
|
|
6327
6353
|
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.es = 0, this.title = this.title || "Robinson";
|
|
6328
6354
|
}
|
|
6329
6355
|
function aa(t2) {
|
|
6330
|
-
var e2 =
|
|
6331
|
-
i2 < 0 ? i2 = 0 : i2 >= ta && (i2 = ta - 1), s2 =
|
|
6356
|
+
var e2 = ft(t2.x - this.long0), s2 = Math.abs(t2.y), i2 = Math.floor(s2 * Kr);
|
|
6357
|
+
i2 < 0 ? i2 = 0 : i2 >= ta && (i2 = ta - 1), s2 = f * (s2 - Jr * i2);
|
|
6332
6358
|
var r2 = { x: ea(Qr[i2], s2) * e2, y: ea(Xr[i2], s2) };
|
|
6333
6359
|
return t2.y < 0 && (r2.y = -r2.y), r2.x = r2.x * this.a * Hr + this.x0, r2.y = r2.y * this.a * Zr + this.y0, r2;
|
|
6334
6360
|
}
|
|
@@ -6349,9 +6375,9 @@ proj4Src.exports = function() {
|
|
|
6349
6375
|
var i2 = Xr[s2], r2 = 5 * (e2.y - i2[0]) / (Xr[s2 + 1][0] - i2[0]);
|
|
6350
6376
|
r2 = ia(function(t3) {
|
|
6351
6377
|
return (ea(i2, t3) - e2.y) / sa(i2, t3);
|
|
6352
|
-
}, r2, m, 100), e2.x /= ea(Qr[s2], r2), e2.y = (5 * s2 + r2) *
|
|
6378
|
+
}, r2, m, 100), e2.x /= ea(Qr[s2], r2), e2.y = (5 * s2 + r2) * p, t2.y < 0 && (e2.y = -e2.y);
|
|
6353
6379
|
}
|
|
6354
|
-
return e2.x =
|
|
6380
|
+
return e2.x = ft(e2.x + this.long0), e2;
|
|
6355
6381
|
}
|
|
6356
6382
|
var oa = { init: ra, forward: aa, inverse: na, names: ["Robinson", "robin"] };
|
|
6357
6383
|
function ha() {
|
|
@@ -6373,14 +6399,14 @@ proj4Src.exports = function() {
|
|
|
6373
6399
|
throw new Error("Invalid parameter value, must be numeric " + t3 + " = " + this[t3]);
|
|
6374
6400
|
_a[t3].num && (this[t3] = parseFloat(this[t3]));
|
|
6375
6401
|
}
|
|
6376
|
-
_a[t3].degrees && (this[t3] = this[t3] *
|
|
6402
|
+
_a[t3].degrees && (this[t3] = this[t3] * p);
|
|
6377
6403
|
}.bind(this)), Math.abs(Math.abs(this.lat0) - l) < m ? this.mode = this.lat0 < 0 ? da.S_POLE : da.N_POLE : Math.abs(this.lat0) < m ? this.mode = da.EQUIT : (this.mode = da.OBLIQ, this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0)), this.pn1 = this.h / this.a, this.pn1 <= 0 || this.pn1 > 1e10)
|
|
6378
6404
|
throw new Error("Invalid height");
|
|
6379
6405
|
this.p = 1 + this.pn1, this.rp = 1 / this.p, this.h1 = 1 / this.pn1, this.pfact = (this.p + 1) * this.h1, this.es = 0;
|
|
6380
6406
|
var t2 = this.tilt, e2 = this.azi;
|
|
6381
6407
|
this.cg = Math.cos(e2), this.sg = Math.sin(e2), this.cw = Math.cos(t2), this.sw = Math.sin(t2);
|
|
6382
6408
|
}
|
|
6383
|
-
function
|
|
6409
|
+
function pa(t2) {
|
|
6384
6410
|
t2.x -= this.long0;
|
|
6385
6411
|
var e2, s2, i2, r2, a2 = Math.sin(t2.y), n2 = Math.cos(t2.y), o2 = Math.cos(t2.x);
|
|
6386
6412
|
switch (this.mode) {
|
|
@@ -6411,11 +6437,11 @@ proj4Src.exports = function() {
|
|
|
6411
6437
|
}
|
|
6412
6438
|
return r2 = 1 / ((i2 = s2 * this.cg + e2 * this.sg) * this.sw * this.h1 + this.cw), e2 = (e2 * this.cg - s2 * this.sg) * this.cw * r2, s2 = i2 * r2, t2.x = e2 * this.a, t2.y = s2 * this.a, t2;
|
|
6413
6439
|
}
|
|
6414
|
-
function
|
|
6440
|
+
function fa(t2) {
|
|
6415
6441
|
t2.x /= this.a, t2.y /= this.a;
|
|
6416
6442
|
var e2, s2, i2, r2 = { x: t2.x, y: t2.y };
|
|
6417
6443
|
i2 = 1 / (this.pn1 - t2.y * this.sw), e2 = this.pn1 * t2.x * i2, s2 = this.pn1 * t2.y * this.cw * i2, t2.x = e2 * this.cg + s2 * this.sg, t2.y = s2 * this.cg - e2 * this.sg;
|
|
6418
|
-
var a2 =
|
|
6444
|
+
var a2 = ps(t2.x, t2.y);
|
|
6419
6445
|
if (Math.abs(a2) < m)
|
|
6420
6446
|
r2.x = 0, r2.y = t2.y;
|
|
6421
6447
|
else {
|
|
@@ -6437,7 +6463,7 @@ proj4Src.exports = function() {
|
|
|
6437
6463
|
}
|
|
6438
6464
|
return t2.x = r2.x + this.long0, t2.y = r2.y, t2;
|
|
6439
6465
|
}
|
|
6440
|
-
var ya = { init: ma, forward:
|
|
6466
|
+
var ya = { init: ma, forward: pa, inverse: fa, names: ["Tilted_Perspective", "tpers"] };
|
|
6441
6467
|
function ga() {
|
|
6442
6468
|
if (this.flip_axis = "x" === this.sweep ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
|
|
6443
6469
|
throw new Error();
|
|
@@ -6452,18 +6478,18 @@ proj4Src.exports = function() {
|
|
|
6452
6478
|
var e2, s2, i2, r2, a2 = t2.x, n2 = t2.y;
|
|
6453
6479
|
if (a2 -= this.long0, "ellipse" === this.shape) {
|
|
6454
6480
|
n2 = Math.atan(this.radius_p2 * Math.tan(n2));
|
|
6455
|
-
var o2 = this.radius_p /
|
|
6481
|
+
var o2 = this.radius_p / ps(this.radius_p * Math.cos(n2), Math.sin(n2));
|
|
6456
6482
|
if (s2 = o2 * Math.cos(a2) * Math.cos(n2), i2 = o2 * Math.sin(a2) * Math.cos(n2), r2 = o2 * Math.sin(n2), (this.radius_g - s2) * s2 - i2 * i2 - r2 * r2 * this.radius_p_inv2 < 0)
|
|
6457
6483
|
return t2.x = Number.NaN, t2.y = Number.NaN, t2;
|
|
6458
|
-
e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 /
|
|
6484
|
+
e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 / ps(r2, e2)), t2.y = this.radius_g_1 * Math.atan(r2 / e2)) : (t2.x = this.radius_g_1 * Math.atan(i2 / e2), t2.y = this.radius_g_1 * Math.atan(r2 / ps(i2, e2)));
|
|
6459
6485
|
} else
|
|
6460
|
-
"sphere" === this.shape && (e2 = Math.cos(n2), s2 = Math.cos(a2) * e2, i2 = Math.sin(a2) * e2, r2 = Math.sin(n2), e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 /
|
|
6486
|
+
"sphere" === this.shape && (e2 = Math.cos(n2), s2 = Math.cos(a2) * e2, i2 = Math.sin(a2) * e2, r2 = Math.sin(n2), e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 / ps(r2, e2)), t2.y = this.radius_g_1 * Math.atan(r2 / e2)) : (t2.x = this.radius_g_1 * Math.atan(i2 / e2), t2.y = this.radius_g_1 * Math.atan(r2 / ps(i2, e2))));
|
|
6461
6487
|
return t2.x = t2.x * this.a, t2.y = t2.y * this.a, t2;
|
|
6462
6488
|
}
|
|
6463
6489
|
function xa(t2) {
|
|
6464
6490
|
var e2, s2, i2, r2, a2 = -1, n2 = 0, o2 = 0;
|
|
6465
6491
|
if (t2.x = t2.x / this.a, t2.y = t2.y / this.a, "ellipse" === this.shape) {
|
|
6466
|
-
this.flip_axis ? (o2 = Math.tan(t2.y / this.radius_g_1), n2 = Math.tan(t2.x / this.radius_g_1) *
|
|
6492
|
+
this.flip_axis ? (o2 = Math.tan(t2.y / this.radius_g_1), n2 = Math.tan(t2.x / this.radius_g_1) * ps(1, o2)) : (n2 = Math.tan(t2.x / this.radius_g_1), o2 = Math.tan(t2.y / this.radius_g_1) * ps(1, n2));
|
|
6467
6493
|
var h2 = o2 / this.radius_p;
|
|
6468
6494
|
if (e2 = n2 * n2 + h2 * h2 + a2 * a2, (i2 = (s2 = 2 * this.radius_g * a2) * s2 - 4 * e2 * this.C) < 0)
|
|
6469
6495
|
return t2.x = Number.NaN, t2.y = Number.NaN, t2;
|
|
@@ -6476,11 +6502,11 @@ proj4Src.exports = function() {
|
|
|
6476
6502
|
return t2.x = t2.x + this.long0, t2;
|
|
6477
6503
|
}
|
|
6478
6504
|
var wa = { init: ga, forward: Ma, inverse: xa, names: ["Geostationary Satellite View", "Geostationary_Satellite", "geos"] }, Sa = 1.340264, Ca = -0.081106, Ea = 893e-6, Pa = 3796e-6, ba = Math.sqrt(3) / 2;
|
|
6479
|
-
function
|
|
6505
|
+
function Aa() {
|
|
6480
6506
|
this.es = 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0;
|
|
6481
6507
|
}
|
|
6482
|
-
function
|
|
6483
|
-
var e2 =
|
|
6508
|
+
function va(t2) {
|
|
6509
|
+
var e2 = ft(t2.x - this.long0), s2 = t2.y, i2 = Math.asin(ba * Math.sin(s2)), r2 = i2 * i2, a2 = r2 * r2 * r2;
|
|
6484
6510
|
return t2.x = e2 * Math.cos(i2) / (ba * (Sa + 3 * Ca * r2 + a2 * (7 * Ea + 9 * Pa * r2))), t2.y = i2 * (Sa + Ca * r2 + a2 * (Ea + Pa * r2)), t2.x = this.a * t2.x + this.x0, t2.y = this.a * t2.y + this.y0, t2;
|
|
6485
6511
|
}
|
|
6486
6512
|
function Ta(t2) {
|
|
@@ -6488,9 +6514,9 @@ proj4Src.exports = function() {
|
|
|
6488
6514
|
var e2, s2, i2, r2, a2 = 1e-9, n2 = 12, o2 = t2.y;
|
|
6489
6515
|
for (r2 = 0; r2 < n2 && (o2 -= i2 = (o2 * (Sa + Ca * (e2 = o2 * o2) + (s2 = e2 * e2 * e2) * (Ea + Pa * e2)) - t2.y) / (Sa + 3 * Ca * e2 + s2 * (7 * Ea + 9 * Pa * e2)), !(Math.abs(i2) < a2)); ++r2)
|
|
6490
6516
|
;
|
|
6491
|
-
return s2 = (e2 = o2 * o2) * e2 * e2, t2.x = ba * t2.x * (Sa + 3 * Ca * e2 + s2 * (7 * Ea + 9 * Pa * e2)) / Math.cos(o2), t2.y = Math.asin(Math.sin(o2) / ba), t2.x =
|
|
6517
|
+
return s2 = (e2 = o2 * o2) * e2 * e2, t2.x = ba * t2.x * (Sa + 3 * Ca * e2 + s2 * (7 * Ea + 9 * Pa * e2)) / Math.cos(o2), t2.y = Math.asin(Math.sin(o2) / ba), t2.x = ft(t2.x + this.long0), t2;
|
|
6492
6518
|
}
|
|
6493
|
-
var Ia = { init:
|
|
6519
|
+
var Ia = { init: Aa, forward: va, inverse: Ta, names: ["eqearth", "Equal Earth", "Equal_Earth"] }, za = 1e-10;
|
|
6494
6520
|
function Oa() {
|
|
6495
6521
|
var t2;
|
|
6496
6522
|
if (this.phi1 = this.lat1, Math.abs(this.phi1) < za)
|
|
@@ -6498,35 +6524,35 @@ proj4Src.exports = function() {
|
|
|
6498
6524
|
this.es ? (this.en = ns(this.es), this.m1 = os(this.phi1, this.am1 = Math.sin(this.phi1), t2 = Math.cos(this.phi1), this.en), this.am1 = t2 / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = Ga, this.forward = Na) : (Math.abs(this.phi1) + za >= l ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = La, this.forward = Ra);
|
|
6499
6525
|
}
|
|
6500
6526
|
function Na(t2) {
|
|
6501
|
-
var e2, s2, i2, r2 =
|
|
6527
|
+
var e2, s2, i2, r2 = ft(t2.x - (this.long0 || 0)), a2 = t2.y;
|
|
6502
6528
|
return e2 = this.am1 + this.m1 - os(a2, s2 = Math.sin(a2), i2 = Math.cos(a2), this.en), s2 = i2 * r2 / (e2 * Math.sqrt(1 - this.es * s2 * s2)), t2.x = e2 * Math.sin(s2), t2.y = this.am1 - e2 * Math.cos(s2), t2.x = this.a * t2.x + (this.x0 || 0), t2.y = this.a * t2.y + (this.y0 || 0), t2;
|
|
6503
6529
|
}
|
|
6504
6530
|
function Ga(t2) {
|
|
6505
6531
|
var e2, s2, i2, r2;
|
|
6506
|
-
if (t2.x = (t2.x - (this.x0 || 0)) / this.a, t2.y = (t2.y - (this.y0 || 0)) / this.a, s2 =
|
|
6532
|
+
if (t2.x = (t2.x - (this.x0 || 0)) / this.a, t2.y = (t2.y - (this.y0 || 0)) / this.a, s2 = ps(t2.x, t2.y = this.am1 - t2.y), r2 = cs(this.am1 + this.m1 - s2, this.es, this.en), (e2 = Math.abs(r2)) < l)
|
|
6507
6533
|
e2 = Math.sin(r2), i2 = s2 * Math.atan2(t2.x, t2.y) * Math.sqrt(1 - this.es * e2 * e2) / Math.cos(r2);
|
|
6508
6534
|
else {
|
|
6509
6535
|
if (!(Math.abs(e2 - l) <= za))
|
|
6510
6536
|
throw new Error();
|
|
6511
6537
|
i2 = 0;
|
|
6512
6538
|
}
|
|
6513
|
-
return t2.x =
|
|
6539
|
+
return t2.x = ft(i2 + (this.long0 || 0)), t2.y = mi(r2), t2;
|
|
6514
6540
|
}
|
|
6515
6541
|
function Ra(t2) {
|
|
6516
|
-
var e2, s2, i2 =
|
|
6542
|
+
var e2, s2, i2 = ft(t2.x - (this.long0 || 0)), r2 = t2.y;
|
|
6517
6543
|
return s2 = this.cphi1 + this.phi1 - r2, Math.abs(s2) > za ? (t2.x = s2 * Math.sin(e2 = i2 * Math.cos(r2) / s2), t2.y = this.cphi1 - s2 * Math.cos(e2)) : t2.x = t2.y = 0, t2.x = this.a * t2.x + (this.x0 || 0), t2.y = this.a * t2.y + (this.y0 || 0), t2;
|
|
6518
6544
|
}
|
|
6519
6545
|
function La(t2) {
|
|
6520
6546
|
var e2, s2;
|
|
6521
6547
|
t2.x = (t2.x - (this.x0 || 0)) / this.a, t2.y = (t2.y - (this.y0 || 0)) / this.a;
|
|
6522
|
-
var i2 =
|
|
6548
|
+
var i2 = ps(t2.x, t2.y = this.cphi1 - t2.y);
|
|
6523
6549
|
if (s2 = this.cphi1 + this.phi1 - i2, Math.abs(s2) > l)
|
|
6524
6550
|
throw new Error();
|
|
6525
|
-
return e2 = Math.abs(Math.abs(s2) - l) <= za ? 0 : i2 * Math.atan2(t2.x, t2.y) / Math.cos(s2), t2.x =
|
|
6551
|
+
return e2 = Math.abs(Math.abs(s2) - l) <= za ? 0 : i2 * Math.atan2(t2.x, t2.y) / Math.cos(s2), t2.x = ft(e2 + (this.long0 || 0)), t2.y = mi(s2), t2;
|
|
6526
6552
|
}
|
|
6527
6553
|
var $a = { init: Oa, names: ["bonne", "Bonne (Werner lat_1=90)"] };
|
|
6528
6554
|
function Va(t2) {
|
|
6529
|
-
t2.Proj.projections.add(_s), t2.Proj.projections.add(Ps), t2.Proj.projections.add(
|
|
6555
|
+
t2.Proj.projections.add(_s), t2.Proj.projections.add(Ps), t2.Proj.projections.add(vs), t2.Proj.projections.add(Vs), t2.Proj.projections.add(ks), t2.Proj.projections.add(Ys), t2.Proj.projections.add(Js), t2.Proj.projections.add(ii), t2.Proj.projections.add(oi), t2.Proj.projections.add(Mi), t2.Proj.projections.add(Oi), t2.Proj.projections.add(Vi), t2.Proj.projections.add(Bi), t2.Proj.projections.add(Yi), t2.Proj.projections.add(Zi), t2.Proj.projections.add(sr), t2.Proj.projections.add(nr), t2.Proj.projections.add(lr), t2.Proj.projections.add(pr), t2.Proj.projections.add(Mr), t2.Proj.projections.add(Cr), t2.Proj.projections.add(vr), t2.Proj.projections.add(Rr), t2.Proj.projections.add(qr), t2.Proj.projections.add(Yr), t2.Proj.projections.add(oa), t2.Proj.projections.add(ua), t2.Proj.projections.add(ya), t2.Proj.projections.add(wa), t2.Proj.projections.add(Ia), t2.Proj.projections.add($a);
|
|
6530
6556
|
}
|
|
6531
6557
|
return we.defaultDatum = "WGS84", we.Proj = ee, we.WGS84 = new we.Proj("WGS84"), we.Point = Ye, we.toPoint = _e, we.defs = rt, we.nadgrid = Dt, we.transform = ye, we.mgrs = Ie, we.version = "2.17.0", Va(we), we;
|
|
6532
6558
|
}();
|
|
@@ -6607,25 +6633,45 @@ const normalizeProjectionName = (t) => "EPSG:900913" === (t = t.toUpperCase().tr
|
|
|
6607
6633
|
_cache[t] = e;
|
|
6608
6634
|
}
|
|
6609
6635
|
return _cache[t];
|
|
6610
|
-
},
|
|
6611
|
-
const { vertices:
|
|
6612
|
-
|
|
6613
|
-
|
|
6636
|
+
}, computeNormals = (t, e = 3, s = 0) => {
|
|
6637
|
+
const { vertices: i, indices: r } = t, a = i.length / e, n = new Array(3 * a).fill(0), o = new Array(a).fill(0);
|
|
6638
|
+
for (let t2 = 0; t2 < r.length; t2 += 3) {
|
|
6639
|
+
const a2 = r[t2], h = r[t2 + 1], c = r[t2 + 2], l = i[a2 * e + s], u = i[a2 * e + s + 1], d = i[a2 * e + s + 2], _ = i[h * e + s] - l, m = i[h * e + s + 1] - u, p = i[h * e + s + 2] - d, f = i[c * e + s] - l, y = i[c * e + s + 1] - u, g = i[c * e + s + 2] - d, M = m * g - p * y, x = p * f - _ * g, w = _ * y - m * f;
|
|
6640
|
+
n[3 * a2] += M, n[3 * a2 + 1] += x, n[3 * a2 + 2] += w, o[a2]++, n[3 * h] += M, n[3 * h + 1] += x, n[3 * h + 2] += w, o[h]++, n[3 * c] += M, n[3 * c + 1] += x, n[3 * c + 2] += w, o[c]++;
|
|
6641
|
+
}
|
|
6642
|
+
for (let t2 = 0; t2 < a; t2++) {
|
|
6643
|
+
const e2 = o[t2];
|
|
6644
|
+
if (e2 > 0) {
|
|
6645
|
+
let s2 = n[3 * t2] / e2, i2 = n[3 * t2 + 1] / e2, r2 = n[3 * t2 + 2] / e2;
|
|
6646
|
+
const a2 = Math.sqrt(s2 * s2 + i2 * i2 + r2 * r2);
|
|
6647
|
+
if (a2 > 0) {
|
|
6648
|
+
const t3 = 1 / a2;
|
|
6649
|
+
s2 *= t3, i2 *= t3, r2 *= t3;
|
|
6650
|
+
} else
|
|
6651
|
+
s2 = 0, i2 = 0, r2 = 1;
|
|
6652
|
+
n[3 * t2] = s2, n[3 * t2 + 1] = i2, n[3 * t2 + 2] = r2;
|
|
6653
|
+
}
|
|
6654
|
+
}
|
|
6655
|
+
t.normals = n;
|
|
6656
|
+
}, createGroundTileMesh = (t, e, s = true) => {
|
|
6657
|
+
const { vertices: i, uvs: r, indices: a } = subdivideVertices([-0.5, -0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0], [0, 2, 1, 0, 3, 2], [0, 0, 0, 1, 1, 1, 1, 0], t);
|
|
6658
|
+
projectVertices(i, t);
|
|
6659
|
+
const n = { vertices: i, uvs: r, indices: a };
|
|
6614
6660
|
if (e) {
|
|
6615
|
-
const t2 =
|
|
6661
|
+
const t2 = i.length / 3;
|
|
6616
6662
|
for (const s2 of Object.keys(e)) {
|
|
6617
|
-
const i2 = e[s2], r2 = Array.isArray(i2),
|
|
6663
|
+
const i2 = e[s2], r2 = Array.isArray(i2), a2 = r2 ? i2.length : 1, o = [];
|
|
6618
6664
|
if (r2)
|
|
6619
6665
|
for (let e2 = 0; e2 < t2; e2++)
|
|
6620
|
-
for (let t3 = 0; t3 <
|
|
6666
|
+
for (let t3 = 0; t3 < a2; t3++)
|
|
6621
6667
|
o.push(i2[t3]);
|
|
6622
6668
|
else
|
|
6623
6669
|
for (let e2 = 0; e2 < t2; e2++)
|
|
6624
6670
|
o.push(i2);
|
|
6625
|
-
|
|
6671
|
+
n[s2] = o;
|
|
6626
6672
|
}
|
|
6627
6673
|
}
|
|
6628
|
-
return
|
|
6674
|
+
return s && computeNormals(n), n;
|
|
6629
6675
|
}, _pointIn = new Vector3$1(), _pointOut = new Vector3$1(), _vector = new Vector3$1(), _normal = new Vector3$1(), _projectedStart = [0, 0, 0], _projectedEnd = [0, 0, 0], _center = [0, 0, 0];
|
|
6630
6676
|
function sRGBToLinear(t) {
|
|
6631
6677
|
return t < 0.04045 ? 0.0773993808 * t : Math.pow(0.9478672986 * t + 0.0521327014, 2.4);
|
|
@@ -6687,13 +6733,12 @@ function mergePrimitives(t) {
|
|
|
6687
6733
|
return t.polygon3ds && t.polygon3ds.length > 0 && (e.polygon3d = mergePolygons(t.polygon3ds)), t.building3ds && t.building3ds.length > 0 && (e.building3d = mergePolygons(t.building3ds, { isBuilding: true })), t.arrows && t.arrows.length > 0 && (e.arrow = mergePolygons(t.arrows, { isArrow: true })), t.pois && t.pois.length > 0 && (e.poi = t.pois), e;
|
|
6688
6734
|
}
|
|
6689
6735
|
function mergePolygons(t, e = {}) {
|
|
6690
|
-
t.sort((t2, e2) => t2.rank - e2.rank);
|
|
6691
6736
|
const s = [], i = [];
|
|
6692
|
-
let r = null, a = null, n = null, o = null, h = null, c = null, l = null, u = null, d = null, _ = null, m = null,
|
|
6737
|
+
let r = null, a = null, n = null, o = null, h = null, c = null, l = null, u = null, d = null, _ = null, m = null, p = null, f = 0, y = 0;
|
|
6693
6738
|
for (let g = 0; g < t.length; g++)
|
|
6694
|
-
if (r = t[g], a = r.vertices, n = r.normals, o = r.flatNormals, h = r.uvs, c = r.diffs, l = r.indices, u = r.colors, d = r.layerIndices, _ = r.widths,
|
|
6739
|
+
if (r = t[g], r.normals || computeNormals(r), a = r.vertices, n = r.normals, o = r.flatNormals, h = r.uvs, c = r.diffs, l = r.indices, u = r.colors, d = r.layerIndices, _ = r.widths, p = r.totalLengths, m = r.heightAndConcaves, l && l.length) {
|
|
6695
6740
|
for (let t2 = 0, i2 = a.length - 2; t2 < i2; t2 += 3)
|
|
6696
|
-
s.push(a[t2], a[t2 + 1], a[t2 + 2]), e.isArrow ? (
|
|
6741
|
+
s.push(a[t2], a[t2 + 1], a[t2 + 2]), e.isArrow ? (f = t2 / 3 * 2, s.push(o[t2], o[t2 + 1], o[t2 + 2]), s.push(h[f], h[f + 1]), s.push(c[t2], c[t2 + 1], c[t2 + 2])) : (s.push(n[t2], n[t2 + 1], n[t2 + 2]), e.isColor4 ? (f = t2 / 3 * 4, s.push(u[f], u[f + 1], u[f + 2], u[f + 3])) : s.push(u[t2], u[t2 + 1], u[t2 + 2])), e.isBuilding ? (f = t2 / 3 * 2, s.push(m[f], m[f + 1])) : s.push(d[t2 / 3]), e.isLine && (f = t2 / 3 * 2, s.push(_[t2 / 3]), e.isDashLine && s.push(h[f], h[f + 1]), e.isTextureLine && s.push(p[t2 / 3]));
|
|
6697
6742
|
for (let t2 = 0, e2 = l.length; t2 < e2; t2++)
|
|
6698
6743
|
i.push(l[t2] + y);
|
|
6699
6744
|
y += a.length / 3;
|
|
@@ -6706,7 +6751,7 @@ self.addEventListener("message", (t) => {
|
|
|
6706
6751
|
}), self.handleRequestTile = async (t) => {
|
|
6707
6752
|
const { tileKey: e, fetchOptions: s = {}, workerOptions: i, url: r, z: a, sourceProjectionName: n, targetProjectionName: o, id: h } = t;
|
|
6708
6753
|
t.sourceProjection = getProjection(n), t.targetProjection = getProjection(o);
|
|
6709
|
-
const c = o === PROJECTION_WEB_MERCATOR && n === PROJECTION_WEB_MERCATOR;
|
|
6754
|
+
const c = o === PROJECTION_WEB_MERCATOR && n === PROJECTION_WEB_MERCATOR || o === PROJECTION_BD_MERCATOR && n === PROJECTION_BD_MERCATOR;
|
|
6710
6755
|
t.isNormalized = c;
|
|
6711
6756
|
let l = null, u = 0;
|
|
6712
6757
|
i && (self.displayOptions = i.displayOptions, self.zIndex = i.height, i.isAttach && (self.isAttach = !!i.isAttach, ATTACH_SCALE = 1));
|
|
@@ -6743,17 +6788,17 @@ self.addEventListener("message", (t) => {
|
|
|
6743
6788
|
};
|
|
6744
6789
|
let layerIndex = 0;
|
|
6745
6790
|
function parseGeoLayers(t, e, s) {
|
|
6746
|
-
const i = self.displayOptions, r =
|
|
6791
|
+
const i = self.displayOptions || {}, r = false === i.base, a = false === i.link, n = false === i.building, o = false === i.poi, h = true === i.flat, c = t.geolayer, l = e.polygons, u = e.polygonOpacitys, d = e.polygon3ds, _ = e.lines, m = e.building3ds, p = e.pois, f = e.arrows, y = Math.floor(s.useZoom) || s.z;
|
|
6747
6792
|
let g = 0, M = 0, x = null, w = null, S = null, C = null, E = null;
|
|
6748
6793
|
layerIndex = 20 * LAYER_INDEX_DELTA;
|
|
6749
6794
|
const P = s.z < 9 ? getStyleConfig(M, 1522, y, POLYGON_STYLE, s) : getStyleConfig(M, 72, y, POLYGON_STYLE, s);
|
|
6750
|
-
!r && P && l.push(createBgPolygon(P, s)), layerIndex += 1 * LAYER_INDEX_DELTA;
|
|
6795
|
+
!r && P && l.push(createBgPolygon(P, s)), layerIndex += 1 * LAYER_INDEX_DELTA, c.sort((t2, e2) => t2.rank - e2.rank);
|
|
6751
6796
|
for (const t2 of c) {
|
|
6752
6797
|
M = t2.catalogType, g = t2.rank;
|
|
6753
6798
|
const e2 = t2.arrowp;
|
|
6754
6799
|
if (M === GAOQING_ARROW_TYPE && e2) {
|
|
6755
6800
|
const e3 = createArrow(t2, y, s);
|
|
6756
|
-
e3 && (e3.rank = g,
|
|
6801
|
+
e3 && (e3.rank = g, f.push(e3), layerIndex += LAYER_INDEX_DELTA);
|
|
6757
6802
|
continue;
|
|
6758
6803
|
}
|
|
6759
6804
|
const i2 = t2.geoobjectsetSet;
|
|
@@ -6804,7 +6849,7 @@ function parseGeoLayers(t, e, s) {
|
|
|
6804
6849
|
if (!o && M === POI_TYPE) {
|
|
6805
6850
|
if (!i3.name)
|
|
6806
6851
|
continue;
|
|
6807
|
-
E = createPOI(i3, t3.styleId, s, e3), E &&
|
|
6852
|
+
E = createPOI(i3, t3.styleId, s, e3), E && p.push(E);
|
|
6808
6853
|
}
|
|
6809
6854
|
} else
|
|
6810
6855
|
x = createGradientPolygon(i3, e3.startPtStyle, e3.endPtStyle, s), x && (x.rank = g, l.push(x), layerIndex += LAYER_INDEX_DELTA);
|
|
@@ -6856,12 +6901,12 @@ function parseGeoLayers(t, e, s) {
|
|
|
6856
6901
|
e3.rank = g, d.push(e3), layerIndex += LAYER_INDEX_DELTA;
|
|
6857
6902
|
}
|
|
6858
6903
|
}
|
|
6859
|
-
if (t.labelp) {
|
|
6904
|
+
if (t.labelp && false !== i.poiText) {
|
|
6860
6905
|
let e2 = t.labelp;
|
|
6861
6906
|
for (let t2 = 0; t2 < e2.length; t2++) {
|
|
6862
6907
|
const i2 = e2[t2];
|
|
6863
6908
|
let r2 = null;
|
|
6864
|
-
o || (r2 = getStyleConfig(POI_TYPE, i2.styleId, y, POINT_TEXT_STYLE, s)), r2 && createLabelPoi(
|
|
6909
|
+
o || (r2 = getStyleConfig(POI_TYPE, i2.styleId, y, POINT_TEXT_STYLE, s)), r2 && createLabelPoi(p, i2, y, s, r2);
|
|
6865
6910
|
}
|
|
6866
6911
|
}
|
|
6867
6912
|
return layerIndex;
|
|
@@ -6869,7 +6914,7 @@ function parseGeoLayers(t, e, s) {
|
|
|
6869
6914
|
function createArrow(t, e, s) {
|
|
6870
6915
|
const i = t.arrowp, r = parseFeature(i.x), a = s.targetProjection, [n, o, h] = s.targetCenter, c = i.tracer, l = i.zvector, u = 1 / 256, d = -0.5 + u, _ = 0.5 - u;
|
|
6871
6916
|
let m = getTileMaxValueByZ(s.z, s);
|
|
6872
|
-
const
|
|
6917
|
+
const p = [], f = [], y = [], g = [], M = [], x = [], w = parseFeature(l, 1);
|
|
6873
6918
|
let S = [];
|
|
6874
6919
|
1 === w.length && w[0] ? (S = new Array(r.length), S.fill(w[0])) : S = w;
|
|
6875
6920
|
for (let t2 = 0; t2 < r.length; t2++)
|
|
@@ -6890,9 +6935,9 @@ function createArrow(t, e, s) {
|
|
|
6890
6935
|
const t3 = Math.hypot(l2, u2);
|
|
6891
6936
|
_center[0] = (_projectedEnd[0] + _projectedStart[0]) / 2 - n, _center[1] = (_projectedEnd[1] + _projectedStart[1]) / 2 - o, _center[2] = (_projectedEnd[2] + _projectedStart[2]) / 2 - h, a.getProjectedSurfaceNormal(_vector.fromArray(_projectedStart), _normal), _vector.set(_projectedEnd[0] - _projectedStart[0], _projectedEnd[1] - _projectedStart[1], _projectedEnd[2] - _projectedStart[2]).normalize().multiplyScalar(t3), _normal.crossVectors(_normal, _vector).normalize().multiplyScalar(t3 / 2);
|
|
6892
6937
|
}
|
|
6893
|
-
|
|
6938
|
+
p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = -_vector.x, y[y.length] = -_vector.y, y[y.length] = -_vector.z, M[M.length] = _normal.x, M[M.length] = _normal.y, M[M.length] = _normal.z, g[g.length] = 0.125, g[g.length] = 0.3125, x[x.length] = layerIndex, p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = -_vector.x, y[y.length] = -_vector.y, y[y.length] = -_vector.z, M[M.length] = -_normal.x, M[M.length] = -_normal.y, M[M.length] = -_normal.z, g[g.length] = 0.125, g[g.length] = 0.6875, x[x.length] = layerIndex, p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = _vector.x, y[y.length] = _vector.y, y[y.length] = _vector.z, M[M.length] = _normal.x, M[M.length] = _normal.y, M[M.length] = _normal.z, g[g.length] = 1, g[g.length] = 0.3125, x[x.length] = layerIndex, p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = _vector.x, y[y.length] = _vector.y, y[y.length] = _vector.z, M[M.length] = -_normal.x, M[M.length] = -_normal.y, M[M.length] = -_normal.z, g[g.length] = 1, g[g.length] = 0.6875, x[x.length] = layerIndex, f[f.length] = w2, f[f.length] = w2 + 1, f[f.length] = w2 + 2, f[f.length] = w2 + 2, f[f.length] = w2 + 1, f[f.length] = w2 + 3;
|
|
6894
6939
|
}
|
|
6895
|
-
return { vertices:
|
|
6940
|
+
return { vertices: p, indices: f, flatNormals: M, instanceRotationMatrices: [], diffs: y, uvs: g, layerIndices: x };
|
|
6896
6941
|
}
|
|
6897
6942
|
function createLine(t, e, s, i = {}, r) {
|
|
6898
6943
|
var _a;
|
|
@@ -6912,13 +6957,13 @@ function createLine(t, e, s, i = {}, r) {
|
|
|
6912
6957
|
}
|
|
6913
6958
|
}
|
|
6914
6959
|
c && u > 1 && (_ = getIconInfo(c), _ && _[1] && (u = Math.max(_[1] / 7, 1)));
|
|
6915
|
-
let
|
|
6916
|
-
/guojietianqiaojieti/.test(c) && (
|
|
6960
|
+
let p = 0;
|
|
6961
|
+
/guojietianqiaojieti/.test(c) && (p = 0.04), /weidingguojie_guonei/.test(c) && (s *= 1.1);
|
|
6917
6962
|
for (let t2 = 0; t2 < d.length; t2++)
|
|
6918
|
-
m && m[t2] && (d[t2][2] +=
|
|
6963
|
+
m && m[t2] && (d[t2][2] += p + m[t2] / 100 / ATTACH_SCALE);
|
|
6919
6964
|
projectVertices(d, r, false, false);
|
|
6920
|
-
const
|
|
6921
|
-
return
|
|
6965
|
+
const f = lineToMesh(d, s, r, l, u);
|
|
6966
|
+
return f.colors = fillFlatArray(f.vertices.length / 3, [e[0], e[1], e[2], (_a = e[3]) != null ? _a : 1]), f.layerIndices = fillFlatArray(f.vertices.length / 3, [layerIndex]), c && (f.fillTextureStyle = { fillTexture: c, textureInfo: _, isSingle: l ? 1 : 0 }), f;
|
|
6922
6967
|
}
|
|
6923
6968
|
function tileNormalizedPositionToMeter(t, e, s) {
|
|
6924
6969
|
const [i, r, a, n, o, h] = e.projectedBoundingBox, c = n - i, l = o - r;
|
|
@@ -6926,7 +6971,7 @@ function tileNormalizedPositionToMeter(t, e, s) {
|
|
|
6926
6971
|
}
|
|
6927
6972
|
function createBgPolygon(t, e) {
|
|
6928
6973
|
const s = t.color;
|
|
6929
|
-
return createGroundTileMesh(e, { colors: [s[0], s[1], s[2]], layerIndices: [0]
|
|
6974
|
+
return createGroundTileMesh(e, { colors: [s[0], s[1], s[2]], layerIndices: [0] });
|
|
6930
6975
|
}
|
|
6931
6976
|
function getSubDivisionMaxLength(t) {
|
|
6932
6977
|
if (t.targetProjectionName === t.sourceProjectionName)
|
|
@@ -6942,7 +6987,7 @@ function createPolygon(t, e, s = {}, i) {
|
|
|
6942
6987
|
if (!a || !r)
|
|
6943
6988
|
return;
|
|
6944
6989
|
const l = [], u = [], d = [], _ = [], m = [];
|
|
6945
|
-
let
|
|
6990
|
+
let p = [], f = [], y = [], g = [], M = [];
|
|
6946
6991
|
const x = l.length / 3;
|
|
6947
6992
|
let w = parseMidPoints(r, 100 * LAND_OFFSETZ, i), S = false, C = false;
|
|
6948
6993
|
if (o) {
|
|
@@ -6970,7 +7015,7 @@ function createPolygon(t, e, s = {}, i) {
|
|
|
6970
7015
|
E = w[t2], l.push(E[0], E[1], E[2]), d.push(0, 0, 1), c ? _.push(e[0], e[1], e[2], e[3] || 1) : _.push(e[0], e[1], e[2]), m.push(layerIndex);
|
|
6971
7016
|
for (let t2 = 0, e2 = a.length; t2 < e2; t2++)
|
|
6972
7017
|
u.push(x + a[t2]);
|
|
6973
|
-
h || (
|
|
7018
|
+
h || (p = l, f = u, g = _, y = d, M = m);
|
|
6974
7019
|
let P = S && !C;
|
|
6975
7020
|
if (S && !C) {
|
|
6976
7021
|
const t2 = s.borderRgba || e;
|
|
@@ -6978,22 +7023,22 @@ function createPolygon(t, e, s = {}, i) {
|
|
|
6978
7023
|
for (let e2 = 0, s2 = w.length; e2 < s2; e2 += 1) {
|
|
6979
7024
|
E = w[e2];
|
|
6980
7025
|
let r2 = E[2], a2 = r2 - 280;
|
|
6981
|
-
a2 < 0 && (a2 = 0),
|
|
7026
|
+
a2 < 0 && (a2 = 0), p.push(E[0], E[1], r2, E[0], E[1], a2), g.push(t2[0], t2[1], t2[2], t2[0], t2[1], t2[2]), M.push(layerIndex, layerIndex);
|
|
6982
7027
|
let n2 = e2 === s2 - 1 ? 0 : e2 + 1, o2 = E[0], h2 = E[1], c2 = w[n2][0], l2 = w[n2][1], u2 = crossVectors3([0, 0, a2 - r2], [c2 - o2, l2 - h2, 0]);
|
|
6983
7028
|
u2[0] || u2[1] || u2[2] || (u2 = [d[d.length - 3], d[d.length - 2], d[d.length - 1]]), y.push(u2[0], u2[1], u2[2], u2[0], u2[1], u2[2]);
|
|
6984
7029
|
let _2 = false;
|
|
6985
|
-
o2 === c2 ? (Math.abs(o2 + 0.5) < DELTA || Math.abs(o2 - 0.5) < DELTA) && (_2 = true) : h2 === l2 && (Math.abs(h2 + 0.5) < DELTA || Math.abs(h2 - 0.5) < DELTA) && (_2 = true), _2 || (e2 === s2 - 1 ?
|
|
7030
|
+
o2 === c2 ? (Math.abs(o2 + 0.5) < DELTA || Math.abs(o2 - 0.5) < DELTA) && (_2 = true) : h2 === l2 && (Math.abs(h2 + 0.5) < DELTA || Math.abs(h2 - 0.5) < DELTA) && (_2 = true), _2 || (e2 === s2 - 1 ? f.push(i2 + 2 * e2, i2 + 2 * e2 + 1, i2, i2, i2 + 2 * e2 + 1, i2 + 1) : f.push(i2 + 2 * e2, i2 + 2 * e2 + 1, i2 + 2 * e2 + 2, i2 + 2 * e2 + 2, i2 + 2 * e2 + 1, i2 + 2 * e2 + 3));
|
|
6986
7031
|
}
|
|
6987
7032
|
}
|
|
6988
7033
|
for (let t2 = 0; t2 < l.length; t2 += 3)
|
|
6989
7034
|
l[t2 + 2] = l[t2 + 2] / 100 / ATTACH_SCALE;
|
|
6990
7035
|
if (projectVertices(l, i), h && P) {
|
|
6991
|
-
for (let t2 = 0; t2 <
|
|
6992
|
-
|
|
6993
|
-
projectVertices(
|
|
6994
|
-
return { delayObject: { vertices:
|
|
7036
|
+
for (let t2 = 0; t2 < p.length; t2 += 3)
|
|
7037
|
+
p[t2 + 2] = p[t2 + 2] / 100 / ATTACH_SCALE;
|
|
7038
|
+
projectVertices(p, i);
|
|
7039
|
+
return { delayObject: { vertices: p, indices: f, colors: g, layerIndices: M }, object: { vertices: l, indices: u, colors: _, layerIndices: m } };
|
|
6995
7040
|
}
|
|
6996
|
-
return { vertices: l, indices: u,
|
|
7041
|
+
return { vertices: l, indices: u, colors: _, layerIndices: m };
|
|
6997
7042
|
}
|
|
6998
7043
|
function createGradientPolygon(t, e, s, i) {
|
|
6999
7044
|
const r = t.midPoints;
|
|
@@ -7010,15 +7055,15 @@ function createGradientPolygon(t, e, s, i) {
|
|
|
7010
7055
|
h[t2] = n[t2] || 1;
|
|
7011
7056
|
}
|
|
7012
7057
|
const c = [], l = [], u = [], d = [], _ = [], m = c.length / 3;
|
|
7013
|
-
let
|
|
7014
|
-
const
|
|
7058
|
+
let p = parseFeature(r);
|
|
7059
|
+
const f = 1 / 256, y = -0.5 + f, g = 0.5 - f;
|
|
7015
7060
|
let M = getTileMaxValueByZ(i.z, i);
|
|
7016
7061
|
const x = [o[0] / 100, o[1] / 100], w = [o[2] / 100, o[3] / 100], S = e.color, C = s.color, E = [w[0] - x[0], w[1] - x[1]], P = Math.sqrt(Math.pow(E[0], 2) + Math.pow(E[1], 2));
|
|
7017
|
-
for (let t2 = 0, e2 =
|
|
7018
|
-
const e3 =
|
|
7062
|
+
for (let t2 = 0, e2 = p.length; t2 < e2; t2++) {
|
|
7063
|
+
const e3 = p[t2];
|
|
7019
7064
|
let s2, i2;
|
|
7020
7065
|
if (0 === E[0])
|
|
7021
|
-
s2 = x, i2 = e3[1];
|
|
7066
|
+
s2 = x[0], i2 = e3[1];
|
|
7022
7067
|
else {
|
|
7023
7068
|
const t3 = -((x[0] - e3[0]) * E[0] + (x[1] - e3[1]) * E[1]) / (E[0] * E[0] + E[1] * E[1]);
|
|
7024
7069
|
s2 = t3 * E[0] + x[0], i2 = t3 * E[1] + x[1];
|
|
@@ -7042,24 +7087,24 @@ function createBuilding3d(t, e, s, i) {
|
|
|
7042
7087
|
const r = t.midPoints, a = t.indices, n = t.altitude / ATTACH_SCALE;
|
|
7043
7088
|
if (!a || !r)
|
|
7044
7089
|
return;
|
|
7045
|
-
const o = [], h = [], c = [], l = [], u =
|
|
7046
|
-
let
|
|
7047
|
-
for (let t2 = 0, s2 =
|
|
7048
|
-
|
|
7090
|
+
const o = [], h = [], c = [], l = [], u = parseMidPoints(r, n + LAND_OFFSETZ, i);
|
|
7091
|
+
let d = null;
|
|
7092
|
+
for (let t2 = 0, s2 = u.length; t2 < s2; t2 += 1)
|
|
7093
|
+
d = u[t2], o.push(d[0], d[1], d[2]), c.push(e[0], e[1], e[2]), l.push(d[2], encodeConcave(false, false, false));
|
|
7049
7094
|
for (let t2 = 0, e2 = a.length; t2 < e2; t2++)
|
|
7050
7095
|
h.push(a[t2]);
|
|
7051
|
-
const
|
|
7052
|
-
for (let t2 = 0, e2 = isClosed(
|
|
7053
|
-
let i2 = [
|
|
7096
|
+
const _ = o.length / 3;
|
|
7097
|
+
for (let t2 = 0, e2 = isClosed(u) ? u.length - 1 : u.length; t2 < e2; t2 += 1) {
|
|
7098
|
+
let i2 = [u[t2][0], u[t2][1], LAND_OFFSETZ], r2 = [u[t2][0], u[t2][1], u[t2][2]], a2 = t2 + 1;
|
|
7054
7099
|
t2 === e2 - 1 && (a2 = 0);
|
|
7055
|
-
let n2 = [
|
|
7056
|
-
o.push(i2[0], i2[1], i2[2], r2[0], r2[1], r2[2], n2[0], n2[1], n2[2],
|
|
7057
|
-
let
|
|
7058
|
-
0 === t2 ?
|
|
7059
|
-
const
|
|
7060
|
-
h.push(
|
|
7061
|
-
}
|
|
7062
|
-
return projectVertices(o, i), { vertices: o, indices: h,
|
|
7100
|
+
let n2 = [u[a2][0], u[a2][1], LAND_OFFSETZ], d2 = [u[a2][0], u[a2][1], u[a2][2]], m = 0 === t2 ? e2 - 1 : t2 - 1, p = [u[m][0], u[m][1], LAND_OFFSETZ];
|
|
7101
|
+
o.push(i2[0], i2[1], i2[2], r2[0], r2[1], r2[2], n2[0], n2[1], n2[2], d2[0], d2[1], d2[2]), c.push(s[0], s[1], s[2], s[0], s[1], s[2], s[0], s[1], s[2], s[0], s[1], s[2]);
|
|
7102
|
+
let f = isAOConcaveAngle(p, i2, n2);
|
|
7103
|
+
0 === t2 ? l.push(0, encodeConcave(true, f, false), r2[2], encodeConcave(false, f, false)) : l.push(0, encodeConcave(true, f, true), r2[2], encodeConcave(false, f, true), 0, encodeConcave(true, f, false), r2[2], encodeConcave(false, f, false)), t2 === e2 - 1 && (f = isAOConcaveAngle(i2, n2, u[a2 + 1]), l.push(0, encodeConcave(true, f, true), r2[2], encodeConcave(false, f, true)));
|
|
7104
|
+
const y = _ + 4 * t2;
|
|
7105
|
+
h.push(y, y + 2, y + 3, y, y + 3, y + 1);
|
|
7106
|
+
}
|
|
7107
|
+
return projectVertices(o, i), { vertices: o, indices: h, colors: c, heightAndConcaves: l };
|
|
7063
7108
|
}
|
|
7064
7109
|
function getIconVertexData(t, e) {
|
|
7065
7110
|
const s = getIconInfo(t);
|
|
@@ -7082,18 +7127,20 @@ function convertPOIPosition(t, e, s, i, r) {
|
|
|
7082
7127
|
return _pointIn.x = a / o - 0.5, _pointIn.y = n / o - 0.5, _pointIn.z = s || 0, tileNormalizedPositionToMeter(_pointIn, i, _pointOut), i.isNormalized || (i.sourceProjection.unprojectCoordinate(_pointOut, _pointIn), i.sourceCoordType !== i.targetCoordType && CoordTransformer.transform(i.sourceCoordType, i.targetCoordType, _pointIn, _pointIn), i.targetProjection.projectCoordinate(_pointIn, _pointOut)), r[0] = _pointOut.x, r[1] = _pointOut.y, r[2] = _pointOut.z, r;
|
|
7083
7128
|
}
|
|
7084
7129
|
function createPOI(t, e, s, i) {
|
|
7085
|
-
const r = i.styleText, a = t.name, n = t.direction;
|
|
7086
|
-
let
|
|
7087
|
-
const
|
|
7130
|
+
const r = i.styleText, a = t.name, n = t.direction, o = s.workerOptions.displayOptions || {};
|
|
7131
|
+
let h, c, l = 0, u = 0, d = false;
|
|
7132
|
+
const _ = "" !== a && !!r && false !== o.poiText;
|
|
7088
7133
|
if (i.stylePt) {
|
|
7089
7134
|
let t2 = (i.stylePt.zoom || 100) / 100;
|
|
7090
|
-
|
|
7091
|
-
const e2 = getIconInfo(
|
|
7092
|
-
|
|
7135
|
+
h = i.stylePt.icon;
|
|
7136
|
+
const e2 = getIconInfo(h);
|
|
7137
|
+
d = !(n !== POI_ICON_DIR_CENTER || !_ || !e2), null === h || d ? e2 && (l = e2[0], u = e2[1]) : (c = getIconVertexData(h, t2), c && (l = c.width, u = c.height));
|
|
7093
7138
|
}
|
|
7094
7139
|
i = i.styleText;
|
|
7095
|
-
let
|
|
7096
|
-
|
|
7140
|
+
let m = [0, 0, 0];
|
|
7141
|
+
m = convertPOIPosition(t.posx, t.posy, self.zIndex, s, m);
|
|
7142
|
+
let p = null;
|
|
7143
|
+
return false !== o.poiIcon && (p = { icon: h, pos: c, size: [l, u], textDrawOnIcon: d }), { position: m, text: t.name, styleId: e, styleConfig: i, iconConfig: p, hasText: _, ...t };
|
|
7097
7144
|
}
|
|
7098
7145
|
function createLabelPoi(t, e, s, i, r) {
|
|
7099
7146
|
const a = 100 * ATTACH_SCALE;
|
|
@@ -7107,12 +7154,12 @@ function createLabelPoi(t, e, s, i, r) {
|
|
|
7107
7154
|
let u2 = l[s2], m = c[s2];
|
|
7108
7155
|
if (!isVisible(u2, i))
|
|
7109
7156
|
continue;
|
|
7110
|
-
let
|
|
7111
|
-
h = _.slice(
|
|
7112
|
-
let
|
|
7113
|
-
o.length > 0 && (
|
|
7157
|
+
let p = s2 * n * 2;
|
|
7158
|
+
h = _.slice(p, p + 2 * n);
|
|
7159
|
+
let f = 0;
|
|
7160
|
+
o.length > 0 && (f = d[s2 * n] / a);
|
|
7114
7161
|
let y = [0, 0, 0];
|
|
7115
|
-
y = convertPOIPosition(h[0], h[1],
|
|
7162
|
+
y = convertPOIPosition(h[0], h[1], f + (self.zIndex || 0), i, y);
|
|
7116
7163
|
let g = h[2 * (n - 1)] - h[0], M = h[2 * (n - 1) + 1] - h[1], x = Math.atan2(-M, -g) + Math.PI;
|
|
7117
7164
|
1 === m && (x += Math.PI), t.push({ type: "labelp", position: y, text: e.name, rotateZ: x, styleConfig: r, hasText: true, ...e });
|
|
7118
7165
|
}
|