@rtzh/engine 0.0.2 → 0.0.3

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.
Files changed (113) hide show
  1. package/Source/Scene/GltfLoader.js +2 -2
  2. package/package.json +1 -1
  3. package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
  4. package/Build/Workers/chunk-245NZYCR.js +0 -124
  5. package/Build/Workers/chunk-25BA4527.js +0 -837
  6. package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
  7. package/Build/Workers/chunk-4Z26IS65.js +0 -3514
  8. package/Build/Workers/chunk-55IROWAX.js +0 -139
  9. package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
  10. package/Build/Workers/chunk-5VZISKJF.js +0 -629
  11. package/Build/Workers/chunk-5WAG5YKS.js +0 -368
  12. package/Build/Workers/chunk-66YGZWBI.js +0 -1317
  13. package/Build/Workers/chunk-6H33B6OL.js +0 -37
  14. package/Build/Workers/chunk-6LZBBEA7.js +0 -439
  15. package/Build/Workers/chunk-6XJO625E.js +0 -497
  16. package/Build/Workers/chunk-75UGCVME.js +0 -102
  17. package/Build/Workers/chunk-7B23DD46.js +0 -1054
  18. package/Build/Workers/chunk-7NCJH26L.js +0 -352
  19. package/Build/Workers/chunk-AIW5F22O.js +0 -352
  20. package/Build/Workers/chunk-AL22JVIA.js +0 -256
  21. package/Build/Workers/chunk-AVSQILVI.js +0 -75
  22. package/Build/Workers/chunk-B2VFNYD7.js +0 -280
  23. package/Build/Workers/chunk-BOV6T7FO.js +0 -44
  24. package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
  25. package/Build/Workers/chunk-EDIUN7V3.js +0 -219
  26. package/Build/Workers/chunk-EKMWNF4U.js +0 -55
  27. package/Build/Workers/chunk-ELXGXAYS.js +0 -682
  28. package/Build/Workers/chunk-FVYRV2T6.js +0 -455
  29. package/Build/Workers/chunk-GDIBU55R.js +0 -778
  30. package/Build/Workers/chunk-HAY6YE7M.js +0 -97
  31. package/Build/Workers/chunk-I76SRIKN.js +0 -138
  32. package/Build/Workers/chunk-IELTSYPZ.js +0 -241
  33. package/Build/Workers/chunk-J4MIJCN5.js +0 -171
  34. package/Build/Workers/chunk-JFO3ELF3.js +0 -642
  35. package/Build/Workers/chunk-K4IMD7KH.js +0 -162
  36. package/Build/Workers/chunk-KFMCOG26.js +0 -692
  37. package/Build/Workers/chunk-KH2OWUUA.js +0 -163
  38. package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
  39. package/Build/Workers/chunk-KVE5EAPO.js +0 -398
  40. package/Build/Workers/chunk-OAOREOSO.js +0 -940
  41. package/Build/Workers/chunk-OFJRMGNX.js +0 -788
  42. package/Build/Workers/chunk-PLLZB3R4.js +0 -198
  43. package/Build/Workers/chunk-POY6ZE32.js +0 -2058
  44. package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
  45. package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
  46. package/Build/Workers/chunk-QWV2DM66.js +0 -1443
  47. package/Build/Workers/chunk-R73BHGGI.js +0 -305
  48. package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
  49. package/Build/Workers/chunk-SBFTVHRW.js +0 -57
  50. package/Build/Workers/chunk-SOR7PD4V.js +0 -114
  51. package/Build/Workers/chunk-TO7TWUET.js +0 -476
  52. package/Build/Workers/chunk-TSAJNE4K.js +0 -101
  53. package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
  54. package/Build/Workers/chunk-UTWLMOPM.js +0 -387
  55. package/Build/Workers/chunk-UYT2PBMV.js +0 -58
  56. package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
  57. package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
  58. package/Build/Workers/chunk-X65Y2JSA.js +0 -55
  59. package/Build/Workers/chunk-XOVHLPKW.js +0 -299
  60. package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
  61. package/Build/Workers/combineGeometry.js +0 -66
  62. package/Build/Workers/createBoxGeometry.js +0 -58
  63. package/Build/Workers/createBoxOutlineGeometry.js +0 -231
  64. package/Build/Workers/createCircleGeometry.js +0 -201
  65. package/Build/Workers/createCircleOutlineGeometry.js +0 -147
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
  68. package/Build/Workers/createCorridorGeometry.js +0 -1258
  69. package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
  70. package/Build/Workers/createCylinderGeometry.js +0 -60
  71. package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
  72. package/Build/Workers/createEllipseGeometry.js +0 -72
  73. package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
  74. package/Build/Workers/createEllipsoidGeometry.js +0 -59
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
  76. package/Build/Workers/createFrustumGeometry.js +0 -58
  77. package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
  78. package/Build/Workers/createGeometry.js +0 -173
  79. package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
  80. package/Build/Workers/createPlaneGeometry.js +0 -223
  81. package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
  82. package/Build/Workers/createPolygonGeometry.js +0 -1404
  83. package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
  84. package/Build/Workers/createPolylineGeometry.js +0 -491
  85. package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
  87. package/Build/Workers/createRectangleGeometry.js +0 -1264
  88. package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
  89. package/Build/Workers/createSimplePolylineGeometry.js +0 -397
  90. package/Build/Workers/createSphereGeometry.js +0 -116
  91. package/Build/Workers/createSphereOutlineGeometry.js +0 -116
  92. package/Build/Workers/createTaskProcessorWorker.js +0 -32
  93. package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
  94. package/Build/Workers/createVectorTileGeometries.js +0 -387
  95. package/Build/Workers/createVectorTilePoints.js +0 -114
  96. package/Build/Workers/createVectorTilePolygons.js +0 -386
  97. package/Build/Workers/createVectorTilePolylines.js +0 -262
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
  100. package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
  102. package/Build/Workers/createWallGeometry.js +0 -487
  103. package/Build/Workers/createWallOutlineGeometry.js +0 -335
  104. package/Build/Workers/decodeDraco.js +0 -369
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
  106. package/Build/Workers/decodeI3S.js +0 -1339
  107. package/Build/Workers/gaussianSplatSorter.js +0 -62
  108. package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
  109. package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
  110. package/Build/Workers/transcodeKTX2.js +0 -3463
  111. package/Build/Workers/transferTypedArrayTest.js +0 -41
  112. package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
  113. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
@@ -1,455 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
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-YPGJSFOO.js";
30
- import {
31
- Cartesian3_default
32
- } from "./chunk-QWV2DM66.js";
33
- import {
34
- Math_default
35
- } from "./chunk-6XJO625E.js";
36
- import {
37
- Check_default,
38
- DeveloperError_default
39
- } from "./chunk-KH2OWUUA.js";
40
- import {
41
- defined_default
42
- } from "./chunk-AVSQILVI.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
- };