qd-changjing/public/static/Build/CesiumUnminified/Workers/EllipsoidGeodesic-ed024f16....

1 line
29 KiB
Plaintext
Raw Normal View History

2022-07-05 16:56:29 +08:00
{"version":3,"file":"EllipsoidGeodesic-ed024f16.js","sources":["../../../../Source/Core/EllipsoidGeodesic.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction setConstants(ellipsoidGeodesic) {\n const uSquared = ellipsoidGeodesic._uSquared;\n const a = ellipsoidGeodesic._ellipsoid.maximumRadius;\n const b = ellipsoidGeodesic._ellipsoid.minimumRadius;\n const f = (a - b) / a;\n\n const cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);\n const sineHeading = Math.sin(ellipsoidGeodesic._startHeading);\n\n const tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);\n\n const cosineU = 1.0 / Math.sqrt(1.0 + tanU * tanU);\n const sineU = cosineU * tanU;\n\n const sigma = Math.atan2(tanU, cosineHeading);\n\n const sineAlpha = cosineU * sineHeading;\n const sineSquaredAlpha = sineAlpha * sineAlpha;\n\n const cosineSquaredAlpha = 1.0 - sineSquaredAlpha;\n const cosineAlpha = Math.sqrt(cosineSquaredAlpha);\n\n const u2Over4 = uSquared / 4.0;\n const u4Over16 = u2Over4 * u2Over4;\n const u6Over64 = u4Over16 * u2Over4;\n const u8Over256 = u4Over16 * u4Over16;\n\n const a0 =\n 1.0 +\n u2Over4 -\n (3.0 * u4Over16) / 4.0 +\n (5.0 * u6Over64) / 4.0 -\n (175.0 * u8Over256) / 64.0;\n const a1 = 1.0 - u2Over4 + (15.0 * u4Over16) / 8.0 - (35.0 * u6Over64) / 8.0;\n const a2 = 1.0 - 3.0 * u2Over4 + (35.0 * u4Over16) / 4.0;\n const a3 = 1.0 - 5.0 * u2Over4;\n\n const distanceRatio =\n a0 * sigma -\n (a1 * Math.sin(2.0 * sigma) * u2Over4) / 2.0 -\n (a2 * Math.sin(4.0 * sigma) * u4Over16) / 16.0 -\n (a3 * Math.sin(6.0 * sigma) * u6Over64) / 48.0 -\n (Math.sin(8.0 * sigma) * 5.0 * u8Over256) / 512;\n\n const constants = ellipsoidGeodesic._constants;\n\n constants.a = a;\n constants.b = b;\n constants.f = f;\n constants.cosineHeading = cosineHeading;\n constants.sineHeading = sineHeading;\n constants.tanU = tanU;\n constants.cosineU = cosineU;\n constants.sineU = sineU;\n constants.sigma = sigma;\n constants.sineAlpha = sineAlpha;\n constants.sineSquaredAlpha = sineSquaredAlpha;\n constants.cosineSquaredAlpha = cosineSquaredAlpha;\n constants.cosineAlpha = cosineAlpha;\n constants.u2Over4 = u2Over4;\n constants.u4Over16 = u4Over16;\n constants.u6Over64 = u6Over64;\n constants.u8Over256 = u8Over256;\n constants.a0 = a0;\n constants.a1 = a1;\n constants.a2 = a2;\n constants.a3 = a3;\n constants.distanceRatio = distanceRatio;\n}\n\nfunction computeC(f, cosineSquaredAlpha) {\n return (\n (f * cosineSquaredAlpha * (4.0 + f * (4.0 - 3.0 * cosineSquaredAlpha))) /\n 16.0\n );\n}\n\nfunction computeDeltaLambda(\n f,\n sineAlpha,\n cosineSquaredAlpha,\n sigma,\n sineSigma,\n cosineSigma,\n cosineTwiceSigmaMidpoint\n) {\n const C = computeC(f, cosineSquaredAlpha);\n\n return (\n (1.0 - C) *\n f *\n sineAlpha *\n (sigma +\n C *\n sineSigma *\n (cosineTwiceSigmaMidpoint +\n C *\n cosineSigma *\n (2.0 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1.0)))\n );\n}\n\nfunction vincentyInverseFormula(\n ellipsoidGeodesic,\n major,\n minor,\n firstLongitude,\n firstLatitude,\n secondLongitude,\n secondLatitude\n) {\n const eff = (major - minor) / major;\n const l = secondLongitude - firstLongitude;\n\n const u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));\n const u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));\n\n const cosineU1 = Math.cos(u1);\n const sineU1 = Math.sin(u1);\n const cosineU2 = Math.cos(u2);\n const sineU2 = Math.sin(u2);\n\n const cc = cosineU1 * cosineU2;\n const cs = cosineU1 * sineU2;\n const ss = sineU1 * sineU2;\n const sc = sineU1 * cosineU2;\n\n let lambda = l;\n let lambdaDot = CesiumMath.TWO_PI;\n\n let cosineLambda = Math.cos(lambda);\n let sineLambda