@rtzh/engine 0.0.5 → 0.0.6
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/Build/Workers/chunk-243UEBJF.js +1045 -0
- package/Build/Workers/chunk-3NSMZ3XW.js +1067 -0
- package/Build/Workers/chunk-4DIL24GG.js +1460 -0
- package/Build/Workers/chunk-4FEDW3WT.js +299 -0
- package/Build/Workers/chunk-4SC4KVID.js +692 -0
- package/Build/Workers/chunk-53AFSDGM.js +37 -0
- package/Build/Workers/chunk-54SSO7NS.js +352 -0
- package/Build/Workers/chunk-5SVTAJRH.js +837 -0
- package/Build/Workers/chunk-5W4ISZGQ.js +1483 -0
- package/Build/Workers/chunk-64VDO4BW.js +114 -0
- package/Build/Workers/chunk-6AUSOZOL.js +476 -0
- package/Build/Workers/chunk-7MMYV5PM.js +288 -0
- package/Build/Workers/chunk-7QPQGSS3.js +57 -0
- package/Build/Workers/chunk-AEURJQ3B.js +73 -0
- package/Build/Workers/chunk-AMJRLIO3.js +414 -0
- package/Build/Workers/chunk-BCYABDWF.js +3514 -0
- package/Build/Workers/chunk-CTARL7CY.js +511 -0
- package/Build/Workers/chunk-DIA4J2DB.js +497 -0
- package/Build/Workers/chunk-E5BSDIGY.js +139 -0
- package/Build/Workers/chunk-EJVGOIOW.js +1317 -0
- package/Build/Workers/chunk-ERYOZBVC.js +171 -0
- package/Build/Workers/chunk-ET7LWDHA.js +58 -0
- package/Build/Workers/chunk-FSYQE5XE.js +55 -0
- package/Build/Workers/chunk-G7PGTG3P.js +387 -0
- package/Build/Workers/chunk-GZMTBQM2.js +1443 -0
- package/Build/Workers/chunk-HAR6Y2HP.js +1800 -0
- package/Build/Workers/chunk-HM4MH5IG.js +138 -0
- package/Build/Workers/chunk-IB2XQV6U.js +101 -0
- package/Build/Workers/chunk-IXM65GBF.js +256 -0
- package/Build/Workers/chunk-IYAZCFAC.js +642 -0
- package/Build/Workers/chunk-JRPAFYGJ.js +1054 -0
- package/Build/Workers/chunk-LPJHTJDQ.js +305 -0
- package/Build/Workers/chunk-LRW2QXMW.js +352 -0
- package/Build/Workers/chunk-MWN26ZEM.js +280 -0
- package/Build/Workers/chunk-NIWB6UMY.js +198 -0
- package/Build/Workers/chunk-O5QH7XD5.js +629 -0
- package/Build/Workers/chunk-OBM2JYMG.js +75 -0
- package/Build/Workers/chunk-ODZZZGXK.js +219 -0
- package/Build/Workers/chunk-QY55DT53.js +97 -0
- package/Build/Workers/chunk-R3PTQZ6H.js +44 -0
- package/Build/Workers/chunk-RT7PY6BH.js +2719 -0
- package/Build/Workers/chunk-SAD42JSM.js +102 -0
- package/Build/Workers/chunk-SFM3GNS2.js +682 -0
- package/Build/Workers/chunk-SLYUIIFB.js +455 -0
- package/Build/Workers/chunk-SQSWONTJ.js +241 -0
- package/Build/Workers/chunk-SRLJWNU2.js +368 -0
- package/Build/Workers/chunk-SZELHE7Q.js +163 -0
- package/Build/Workers/chunk-TBASKFFL.js +124 -0
- package/Build/Workers/chunk-TDGGEIZE.js +398 -0
- package/Build/Workers/chunk-U3VI26GL.js +162 -0
- package/Build/Workers/chunk-VLB25GGE.js +439 -0
- package/Build/Workers/chunk-W4DV7TAL.js +8366 -0
- package/Build/Workers/chunk-WFTPZ3ZX.js +788 -0
- package/Build/Workers/chunk-WWLWTSMV.js +55 -0
- package/Build/Workers/chunk-WX2ZANQC.js +940 -0
- package/Build/Workers/chunk-XFKTM6GN.js +2058 -0
- package/Build/Workers/chunk-Z5MHVJGN.js +778 -0
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Scene/Cesium3DTileset.js +4121 -4105
- package/Source/Scene/Model/BarycentricWireframePipelineStage.js +258 -79
- package/Source/Scene/Model/Model.js +3584 -3512
- package/Source/Scene/Model/Model3DTileContent.js +568 -568
- package/Source/Scene/Model/ModelRuntimePrimitive.js +391 -391
- package/Source/Scene/Model/WireframePipelineStage.js +122 -122
- package/Source/Shaders/Model/ModelFS.glsl +3 -1
- package/Source/Shaders/Model/ModelFS.js +3 -1
- package/index.d.ts +801 -773
- package/index.js +65 -65
- package/package.json +1 -1
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.6
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
Cartographic_default,
|
|
28
|
+
Ellipsoid_default
|
|
29
|
+
} from "./chunk-4DIL24GG.js";
|
|
30
|
+
import {
|
|
31
|
+
Cartesian3_default
|
|
32
|
+
} from "./chunk-GZMTBQM2.js";
|
|
33
|
+
import {
|
|
34
|
+
Math_default
|
|
35
|
+
} from "./chunk-DIA4J2DB.js";
|
|
36
|
+
import {
|
|
37
|
+
Check_default,
|
|
38
|
+
DeveloperError_default
|
|
39
|
+
} from "./chunk-SZELHE7Q.js";
|
|
40
|
+
import {
|
|
41
|
+
defined_default
|
|
42
|
+
} from "./chunk-OBM2JYMG.js";
|
|
43
|
+
|
|
44
|
+
// packages/engine/Source/Core/EllipsoidRhumbLine.js
|
|
45
|
+
function calculateM(ellipticity, major, latitude) {
|
|
46
|
+
if (ellipticity === 0) {
|
|
47
|
+
return major * latitude;
|
|
48
|
+
}
|
|
49
|
+
const e2 = ellipticity * ellipticity;
|
|
50
|
+
const e4 = e2 * e2;
|
|
51
|
+
const e6 = e4 * e2;
|
|
52
|
+
const e8 = e6 * e2;
|
|
53
|
+
const e10 = e8 * e2;
|
|
54
|
+
const e12 = e10 * e2;
|
|
55
|
+
const phi = latitude;
|
|
56
|
+
const sin2Phi = Math.sin(2 * phi);
|
|
57
|
+
const sin4Phi = Math.sin(4 * phi);
|
|
58
|
+
const sin6Phi = Math.sin(6 * phi);
|
|
59
|
+
const sin8Phi = Math.sin(8 * phi);
|
|
60
|
+
const sin10Phi = Math.sin(10 * phi);
|
|
61
|
+
const sin12Phi = Math.sin(12 * phi);
|
|
62
|
+
return major * ((1 - e2 / 4 - 3 * e4 / 64 - 5 * e6 / 256 - 175 * e8 / 16384 - 441 * e10 / 65536 - 4851 * e12 / 1048576) * phi - (3 * e2 / 8 + 3 * e4 / 32 + 45 * e6 / 1024 + 105 * e8 / 4096 + 2205 * e10 / 131072 + 6237 * e12 / 524288) * sin2Phi + (15 * e4 / 256 + 45 * e6 / 1024 + 525 * e8 / 16384 + 1575 * e10 / 65536 + 155925 * e12 / 8388608) * sin4Phi - (35 * e6 / 3072 + 175 * e8 / 12288 + 3675 * e10 / 262144 + 13475 * e12 / 1048576) * sin6Phi + (315 * e8 / 131072 + 2205 * e10 / 524288 + 43659 * e12 / 8388608) * sin8Phi - (693 * e10 / 1310720 + 6237 * e12 / 5242880) * sin10Phi + 1001 * e12 / 8388608 * sin12Phi);
|
|
63
|
+
}
|
|
64
|
+
function calculateInverseM(M, ellipticity, major) {
|
|
65
|
+
const d = M / major;
|
|
66
|
+
if (ellipticity === 0) {
|
|
67
|
+
return d;
|
|
68
|
+
}
|
|
69
|
+
const d2 = d * d;
|
|
70
|
+
const d3 = d2 * d;
|
|
71
|
+
const d4 = d3 * d;
|
|
72
|
+
const e = ellipticity;
|
|
73
|
+
const e2 = e * e;
|
|
74
|
+
const e4 = e2 * e2;
|
|
75
|
+
const e6 = e4 * e2;
|
|
76
|
+
const e8 = e6 * e2;
|
|
77
|
+
const e10 = e8 * e2;
|
|
78
|
+
const e12 = e10 * e2;
|
|
79
|
+
const sin2D = Math.sin(2 * d);
|
|
80
|
+
const cos2D = Math.cos(2 * d);
|
|
81
|
+
const sin4D = Math.sin(4 * d);
|
|
82
|
+
const cos4D = Math.cos(4 * d);
|
|
83
|
+
const sin6D = Math.sin(6 * d);
|
|
84
|
+
const cos6D = Math.cos(6 * d);
|
|
85
|
+
const sin8D = Math.sin(8 * d);
|
|
86
|
+
const cos8D = Math.cos(8 * d);
|
|
87
|
+
const sin10D = Math.sin(10 * d);
|
|
88
|
+
const cos10D = Math.cos(10 * d);
|
|
89
|
+
const sin12D = Math.sin(12 * d);
|
|
90
|
+
return d + d * e2 / 4 + 7 * d * e4 / 64 + 15 * d * e6 / 256 + 579 * d * e8 / 16384 + 1515 * d * e10 / 65536 + 16837 * d * e12 / 1048576 + (3 * d * e4 / 16 + 45 * d * e6 / 256 - d * (32 * d2 - 561) * e8 / 4096 - d * (232 * d2 - 1677) * e10 / 16384 + d * (399985 - 90560 * d2 + 512 * d4) * e12 / 5242880) * cos2D + (21 * d * e6 / 256 + 483 * d * e8 / 4096 - d * (224 * d2 - 1969) * e10 / 16384 - d * (33152 * d2 - 112599) * e12 / 1048576) * cos4D + (151 * d * e8 / 4096 + 4681 * d * e10 / 65536 + 1479 * d * e12 / 16384 - 453 * d3 * e12 / 32768) * cos6D + (1097 * d * e10 / 65536 + 42783 * d * e12 / 1048576) * cos8D + 8011 * d * e12 / 1048576 * cos10D + (3 * e2 / 8 + 3 * e4 / 16 + 213 * e6 / 2048 - 3 * d2 * e6 / 64 + 255 * e8 / 4096 - 33 * d2 * e8 / 512 + 20861 * e10 / 524288 - 33 * d2 * e10 / 512 + d4 * e10 / 1024 + 28273 * e12 / 1048576 - 471 * d2 * e12 / 8192 + 9 * d4 * e12 / 4096) * sin2D + (21 * e4 / 256 + 21 * e6 / 256 + 533 * e8 / 8192 - 21 * d2 * e8 / 512 + 197 * e10 / 4096 - 315 * d2 * e10 / 4096 + 584039 * e12 / 16777216 - 12517 * d2 * e12 / 131072 + 7 * d4 * e12 / 2048) * sin4D + (151 * e6 / 6144 + 151 * e8 / 4096 + 5019 * e10 / 131072 - 453 * d2 * e10 / 16384 + 26965 * e12 / 786432 - 8607 * d2 * e12 / 131072) * sin6D + (1097 * e8 / 131072 + 1097 * e10 / 65536 + 225797 * e12 / 10485760 - 1097 * d2 * e12 / 65536) * sin8D + (8011 * e10 / 2621440 + 8011 * e12 / 1048576) * sin10D + 293393 * e12 / 251658240 * sin12D;
|
|
91
|
+
}
|
|
92
|
+
function calculateSigma(ellipticity, latitude) {
|
|
93
|
+
if (ellipticity === 0) {
|
|
94
|
+
return Math.log(Math.tan(0.5 * (Math_default.PI_OVER_TWO + latitude)));
|
|
95
|
+
}
|
|
96
|
+
const eSinL = ellipticity * Math.sin(latitude);
|
|
97
|
+
return Math.log(Math.tan(0.5 * (Math_default.PI_OVER_TWO + latitude))) - ellipticity / 2 * Math.log((1 + eSinL) / (1 - eSinL));
|
|
98
|
+
}
|
|
99
|
+
function calculateHeading(ellipsoidRhumbLine, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
|
|
100
|
+
const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);
|
|
101
|
+
const sigma2 = calculateSigma(
|
|
102
|
+
ellipsoidRhumbLine._ellipticity,
|
|
103
|
+
secondLatitude
|
|
104
|
+
);
|
|
105
|
+
return Math.atan2(
|
|
106
|
+
Math_default.negativePiToPi(secondLongitude - firstLongitude),
|
|
107
|
+
sigma2 - sigma1
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function calculateArcLength(ellipsoidRhumbLine, major, minor, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
|
|
111
|
+
const heading = ellipsoidRhumbLine._heading;
|
|
112
|
+
const deltaLongitude = secondLongitude - firstLongitude;
|
|
113
|
+
let distance = 0;
|
|
114
|
+
if (Math_default.equalsEpsilon(
|
|
115
|
+
Math.abs(heading),
|
|
116
|
+
Math_default.PI_OVER_TWO,
|
|
117
|
+
Math_default.EPSILON8
|
|
118
|
+
)) {
|
|
119
|
+
if (major === minor) {
|
|
120
|
+
distance = major * Math.cos(firstLatitude) * Math_default.negativePiToPi(deltaLongitude);
|
|
121
|
+
} else {
|
|
122
|
+
const sinPhi = Math.sin(firstLatitude);
|
|
123
|
+
distance = major * Math.cos(firstLatitude) * Math_default.negativePiToPi(deltaLongitude) / Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
const M1 = calculateM(
|
|
127
|
+
ellipsoidRhumbLine._ellipticity,
|
|
128
|
+
major,
|
|
129
|
+
firstLatitude
|
|
130
|
+
);
|
|
131
|
+
const M2 = calculateM(
|
|
132
|
+
ellipsoidRhumbLine._ellipticity,
|
|
133
|
+
major,
|
|
134
|
+
secondLatitude
|
|
135
|
+
);
|
|
136
|
+
distance = (M2 - M1) / Math.cos(heading);
|
|
137
|
+
}
|
|
138
|
+
return Math.abs(distance);
|
|
139
|
+
}
|
|
140
|
+
var scratchCart1 = new Cartesian3_default();
|
|
141
|
+
var scratchCart2 = new Cartesian3_default();
|
|
142
|
+
function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) {
|
|
143
|
+
const firstCartesian = Cartesian3_default.normalize(
|
|
144
|
+
ellipsoid.cartographicToCartesian(start, scratchCart2),
|
|
145
|
+
scratchCart1
|
|
146
|
+
);
|
|
147
|
+
const lastCartesian = Cartesian3_default.normalize(
|
|
148
|
+
ellipsoid.cartographicToCartesian(end, scratchCart2),
|
|
149
|
+
scratchCart2
|
|
150
|
+
);
|
|
151
|
+
Check_default.typeOf.number.greaterThanOrEquals(
|
|
152
|
+
"value",
|
|
153
|
+
Math.abs(
|
|
154
|
+
Math.abs(Cartesian3_default.angleBetween(firstCartesian, lastCartesian)) - Math.PI
|
|
155
|
+
),
|
|
156
|
+
0.0125
|
|
157
|
+
);
|
|
158
|
+
const major = ellipsoid.maximumRadius;
|
|
159
|
+
const minor = ellipsoid.minimumRadius;
|
|
160
|
+
const majorSquared = major * major;
|
|
161
|
+
const minorSquared = minor * minor;
|
|
162
|
+
ellipsoidRhumbLine._ellipticitySquared = (majorSquared - minorSquared) / majorSquared;
|
|
163
|
+
ellipsoidRhumbLine._ellipticity = Math.sqrt(
|
|
164
|
+
ellipsoidRhumbLine._ellipticitySquared
|
|
165
|
+
);
|
|
166
|
+
ellipsoidRhumbLine._start = Cartographic_default.clone(
|
|
167
|
+
start,
|
|
168
|
+
ellipsoidRhumbLine._start
|
|
169
|
+
);
|
|
170
|
+
ellipsoidRhumbLine._start.height = 0;
|
|
171
|
+
ellipsoidRhumbLine._end = Cartographic_default.clone(end, ellipsoidRhumbLine._end);
|
|
172
|
+
ellipsoidRhumbLine._end.height = 0;
|
|
173
|
+
ellipsoidRhumbLine._heading = calculateHeading(
|
|
174
|
+
ellipsoidRhumbLine,
|
|
175
|
+
start.longitude,
|
|
176
|
+
start.latitude,
|
|
177
|
+
end.longitude,
|
|
178
|
+
end.latitude
|
|
179
|
+
);
|
|
180
|
+
ellipsoidRhumbLine._distance = calculateArcLength(
|
|
181
|
+
ellipsoidRhumbLine,
|
|
182
|
+
ellipsoid.maximumRadius,
|
|
183
|
+
ellipsoid.minimumRadius,
|
|
184
|
+
start.longitude,
|
|
185
|
+
start.latitude,
|
|
186
|
+
end.longitude,
|
|
187
|
+
end.latitude
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function interpolateUsingSurfaceDistance(start, heading, distance, major, ellipticity, result) {
|
|
191
|
+
if (distance === 0) {
|
|
192
|
+
return Cartographic_default.clone(start, result);
|
|
193
|
+
}
|
|
194
|
+
const ellipticitySquared = ellipticity * ellipticity;
|
|
195
|
+
let longitude;
|
|
196
|
+
let latitude;
|
|
197
|
+
let deltaLongitude;
|
|
198
|
+
if (Math.abs(Math_default.PI_OVER_TWO - Math.abs(heading)) > Math_default.EPSILON8) {
|
|
199
|
+
const M1 = calculateM(ellipticity, major, start.latitude);
|
|
200
|
+
const deltaM = distance * Math.cos(heading);
|
|
201
|
+
const M2 = M1 + deltaM;
|
|
202
|
+
latitude = calculateInverseM(M2, ellipticity, major);
|
|
203
|
+
if (Math.abs(heading) < Math_default.EPSILON10) {
|
|
204
|
+
longitude = Math_default.negativePiToPi(start.longitude);
|
|
205
|
+
} else {
|
|
206
|
+
const sigma1 = calculateSigma(ellipticity, start.latitude);
|
|
207
|
+
const sigma2 = calculateSigma(ellipticity, latitude);
|
|
208
|
+
deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
|
|
209
|
+
longitude = Math_default.negativePiToPi(start.longitude + deltaLongitude);
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
latitude = start.latitude;
|
|
213
|
+
let localRad;
|
|
214
|
+
if (ellipticity === 0) {
|
|
215
|
+
localRad = major * Math.cos(start.latitude);
|
|
216
|
+
} else {
|
|
217
|
+
const sinPhi = Math.sin(start.latitude);
|
|
218
|
+
localRad = major * Math.cos(start.latitude) / Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);
|
|
219
|
+
}
|
|
220
|
+
deltaLongitude = distance / localRad;
|
|
221
|
+
if (heading > 0) {
|
|
222
|
+
longitude = Math_default.negativePiToPi(start.longitude + deltaLongitude);
|
|
223
|
+
} else {
|
|
224
|
+
longitude = Math_default.negativePiToPi(start.longitude - deltaLongitude);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
if (defined_default(result)) {
|
|
228
|
+
result.longitude = longitude;
|
|
229
|
+
result.latitude = latitude;
|
|
230
|
+
result.height = 0;
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
return new Cartographic_default(longitude, latitude, 0);
|
|
234
|
+
}
|
|
235
|
+
function EllipsoidRhumbLine(start, end, ellipsoid) {
|
|
236
|
+
const e = ellipsoid ?? Ellipsoid_default.default;
|
|
237
|
+
this._ellipsoid = e;
|
|
238
|
+
this._start = new Cartographic_default();
|
|
239
|
+
this._end = new Cartographic_default();
|
|
240
|
+
this._heading = void 0;
|
|
241
|
+
this._distance = void 0;
|
|
242
|
+
this._ellipticity = void 0;
|
|
243
|
+
this._ellipticitySquared = void 0;
|
|
244
|
+
if (defined_default(start) && defined_default(end)) {
|
|
245
|
+
computeProperties(this, start, end, e);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
Object.defineProperties(EllipsoidRhumbLine.prototype, {
|
|
249
|
+
/**
|
|
250
|
+
* Gets the ellipsoid.
|
|
251
|
+
* @memberof EllipsoidRhumbLine.prototype
|
|
252
|
+
* @type {Ellipsoid}
|
|
253
|
+
* @readonly
|
|
254
|
+
*/
|
|
255
|
+
ellipsoid: {
|
|
256
|
+
get: function() {
|
|
257
|
+
return this._ellipsoid;
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* Gets the surface distance between the start and end point
|
|
262
|
+
* @memberof EllipsoidRhumbLine.prototype
|
|
263
|
+
* @type {number}
|
|
264
|
+
* @readonly
|
|
265
|
+
*/
|
|
266
|
+
surfaceDistance: {
|
|
267
|
+
get: function() {
|
|
268
|
+
Check_default.defined("distance", this._distance);
|
|
269
|
+
return this._distance;
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
/**
|
|
273
|
+
* Gets the initial planetodetic point on the path.
|
|
274
|
+
* @memberof EllipsoidRhumbLine.prototype
|
|
275
|
+
* @type {Cartographic}
|
|
276
|
+
* @readonly
|
|
277
|
+
*/
|
|
278
|
+
start: {
|
|
279
|
+
get: function() {
|
|
280
|
+
return this._start;
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
/**
|
|
284
|
+
* Gets the final planetodetic point on the path.
|
|
285
|
+
* @memberof EllipsoidRhumbLine.prototype
|
|
286
|
+
* @type {Cartographic}
|
|
287
|
+
* @readonly
|
|
288
|
+
*/
|
|
289
|
+
end: {
|
|
290
|
+
get: function() {
|
|
291
|
+
return this._end;
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
/**
|
|
295
|
+
* Gets the heading from the start point to the end point.
|
|
296
|
+
* @memberof EllipsoidRhumbLine.prototype
|
|
297
|
+
* @type {number}
|
|
298
|
+
* @readonly
|
|
299
|
+
*/
|
|
300
|
+
heading: {
|
|
301
|
+
get: function() {
|
|
302
|
+
Check_default.defined("distance", this._distance);
|
|
303
|
+
return this._heading;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
EllipsoidRhumbLine.fromStartHeadingDistance = function(start, heading, distance, ellipsoid, result) {
|
|
308
|
+
Check_default.defined("start", start);
|
|
309
|
+
Check_default.defined("heading", heading);
|
|
310
|
+
Check_default.defined("distance", distance);
|
|
311
|
+
Check_default.typeOf.number.greaterThan("distance", distance, 0);
|
|
312
|
+
const e = ellipsoid ?? Ellipsoid_default.default;
|
|
313
|
+
const major = e.maximumRadius;
|
|
314
|
+
const minor = e.minimumRadius;
|
|
315
|
+
const majorSquared = major * major;
|
|
316
|
+
const minorSquared = minor * minor;
|
|
317
|
+
const ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);
|
|
318
|
+
heading = Math_default.negativePiToPi(heading);
|
|
319
|
+
const end = interpolateUsingSurfaceDistance(
|
|
320
|
+
start,
|
|
321
|
+
heading,
|
|
322
|
+
distance,
|
|
323
|
+
e.maximumRadius,
|
|
324
|
+
ellipticity
|
|
325
|
+
);
|
|
326
|
+
if (!defined_default(result) || defined_default(ellipsoid) && !ellipsoid.equals(result.ellipsoid)) {
|
|
327
|
+
return new EllipsoidRhumbLine(start, end, e);
|
|
328
|
+
}
|
|
329
|
+
result.setEndPoints(start, end);
|
|
330
|
+
return result;
|
|
331
|
+
};
|
|
332
|
+
EllipsoidRhumbLine.prototype.setEndPoints = function(start, end) {
|
|
333
|
+
Check_default.defined("start", start);
|
|
334
|
+
Check_default.defined("end", end);
|
|
335
|
+
computeProperties(this, start, end, this._ellipsoid);
|
|
336
|
+
};
|
|
337
|
+
EllipsoidRhumbLine.prototype.interpolateUsingFraction = function(fraction, result) {
|
|
338
|
+
return this.interpolateUsingSurfaceDistance(
|
|
339
|
+
fraction * this._distance,
|
|
340
|
+
result
|
|
341
|
+
);
|
|
342
|
+
};
|
|
343
|
+
EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function(distance, result) {
|
|
344
|
+
Check_default.typeOf.number("distance", distance);
|
|
345
|
+
if (!defined_default(this._distance) || this._distance === 0) {
|
|
346
|
+
throw new DeveloperError_default(
|
|
347
|
+
"EllipsoidRhumbLine must have distinct start and end set."
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
return interpolateUsingSurfaceDistance(
|
|
351
|
+
this._start,
|
|
352
|
+
this._heading,
|
|
353
|
+
distance,
|
|
354
|
+
this._ellipsoid.maximumRadius,
|
|
355
|
+
this._ellipticity,
|
|
356
|
+
result
|
|
357
|
+
);
|
|
358
|
+
};
|
|
359
|
+
EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function(intersectionLongitude, result) {
|
|
360
|
+
Check_default.typeOf.number("intersectionLongitude", intersectionLongitude);
|
|
361
|
+
if (!defined_default(this._distance) || this._distance === 0) {
|
|
362
|
+
throw new DeveloperError_default(
|
|
363
|
+
"EllipsoidRhumbLine must have distinct start and end set."
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
const ellipticity = this._ellipticity;
|
|
367
|
+
const heading = this._heading;
|
|
368
|
+
const absHeading = Math.abs(heading);
|
|
369
|
+
const start = this._start;
|
|
370
|
+
intersectionLongitude = Math_default.negativePiToPi(intersectionLongitude);
|
|
371
|
+
if (Math_default.equalsEpsilon(
|
|
372
|
+
Math.abs(intersectionLongitude),
|
|
373
|
+
Math.PI,
|
|
374
|
+
Math_default.EPSILON14
|
|
375
|
+
)) {
|
|
376
|
+
intersectionLongitude = Math_default.sign(start.longitude) * Math.PI;
|
|
377
|
+
}
|
|
378
|
+
if (!defined_default(result)) {
|
|
379
|
+
result = new Cartographic_default();
|
|
380
|
+
}
|
|
381
|
+
if (Math.abs(Math_default.PI_OVER_TWO - absHeading) <= Math_default.EPSILON8) {
|
|
382
|
+
result.longitude = intersectionLongitude;
|
|
383
|
+
result.latitude = start.latitude;
|
|
384
|
+
result.height = 0;
|
|
385
|
+
return result;
|
|
386
|
+
} else if (Math_default.equalsEpsilon(
|
|
387
|
+
Math.abs(Math_default.PI_OVER_TWO - absHeading),
|
|
388
|
+
Math_default.PI_OVER_TWO,
|
|
389
|
+
Math_default.EPSILON8
|
|
390
|
+
)) {
|
|
391
|
+
if (Math_default.equalsEpsilon(
|
|
392
|
+
intersectionLongitude,
|
|
393
|
+
start.longitude,
|
|
394
|
+
Math_default.EPSILON12
|
|
395
|
+
)) {
|
|
396
|
+
return void 0;
|
|
397
|
+
}
|
|
398
|
+
result.longitude = intersectionLongitude;
|
|
399
|
+
result.latitude = Math_default.PI_OVER_TWO * Math_default.sign(Math_default.PI_OVER_TWO - heading);
|
|
400
|
+
result.height = 0;
|
|
401
|
+
return result;
|
|
402
|
+
}
|
|
403
|
+
const phi1 = start.latitude;
|
|
404
|
+
const eSinPhi1 = ellipticity * Math.sin(phi1);
|
|
405
|
+
const leftComponent = Math.tan(0.5 * (Math_default.PI_OVER_TWO + phi1)) * Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));
|
|
406
|
+
const denominator = (1 + eSinPhi1) / (1 - eSinPhi1);
|
|
407
|
+
let newPhi = start.latitude;
|
|
408
|
+
let phi;
|
|
409
|
+
do {
|
|
410
|
+
phi = newPhi;
|
|
411
|
+
const eSinPhi = ellipticity * Math.sin(phi);
|
|
412
|
+
const numerator = (1 + eSinPhi) / (1 - eSinPhi);
|
|
413
|
+
newPhi = 2 * Math.atan(
|
|
414
|
+
leftComponent * Math.pow(numerator / denominator, ellipticity / 2)
|
|
415
|
+
) - Math_default.PI_OVER_TWO;
|
|
416
|
+
} while (!Math_default.equalsEpsilon(newPhi, phi, Math_default.EPSILON12));
|
|
417
|
+
result.longitude = intersectionLongitude;
|
|
418
|
+
result.latitude = newPhi;
|
|
419
|
+
result.height = 0;
|
|
420
|
+
return result;
|
|
421
|
+
};
|
|
422
|
+
EllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function(intersectionLatitude, result) {
|
|
423
|
+
Check_default.typeOf.number("intersectionLatitude", intersectionLatitude);
|
|
424
|
+
if (!defined_default(this._distance) || this._distance === 0) {
|
|
425
|
+
throw new DeveloperError_default(
|
|
426
|
+
"EllipsoidRhumbLine must have distinct start and end set."
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
const ellipticity = this._ellipticity;
|
|
430
|
+
const heading = this._heading;
|
|
431
|
+
const start = this._start;
|
|
432
|
+
if (Math_default.equalsEpsilon(
|
|
433
|
+
Math.abs(heading),
|
|
434
|
+
Math_default.PI_OVER_TWO,
|
|
435
|
+
Math_default.EPSILON8
|
|
436
|
+
)) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const sigma1 = calculateSigma(ellipticity, start.latitude);
|
|
440
|
+
const sigma2 = calculateSigma(ellipticity, intersectionLatitude);
|
|
441
|
+
const deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
|
|
442
|
+
const longitude = Math_default.negativePiToPi(start.longitude + deltaLongitude);
|
|
443
|
+
if (defined_default(result)) {
|
|
444
|
+
result.longitude = longitude;
|
|
445
|
+
result.latitude = intersectionLatitude;
|
|
446
|
+
result.height = 0;
|
|
447
|
+
return result;
|
|
448
|
+
}
|
|
449
|
+
return new Cartographic_default(longitude, intersectionLatitude, 0);
|
|
450
|
+
};
|
|
451
|
+
var EllipsoidRhumbLine_default = EllipsoidRhumbLine;
|
|
452
|
+
|
|
453
|
+
export {
|
|
454
|
+
EllipsoidRhumbLine_default
|
|
455
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.6
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
GeographicProjection_default
|
|
28
|
+
} from "./chunk-WX2ZANQC.js";
|
|
29
|
+
import {
|
|
30
|
+
Matrix2_default,
|
|
31
|
+
Rectangle_default
|
|
32
|
+
} from "./chunk-W4DV7TAL.js";
|
|
33
|
+
import {
|
|
34
|
+
Cartographic_default,
|
|
35
|
+
Ellipsoid_default
|
|
36
|
+
} from "./chunk-4DIL24GG.js";
|
|
37
|
+
import {
|
|
38
|
+
Cartesian3_default
|
|
39
|
+
} from "./chunk-GZMTBQM2.js";
|
|
40
|
+
import {
|
|
41
|
+
Math_default
|
|
42
|
+
} from "./chunk-DIA4J2DB.js";
|
|
43
|
+
import {
|
|
44
|
+
DeveloperError_default
|
|
45
|
+
} from "./chunk-SZELHE7Q.js";
|
|
46
|
+
import {
|
|
47
|
+
defined_default
|
|
48
|
+
} from "./chunk-OBM2JYMG.js";
|
|
49
|
+
|
|
50
|
+
// packages/engine/Source/Core/RectangleGeometryLibrary.js
|
|
51
|
+
var cos = Math.cos;
|
|
52
|
+
var sin = Math.sin;
|
|
53
|
+
var sqrt = Math.sqrt;
|
|
54
|
+
var RectangleGeometryLibrary = {};
|
|
55
|
+
RectangleGeometryLibrary.computePosition = function(computedOptions, ellipsoid, computeST, row, col, position, st) {
|
|
56
|
+
const radiiSquared = ellipsoid.radiiSquared;
|
|
57
|
+
const nwCorner = computedOptions.nwCorner;
|
|
58
|
+
const rectangle = computedOptions.boundingRectangle;
|
|
59
|
+
let stLatitude = nwCorner.latitude - computedOptions.granYCos * row + col * computedOptions.granXSin;
|
|
60
|
+
const cosLatitude = cos(stLatitude);
|
|
61
|
+
const nZ = sin(stLatitude);
|
|
62
|
+
const kZ = radiiSquared.z * nZ;
|
|
63
|
+
let stLongitude = nwCorner.longitude + row * computedOptions.granYSin + col * computedOptions.granXCos;
|
|
64
|
+
const nX = cosLatitude * cos(stLongitude);
|
|
65
|
+
const nY = cosLatitude * sin(stLongitude);
|
|
66
|
+
const kX = radiiSquared.x * nX;
|
|
67
|
+
const kY = radiiSquared.y * nY;
|
|
68
|
+
const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
|
|
69
|
+
position.x = kX / gamma;
|
|
70
|
+
position.y = kY / gamma;
|
|
71
|
+
position.z = kZ / gamma;
|
|
72
|
+
if (computeST) {
|
|
73
|
+
const stNwCorner = computedOptions.stNwCorner;
|
|
74
|
+
if (defined_default(stNwCorner)) {
|
|
75
|
+
stLatitude = stNwCorner.latitude - computedOptions.stGranYCos * row + col * computedOptions.stGranXSin;
|
|
76
|
+
stLongitude = stNwCorner.longitude + row * computedOptions.stGranYSin + col * computedOptions.stGranXCos;
|
|
77
|
+
st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;
|
|
78
|
+
st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;
|
|
79
|
+
} else {
|
|
80
|
+
st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;
|
|
81
|
+
st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var rotationMatrixScratch = new Matrix2_default();
|
|
86
|
+
var nwCartesian = new Cartesian3_default();
|
|
87
|
+
var centerScratch = new Cartographic_default();
|
|
88
|
+
var centerCartesian = new Cartesian3_default();
|
|
89
|
+
var proj = new GeographicProjection_default();
|
|
90
|
+
function getRotationOptions(nwCorner, rotation, granularityX, granularityY, center, width, height) {
|
|
91
|
+
const cosRotation = Math.cos(rotation);
|
|
92
|
+
const granYCos = granularityY * cosRotation;
|
|
93
|
+
const granXCos = granularityX * cosRotation;
|
|
94
|
+
const sinRotation = Math.sin(rotation);
|
|
95
|
+
const granYSin = granularityY * sinRotation;
|
|
96
|
+
const granXSin = granularityX * sinRotation;
|
|
97
|
+
proj._ellipsoid = Ellipsoid_default.default;
|
|
98
|
+
nwCartesian = proj.project(nwCorner, nwCartesian);
|
|
99
|
+
nwCartesian = Cartesian3_default.subtract(nwCartesian, centerCartesian, nwCartesian);
|
|
100
|
+
const rotationMatrix = Matrix2_default.fromRotation(rotation, rotationMatrixScratch);
|
|
101
|
+
nwCartesian = Matrix2_default.multiplyByVector(
|
|
102
|
+
rotationMatrix,
|
|
103
|
+
nwCartesian,
|
|
104
|
+
nwCartesian
|
|
105
|
+
);
|
|
106
|
+
nwCartesian = Cartesian3_default.add(nwCartesian, centerCartesian, nwCartesian);
|
|
107
|
+
nwCorner = proj.unproject(nwCartesian, nwCorner);
|
|
108
|
+
width -= 1;
|
|
109
|
+
height -= 1;
|
|
110
|
+
const latitude = nwCorner.latitude;
|
|
111
|
+
const latitude0 = latitude + width * granXSin;
|
|
112
|
+
const latitude1 = latitude - granYCos * height;
|
|
113
|
+
const latitude2 = latitude - granYCos * height + width * granXSin;
|
|
114
|
+
const north = Math.max(latitude, latitude0, latitude1, latitude2);
|
|
115
|
+
const south = Math.min(latitude, latitude0, latitude1, latitude2);
|
|
116
|
+
const longitude = nwCorner.longitude;
|
|
117
|
+
const longitude0 = longitude + width * granXCos;
|
|
118
|
+
const longitude1 = longitude + height * granYSin;
|
|
119
|
+
const longitude2 = longitude + height * granYSin + width * granXCos;
|
|
120
|
+
const east = Math.max(longitude, longitude0, longitude1, longitude2);
|
|
121
|
+
const west = Math.min(longitude, longitude0, longitude1, longitude2);
|
|
122
|
+
return {
|
|
123
|
+
north,
|
|
124
|
+
south,
|
|
125
|
+
east,
|
|
126
|
+
west,
|
|
127
|
+
granYCos,
|
|
128
|
+
granYSin,
|
|
129
|
+
granXCos,
|
|
130
|
+
granXSin,
|
|
131
|
+
nwCorner
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
RectangleGeometryLibrary.computeOptions = function(rectangle, granularity, rotation, stRotation, boundingRectangleScratch, nwCornerResult, stNwCornerResult) {
|
|
135
|
+
let east = rectangle.east;
|
|
136
|
+
let west = rectangle.west;
|
|
137
|
+
let north = rectangle.north;
|
|
138
|
+
let south = rectangle.south;
|
|
139
|
+
let northCap = false;
|
|
140
|
+
let southCap = false;
|
|
141
|
+
if (north === Math_default.PI_OVER_TWO) {
|
|
142
|
+
northCap = true;
|
|
143
|
+
}
|
|
144
|
+
if (south === -Math_default.PI_OVER_TWO) {
|
|
145
|
+
southCap = true;
|
|
146
|
+
}
|
|
147
|
+
let dx;
|
|
148
|
+
const dy = north - south;
|
|
149
|
+
if (west > east) {
|
|
150
|
+
dx = Math_default.TWO_PI - west + east;
|
|
151
|
+
} else {
|
|
152
|
+
dx = east - west;
|
|
153
|
+
}
|
|
154
|
+
const width = Math.ceil(dx / granularity) + 1;
|
|
155
|
+
const height = Math.ceil(dy / granularity) + 1;
|
|
156
|
+
const granularityX = dx / (width - 1);
|
|
157
|
+
const granularityY = dy / (height - 1);
|
|
158
|
+
const nwCorner = Rectangle_default.northwest(rectangle, nwCornerResult);
|
|
159
|
+
const center = Rectangle_default.center(rectangle, centerScratch);
|
|
160
|
+
if (rotation !== 0 || stRotation !== 0) {
|
|
161
|
+
if (center.longitude < nwCorner.longitude) {
|
|
162
|
+
center.longitude += Math_default.TWO_PI;
|
|
163
|
+
}
|
|
164
|
+
proj._ellipsoid = Ellipsoid_default.default;
|
|
165
|
+
centerCartesian = proj.project(center, centerCartesian);
|
|
166
|
+
}
|
|
167
|
+
const granYCos = granularityY;
|
|
168
|
+
const granXCos = granularityX;
|
|
169
|
+
const granYSin = 0;
|
|
170
|
+
const granXSin = 0;
|
|
171
|
+
const boundingRectangle = Rectangle_default.clone(
|
|
172
|
+
rectangle,
|
|
173
|
+
boundingRectangleScratch
|
|
174
|
+
);
|
|
175
|
+
const computedOptions = {
|
|
176
|
+
granYCos,
|
|
177
|
+
granYSin,
|
|
178
|
+
granXCos,
|
|
179
|
+
granXSin,
|
|
180
|
+
nwCorner,
|
|
181
|
+
boundingRectangle,
|
|
182
|
+
width,
|
|
183
|
+
height,
|
|
184
|
+
northCap,
|
|
185
|
+
southCap
|
|
186
|
+
};
|
|
187
|
+
if (rotation !== 0) {
|
|
188
|
+
const rotationOptions = getRotationOptions(
|
|
189
|
+
nwCorner,
|
|
190
|
+
rotation,
|
|
191
|
+
granularityX,
|
|
192
|
+
granularityY,
|
|
193
|
+
center,
|
|
194
|
+
width,
|
|
195
|
+
height
|
|
196
|
+
);
|
|
197
|
+
north = rotationOptions.north;
|
|
198
|
+
south = rotationOptions.south;
|
|
199
|
+
east = rotationOptions.east;
|
|
200
|
+
west = rotationOptions.west;
|
|
201
|
+
if (north < -Math_default.PI_OVER_TWO || north > Math_default.PI_OVER_TWO || south < -Math_default.PI_OVER_TWO || south > Math_default.PI_OVER_TWO) {
|
|
202
|
+
throw new DeveloperError_default(
|
|
203
|
+
"Rotated rectangle is invalid. It crosses over either the north or south pole."
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
computedOptions.granYCos = rotationOptions.granYCos;
|
|
207
|
+
computedOptions.granYSin = rotationOptions.granYSin;
|
|
208
|
+
computedOptions.granXCos = rotationOptions.granXCos;
|
|
209
|
+
computedOptions.granXSin = rotationOptions.granXSin;
|
|
210
|
+
boundingRectangle.north = north;
|
|
211
|
+
boundingRectangle.south = south;
|
|
212
|
+
boundingRectangle.east = east;
|
|
213
|
+
boundingRectangle.west = west;
|
|
214
|
+
}
|
|
215
|
+
if (stRotation !== 0) {
|
|
216
|
+
rotation = rotation - stRotation;
|
|
217
|
+
const stNwCorner = Rectangle_default.northwest(boundingRectangle, stNwCornerResult);
|
|
218
|
+
const stRotationOptions = getRotationOptions(
|
|
219
|
+
stNwCorner,
|
|
220
|
+
rotation,
|
|
221
|
+
granularityX,
|
|
222
|
+
granularityY,
|
|
223
|
+
center,
|
|
224
|
+
width,
|
|
225
|
+
height
|
|
226
|
+
);
|
|
227
|
+
computedOptions.stGranYCos = stRotationOptions.granYCos;
|
|
228
|
+
computedOptions.stGranXCos = stRotationOptions.granXCos;
|
|
229
|
+
computedOptions.stGranYSin = stRotationOptions.granYSin;
|
|
230
|
+
computedOptions.stGranXSin = stRotationOptions.granXSin;
|
|
231
|
+
computedOptions.stNwCorner = stNwCorner;
|
|
232
|
+
computedOptions.stWest = stRotationOptions.west;
|
|
233
|
+
computedOptions.stSouth = stRotationOptions.south;
|
|
234
|
+
}
|
|
235
|
+
return computedOptions;
|
|
236
|
+
};
|
|
237
|
+
var RectangleGeometryLibrary_default = RectangleGeometryLibrary;
|
|
238
|
+
|
|
239
|
+
export {
|
|
240
|
+
RectangleGeometryLibrary_default
|
|
241
|
+
};
|