@pirireis/webglobeplugins 0.9.10 → 0.9.11

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 (166) hide show
  1. package/Math/angle-calculation.js +8 -8
  2. package/Math/arc.js +18 -18
  3. package/Math/bounds/line-bbox.js +80 -78
  4. package/Math/constants.js +3 -3
  5. package/Math/juction/arc-plane.js +23 -23
  6. package/Math/juction/line-sphere.js +11 -11
  7. package/Math/juction/plane-plane.js +11 -11
  8. package/Math/line.js +16 -14
  9. package/Math/methods.js +72 -67
  10. package/Math/plane.js +18 -16
  11. package/Math/quaternion.js +49 -45
  12. package/Math/utils.js +2 -2
  13. package/Math/vec3.js +45 -42
  14. package/algorithms/search-binary.js +4 -4
  15. package/altitude-locator/draw-subset-obj.js +8 -7
  16. package/altitude-locator/plugin.js +113 -97
  17. package/arrowfield/adaptor.js +4 -3
  18. package/arrowfield/index.js +2 -2
  19. package/arrowfield/plugin.js +65 -62
  20. package/bearing-line/index.js +1 -1
  21. package/bearing-line/plugin.js +225 -200
  22. package/circle-line-chain/chain-list-map.js +88 -82
  23. package/circle-line-chain/plugin.js +154 -129
  24. package/circle-line-chain/util.js +1 -1
  25. package/compass-rose/compass-rose-padding-flat.js +126 -104
  26. package/compass-rose/compass-text-writer.js +70 -62
  27. package/compass-rose/index.js +2 -2
  28. package/compassrose/compassrose.js +50 -46
  29. package/compassrose/index.js +1 -1
  30. package/heatwave/index.js +2 -2
  31. package/heatwave/isobar/objectarraylabels.js +48 -44
  32. package/heatwave/isobar/plugin.js +123 -104
  33. package/heatwave/isobar/quadtreecontours.js +92 -76
  34. package/heatwave/plugins/heatwaveglobeshell.js +87 -69
  35. package/index.js +11 -11
  36. package/package.json +1 -1
  37. package/partialrings/buffer-manager.js +64 -32
  38. package/partialrings/index.js +1 -1
  39. package/partialrings/plugin.js +84 -48
  40. package/partialrings/program.js +47 -136
  41. package/pin/pin-object-array.js +86 -83
  42. package/pin/pin-point-totem.js +22 -21
  43. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
  44. package/point-heat-map/plugin-webworker.js +45 -40
  45. package/point-heat-map/point-to-heat-map-flow.js +42 -40
  46. package/point-tracks/key-methods.js +1 -1
  47. package/point-tracks/plugin.js +142 -127
  48. package/programs/arrowfield/index.js +1 -1
  49. package/programs/arrowfield/logic.js +62 -170
  50. package/programs/arrowfield/object.js +35 -33
  51. package/programs/data2legend/density-to-legend.js +21 -45
  52. package/programs/data2legend/point-to-density-texture.js +27 -52
  53. package/programs/float2legendwithratio/index.js +1 -1
  54. package/programs/float2legendwithratio/logic.js +42 -88
  55. package/programs/float2legendwithratio/object.js +46 -43
  56. package/programs/globe-util/is-globe-moved.js +11 -10
  57. package/programs/globeshell/index.js +1 -1
  58. package/programs/globeshell/wiggle/index.js +1 -1
  59. package/programs/globeshell/wiggle/logic.js +98 -191
  60. package/programs/globeshell/wiggle/object.js +35 -33
  61. package/programs/helpers/blender/program.js +19 -36
  62. package/programs/helpers/fadeaway/index.js +1 -1
  63. package/programs/helpers/fadeaway/logic.js +13 -35
  64. package/programs/helpers/fadeaway/object.js +10 -9
  65. package/programs/helpers/index.js +1 -1
  66. package/programs/index.js +8 -8
  67. package/programs/line-on-globe/angled-line.js +32 -91
  68. package/programs/line-on-globe/circle-accurate-3d.js +32 -82
  69. package/programs/line-on-globe/circle-accurate-flat.js +50 -108
  70. package/programs/line-on-globe/circle-accurate.js +33 -103
  71. package/programs/line-on-globe/circle.js +32 -97
  72. package/programs/line-on-globe/degree-padding-around-circle-3d.js +33 -83
  73. package/programs/line-on-globe/lines-color-instanced-flat.js +34 -79
  74. package/programs/line-on-globe/linestrip.js +39 -100
  75. package/programs/line-on-globe/naive-accurate-flexible.js +48 -118
  76. package/programs/line-on-globe/to-the-surface.js +29 -58
  77. package/programs/line-on-globe/util.js +1 -1
  78. package/programs/picking/pickable-renderer.js +33 -117
  79. package/programs/point-on-globe/element-globe-surface-glow.js +38 -78
  80. package/programs/point-on-globe/element-point-glow.js +35 -103
  81. package/programs/point-on-globe/square-pixel-point.js +27 -76
  82. package/programs/programcache.js +13 -13
  83. package/programs/rings/distancering/circleflatprogram.js +21 -63
  84. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +145 -156
  85. package/programs/rings/distancering/circlepaddysharedbuffer.js +197 -121
  86. package/programs/rings/distancering/index.js +4 -4
  87. package/programs/rings/distancering/paddyflatprogram.js +20 -73
  88. package/programs/rings/distancering/paddyflatprogram2d.js +22 -75
  89. package/programs/rings/distancering/paddyflatprogram3d.js +20 -73
  90. package/programs/rings/partial-ring/piece-of-pie.js +35 -137
  91. package/programs/totems/camerauniformblock.js +51 -64
  92. package/programs/totems/canvas-webglobe-info.js +40 -48
  93. package/programs/totems/gpu-selection-uniform-block.js +40 -44
  94. package/programs/totems/index.js +1 -1
  95. package/programs/two-d/pixel-padding-for-compass.js +29 -90
  96. package/programs/util.js +7 -6
  97. package/programs/vectorfields/index.js +1 -1
  98. package/programs/vectorfields/logics/drawrectangleparticles.js +29 -70
  99. package/programs/vectorfields/logics/index.js +3 -3
  100. package/programs/vectorfields/logics/pixelbased.js +35 -91
  101. package/programs/vectorfields/logics/ubo.js +25 -31
  102. package/programs/vectorfields/pingpongbuffermanager.js +34 -30
  103. package/rangerings/index.js +4 -4
  104. package/rangerings/plugin.js +252 -202
  105. package/rangerings/rangeringangletext.js +120 -108
  106. package/rangerings/ring-account.js +69 -52
  107. package/shaders/fragment-toy/firework.js +1 -55
  108. package/shaders/fragment-toy/singularity.js +1 -55
  109. package/timetracks/adaptors-line-strip.js +37 -26
  110. package/timetracks/adaptors.js +61 -47
  111. package/timetracks/index.js +4 -4
  112. package/timetracks/plugin-line-strip.js +63 -59
  113. package/timetracks/plugin.js +69 -65
  114. package/timetracks/program-line-strip.js +103 -296
  115. package/timetracks/program.js +113 -419
  116. package/timetracks/programpoint-line-strip.js +44 -97
  117. package/timetracks/programpoint.js +44 -90
  118. package/util/account/bufferoffsetmanager.js +95 -72
  119. package/util/account/index.js +1 -1
  120. package/util/account/single-attribute-buffer-management/buffer-manager.js +43 -39
  121. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +94 -64
  122. package/util/account/single-attribute-buffer-management/index.js +3 -3
  123. package/util/account/single-attribute-buffer-management/object-store.js +30 -28
  124. package/util/account/util.js +4 -2
  125. package/util/algorithms/search-binary.js +4 -4
  126. package/util/check/get.js +5 -5
  127. package/util/check/typecheck.js +15 -13
  128. package/util/geometry/index.js +11 -9
  129. package/util/gl-util/buffer/attribute-loader.js +20 -8
  130. package/util/gl-util/buffer/index.js +1 -1
  131. package/util/gl-util/draw-options/methods.js +7 -7
  132. package/util/gl-util/uniform-block/manager.js +67 -55
  133. package/util/heatwavedatamanager/datamanager.js +116 -56
  134. package/util/heatwavedatamanager/index.js +2 -2
  135. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +40 -37
  136. package/util/heatwavedatamanager/pointcoordsmeta.js +10 -9
  137. package/util/index.js +6 -6
  138. package/util/interpolation/timetrack/index.js +1 -1
  139. package/util/interpolation/timetrack/timetrack-interpolator.js +29 -27
  140. package/util/interpolation/timetrack/web-worker-str.js +1 -179
  141. package/util/interpolation/timetrack/web-worker.js +4 -4
  142. package/util/jshelpers/data-filler.js +7 -7
  143. package/util/jshelpers/timefilters.js +7 -7
  144. package/util/picking/fence.js +7 -7
  145. package/util/picking/picker-displayer.js +52 -46
  146. package/util/programs/draw-texture-on-canvas.js +21 -39
  147. package/util/programs/shapesonglobe.js +64 -104
  148. package/util/programs/supersampletotextures.js +39 -45
  149. package/util/programs/texturetoglobe.js +48 -98
  150. package/util/shaderfunctions/geometrytransformations.js +27 -322
  151. package/util/shaderfunctions/nodata.js +1 -7
  152. package/util/shaderfunctions/noisefunctions.js +9 -39
  153. package/util/surface-line-data/arcs-to-cuts.js +23 -20
  154. package/util/webglobe/rasteroverlay.js +37 -35
  155. package/util/webglobjectbuilders.js +60 -55
  156. package/util/webglobjectbuilders1.js +49 -48
  157. package/waveparticles/adaptor.js +7 -6
  158. package/waveparticles/index.js +2 -2
  159. package/waveparticles/plugin.js +84 -79
  160. package/wind/imagetovectorfieldandmagnitude.js +15 -15
  161. package/wind/index.js +4 -4
  162. package/wind/plugin.js +251 -453
  163. package/wind/vectorfieldimage.js +5 -5
  164. package/write-text/attached-text-writer.js +48 -46
  165. package/write-text/context-text.js +58 -51
  166. package/write-text/context-text3.js +74 -69
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bearingRealAngle = bearingRealAngle;
4
4
  function bearingRealAngle(long, lat, endLong, endLat) {
5
- const rLong = Radians * long;
6
- const rLat = Radians * lat;
7
- const rEndLong = Radians * endLong;
8
- const rEndLat = Radians * endLat;
9
- const delta_long = rEndLong - rLong;
10
- const x = Math.sin(delta_long) * Math.cos(rEndLat);
11
- const y = Math.cos(rLat) * Math.sin(rEndLat) - Math.sin(rLat) * Math.cos(rEndLat) * Math.cos(delta_long);
12
- let initialBearing = Math.atan2(x, y) / Radians;
5
+ var rLong = Radians * long;
6
+ var rLat = Radians * lat;
7
+ var rEndLong = Radians * endLong;
8
+ var rEndLat = Radians * endLat;
9
+ var delta_long = rEndLong - rLong;
10
+ var x = Math.sin(delta_long) * Math.cos(rEndLat);
11
+ var y = Math.cos(rLat) * Math.sin(rEndLat) - Math.sin(rLat) * Math.cos(rEndLat) * Math.cos(delta_long);
12
+ var initialBearing = Math.atan2(x, y) / Radians;
13
13
  initialBearing = (initialBearing + 360) % 360;
14
14
  return initialBearing;
15
15
  }
package/Math/arc.js CHANGED
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.arc = void 0;
4
- const vec3_1 = require("./vec3");
5
- const constants_1 = require("./constants");
6
- const _0vector = /*@__PURE__*/ vec3_1.vec3.create(0, 0, 0);
7
- const _1vector = /*@__PURE__*/ vec3_1.vec3.create(1, 1, 1);
4
+ var vec3_1 = require("./vec3");
5
+ var constants_1 = require("./constants");
6
+ var _0vector = /*@__PURE__*/ vec3_1.vec3.create(0, 0, 0);
7
+ var _1vector = /*@__PURE__*/ vec3_1.vec3.create(1, 1, 1);
8
8
  exports.arc = Object.freeze({
9
- create(p0, p1) {
10
- const normal = vec3_1.vec3.create(0, 0, 0);
9
+ create: function (p0, p1) {
10
+ var normal = vec3_1.vec3.create(0, 0, 0);
11
11
  vec3_1.vec3.cross(normal, p0, p1);
12
- const coverPlaneNormal = [p0[0] + p1[0], p0[1] + p1[1], p0[2] + p1[2]];
12
+ var coverPlaneNormal = [p0[0] + p1[0], p0[1] + p1[1], p0[2] + p1[2]];
13
13
  vec3_1.vec3.normalize(coverPlaneNormal, coverPlaneNormal);
14
- const dot = vec3_1.vec3.dot(coverPlaneNormal, p0);
14
+ var dot = vec3_1.vec3.dot(coverPlaneNormal, p0);
15
15
  return {
16
16
  p0: vec3_1.vec3.clone(p0),
17
17
  p1: vec3_1.vec3.clone(p1),
@@ -22,23 +22,23 @@ exports.arc = Object.freeze({
22
22
  }
23
23
  };
24
24
  },
25
- set(out, p0, p1) {
25
+ set: function (out, p0, p1) {
26
26
  vec3_1.vec3.copy(out.p0, p0);
27
27
  vec3_1.vec3.copy(out.p1, p1);
28
28
  vec3_1.vec3.cross(out.normal, p0, p1);
29
- const coverPlaneNormal = [p0[0] + p1[0], p0[1] + p1[1], p0[2] + p1[2]];
29
+ var coverPlaneNormal = [p0[0] + p1[0], p0[1] + p1[1], p0[2] + p1[2]];
30
30
  vec3_1.vec3.normalize(coverPlaneNormal, coverPlaneNormal);
31
31
  out.coverPlane.normal = coverPlaneNormal;
32
32
  out.coverPlane.distance = vec3_1.vec3.dot(coverPlaneNormal, p0);
33
33
  },
34
- copy(out, a) {
34
+ copy: function (out, a) {
35
35
  vec3_1.vec3.copy(out.p0, a.p0);
36
36
  vec3_1.vec3.copy(out.p1, a.p1);
37
37
  vec3_1.vec3.copy(out.normal, a.normal);
38
38
  out.coverPlane.normal = vec3_1.vec3.clone(a.coverPlane.normal);
39
39
  out.coverPlane.distance = a.coverPlane.distance;
40
40
  },
41
- clone(a) {
41
+ clone: function (a) {
42
42
  return {
43
43
  p0: vec3_1.vec3.clone(a.p0),
44
44
  p1: vec3_1.vec3.clone(a.p1),
@@ -49,16 +49,16 @@ exports.arc = Object.freeze({
49
49
  }
50
50
  };
51
51
  },
52
- isPointOn(arc, point) {
53
- const alignment = Math.abs(vec3_1.vec3.dot(point, arc.normal)) < constants_1.EPSILON;
54
- const distance = Math.abs(vec3_1.vec3.lengthSquared(point) - 1) < constants_1.EPSILON;
55
- const cover = vec3_1.vec3.dot(arc.coverPlane.normal, point) >= arc.coverPlane.distance;
52
+ isPointOn: function (arc, point) {
53
+ var alignment = Math.abs(vec3_1.vec3.dot(point, arc.normal)) < constants_1.EPSILON;
54
+ var distance = Math.abs(vec3_1.vec3.lengthSquared(point) - 1) < constants_1.EPSILON;
55
+ var cover = vec3_1.vec3.dot(arc.coverPlane.normal, point) >= arc.coverPlane.distance;
56
56
  return alignment || distance || cover;
57
57
  },
58
- equals(a, b) {
58
+ equals: function (a, b) {
59
59
  return vec3_1.vec3.equals(a.p0, b.p0) && vec3_1.vec3.equals(a.p1, b.p1);
60
60
  },
61
- populatePoints(out, arc, count) {
61
+ populatePoints: function (out, arc, count) {
62
62
  // rotate p0 around normal vector with a quaternion
63
63
  // calculate angle
64
64
  }
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getGreatCircleArcBBox = getGreatCircleArcBBox;
4
- function isClose(a, b, rtol = 1e-5, atol = 1e-8) {
4
+ function isClose(a, b, rtol, atol) {
5
+ if (rtol === void 0) { rtol = 1e-5; }
6
+ if (atol === void 0) { atol = 1e-8; }
5
7
  // JavaScript equivalent of NumPy's isclose
6
8
  return Math.abs(a - b) <= (atol + rtol * Math.abs(b));
7
9
  }
@@ -19,10 +21,10 @@ function calculateInitialBearing(phi1, lambda1, phi2, lambda2) {
19
21
  return 0; // Bearing is North
20
22
  }
21
23
  }
22
- const deltaLambda = lambda2 - lambda1;
23
- const y = Math.sin(deltaLambda) * Math.cos(phi2);
24
- const x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(deltaLambda);
25
- const theta = Math.atan2(y, x);
24
+ var deltaLambda = lambda2 - lambda1;
25
+ var y = Math.sin(deltaLambda) * Math.cos(phi2);
26
+ var x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(deltaLambda);
27
+ var theta = Math.atan2(y, x);
26
28
  return theta;
27
29
  }
28
30
  function getGreatCircleArcBBox(phi1Rad, lambda1Rad, phi2Rad, lambda2Rad) {
@@ -35,23 +37,23 @@ function getGreatCircleArcBBox(phi1Rad, lambda1Rad, phi2Rad, lambda2Rad) {
35
37
  return [phi1Rad, phi1Rad, lambda1Rad, lambda1Rad];
36
38
  }
37
39
  // === Edge Case: Antipodal Points ===
38
- const deltaLambdaNorm = mod(lambda1Rad - lambda2Rad + Math.PI, 2 * Math.PI) - Math.PI;
40
+ var deltaLambdaNorm = mod(lambda1Rad - lambda2Rad + Math.PI, 2 * Math.PI) - Math.PI;
39
41
  if (isClose(phi1Rad, -phi2Rad) && isClose(Math.abs(deltaLambdaNorm), Math.PI)) {
40
42
  // Path covers all longitudes and passes through poles
41
43
  return [-Math.PI / 2, Math.PI / 2, -Math.PI, Math.PI];
42
44
  }
43
45
  // === Longitude Bounds ===
44
- let lambda1Adj = lambda1Rad;
45
- let lambda2Adj = lambda2Rad;
46
+ var lambda1Adj = lambda1Rad;
47
+ var lambda2Adj = lambda2Rad;
46
48
  // Handle antimeridian crossing
47
- let deltaLambda = lambda2Rad - lambda1Rad;
49
+ var deltaLambda = lambda2Rad - lambda1Rad;
48
50
  if (deltaLambda > Math.PI) {
49
51
  deltaLambda -= 2 * Math.PI;
50
52
  }
51
53
  else if (deltaLambda <= -Math.PI) {
52
54
  deltaLambda += 2 * Math.PI;
53
55
  }
54
- const crossesAntimeridian = Math.abs(lambda2Rad - lambda1Rad) > Math.PI;
56
+ var crossesAntimeridian = Math.abs(lambda2Rad - lambda1Rad) > Math.PI;
55
57
  if (crossesAntimeridian) {
56
58
  // Add 2*pi to the smaller longitude
57
59
  if (lambda1Rad < lambda2Rad) {
@@ -61,20 +63,20 @@ function getGreatCircleArcBBox(phi1Rad, lambda1Rad, phi2Rad, lambda2Rad) {
61
63
  lambda2Adj += 2 * Math.PI;
62
64
  }
63
65
  }
64
- const lambdaMin = Math.min(lambda1Adj, lambda2Adj);
65
- const lambdaMax = Math.max(lambda1Adj, lambda2Adj);
66
+ var lambdaMin = Math.min(lambda1Adj, lambda2Adj);
67
+ var lambdaMax = Math.max(lambda1Adj, lambda2Adj);
66
68
  // === Latitude Bounds ===
67
- let phiMin = Math.min(phi1Rad, phi2Rad);
68
- let phiMax = Math.max(phi1Rad, phi2Rad);
69
+ var phiMin = Math.min(phi1Rad, phi2Rad);
70
+ var phiMax = Math.max(phi1Rad, phi2Rad);
69
71
  // === Vertex Check ===
70
72
  // Check the maximum/minimum latitude reached by the great circle
71
- const theta12 = calculateInitialBearing(phi1Rad, lambda1Rad, phi2Rad, lambda2Rad);
72
- const theta21 = calculateInitialBearing(phi2Rad, lambda2Rad, phi1Rad, lambda1Rad);
73
- const cosPhi1 = Math.cos(phi1Rad);
73
+ var theta12 = calculateInitialBearing(phi1Rad, lambda1Rad, phi2Rad, lambda2Rad);
74
+ var theta21 = calculateInitialBearing(phi2Rad, lambda2Rad, phi1Rad, lambda1Rad);
75
+ var cosPhi1 = Math.cos(phi1Rad);
74
76
  if (!isClose(cosPhi1, 0)) { // Starting point is not a pole
75
77
  // Compute the absolute latitude of the vertex
76
- const argAcos = Math.abs(Math.sin(theta12) * cosPhi1);
77
- const phiVtxAbs = Math.acos(Math.min(Math.max(argAcos, -1.0), 1.0));
78
+ var argAcos = Math.abs(Math.sin(theta12) * cosPhi1);
79
+ var phiVtxAbs = Math.acos(Math.min(Math.max(argAcos, -1.0), 1.0));
78
80
  // Check if the path crosses the northern vertex
79
81
  if (isClose(theta12, 0) && phiVtxAbs > phiMax) { // Starting due north
80
82
  phiMax = phiVtxAbs;
@@ -84,7 +86,7 @@ function getGreatCircleArcBBox(phi1Rad, lambda1Rad, phi2Rad, lambda2Rad) {
84
86
  }
85
87
  else {
86
88
  // General case: Check if the path crosses the vertex
87
- const finalBearingAtP2 = mod(theta21 + Math.PI + Math.PI, 2 * Math.PI) - Math.PI;
89
+ var finalBearingAtP2 = mod(theta21 + Math.PI + Math.PI, 2 * Math.PI) - Math.PI;
88
90
  // Northern vertex check
89
91
  if ((-Math.PI / 2 < theta12 && theta12 < Math.PI / 2) &&
90
92
  !(finalBearingAtP2 >= -Math.PI / 2 && finalBearingAtP2 <= Math.PI / 2)) {
@@ -111,78 +113,78 @@ function radiansToDegrees(rad) {
111
113
  return rad * 180 / Math.PI;
112
114
  }
113
115
  // Test Case 1: London to Tokyo
114
- const lat1Deg = 51.5, lon1Deg = -0.1;
115
- const lat2Deg = 35.7, lon2Deg = 139.7;
116
- const phi1 = degreesToRadians(lat1Deg);
117
- const lambda1 = degreesToRadians(lon1Deg);
118
- const phi2 = degreesToRadians(lat2Deg);
119
- const lambda2 = degreesToRadians(lon2Deg);
120
- const [phiMinRad, phiMaxRad, lambdaMinRad, lambdaMaxRad] = getGreatCircleArcBBox(phi1, lambda1, phi2, lambda2);
121
- const phiMinDeg = radiansToDegrees(phiMinRad);
122
- const phiMaxDeg = radiansToDegrees(phiMaxRad);
123
- const lambdaMinDeg = radiansToDegrees(lambdaMinRad);
124
- const lambdaMaxDeg = radiansToDegrees(lambdaMaxRad);
116
+ var lat1Deg = 51.5, lon1Deg = -0.1;
117
+ var lat2Deg = 35.7, lon2Deg = 139.7;
118
+ var phi1 = degreesToRadians(lat1Deg);
119
+ var lambda1 = degreesToRadians(lon1Deg);
120
+ var phi2 = degreesToRadians(lat2Deg);
121
+ var lambda2 = degreesToRadians(lon2Deg);
122
+ var _a = getGreatCircleArcBBox(phi1, lambda1, phi2, lambda2), phiMinRad = _a[0], phiMaxRad = _a[1], lambdaMinRad = _a[2], lambdaMaxRad = _a[3];
123
+ var phiMinDeg = radiansToDegrees(phiMinRad);
124
+ var phiMaxDeg = radiansToDegrees(phiMaxRad);
125
+ var lambdaMinDeg = radiansToDegrees(lambdaMinRad);
126
+ var lambdaMaxDeg = radiansToDegrees(lambdaMaxRad);
125
127
  console.log("Input Points (Radians):");
126
- console.log(` P1: Latitude=${lat1Deg}, Longitude=${lon1Deg}`);
127
- console.log(` P2: Latitude=${lat2Deg}, Longitude=${lon2Deg}`);
128
- console.log(` P1: Latitude=${phi1.toFixed(4)}, Longitude=${lambda1.toFixed(4)}`);
129
- console.log(` P2: Latitude=${phi2.toFixed(4)}, Longitude=${lambda2.toFixed(4)}`);
128
+ console.log(" P1: Latitude=".concat(lat1Deg, ", Longitude=").concat(lon1Deg));
129
+ console.log(" P2: Latitude=".concat(lat2Deg, ", Longitude=").concat(lon2Deg));
130
+ console.log(" P1: Latitude=".concat(phi1.toFixed(4), ", Longitude=").concat(lambda1.toFixed(4)));
131
+ console.log(" P2: Latitude=".concat(phi2.toFixed(4), ", Longitude=").concat(lambda2.toFixed(4)));
130
132
  console.log("-".repeat(20));
131
133
  console.log("Bounding Box (Radians):");
132
134
  // console phys://console.log(` Minimum Latitude (phi_min): ${phiMinRad.toFixed(4)}`);
133
- console.log(` Maximum Latitude (phi_max): ${phiMaxRad.toFixed(4)}`);
134
- console.log(` Minimum Longitude (lambda_min): ${lambdaMinRad.toFixed(4)}`);
135
- console.log(` Maximum Longitude (lambda_max): ${lambdaMaxRad.toFixed(4)}`);
135
+ console.log(" Maximum Latitude (phi_max): ".concat(phiMaxRad.toFixed(4)));
136
+ console.log(" Minimum Longitude (lambda_min): ".concat(lambdaMinRad.toFixed(4)));
137
+ console.log(" Maximum Longitude (lambda_max): ".concat(lambdaMaxRad.toFixed(4)));
136
138
  console.log("-".repeat(20));
137
139
  console.log("Bounding Box (Degrees):");
138
- console.log(` Minimum Latitude: ${phiMinDeg.toFixed(2)}°`);
139
- console.log(` Maximum Latitude: ${phiMaxDeg.toFixed(2)}°`);
140
- console.log(` Minimum Longitude: ${lambdaMinDeg.toFixed(2)}°`);
141
- console.log(` Maximum Longitude: ${lambdaMaxDeg.toFixed(2)}°`);
140
+ console.log(" Minimum Latitude: ".concat(phiMinDeg.toFixed(2), "\u00B0"));
141
+ console.log(" Maximum Latitude: ".concat(phiMaxDeg.toFixed(2), "\u00B0"));
142
+ console.log(" Minimum Longitude: ".concat(lambdaMinDeg.toFixed(2), "\u00B0"));
143
+ console.log(" Maximum Longitude: ".concat(lambdaMaxDeg.toFixed(2), "\u00B0"));
142
144
  // --- Antimeridian Crossing Test ---
143
145
  console.log("\n" + "=".repeat(30));
144
146
  console.log("Antimeridian Crossing Test");
145
- const lat1DegAm = -18, lon1DegAm = 178;
146
- const lat2DegAm = -14, lon2DegAm = -172;
147
- const phi1Am = degreesToRadians(lat1DegAm);
148
- const lambda1Am = degreesToRadians(lon1DegAm);
149
- const phi2Am = degreesToRadians(lat2DegAm);
150
- const lambda2Am = degreesToRadians(lon2DegAm);
151
- const [phiMinRadAm, phiMaxRadAm, lambdaMinRadAm, lambdaMaxRadAm] = getGreatCircleArcBBox(phi1Am, lambda1Am, phi2Am, lambda2Am);
152
- const phiMinDegAm = radiansToDegrees(phiMinRadAm);
153
- const phiMaxDegAm = radiansToDegrees(phiMaxRadAm);
154
- const lambdaMinDegAm = radiansToDegrees(lambdaMinRadAm);
155
- const lambdaMaxDegAm = radiansToDegrees(lambdaMaxRadAm);
156
- console.log(`Input Points (Degrees): P1=(${lat1DegAm}, ${lon1DegAm}), P2=(${lat2DegAm}, ${lon2DegAm})`);
147
+ var lat1DegAm = -18, lon1DegAm = 178;
148
+ var lat2DegAm = -14, lon2DegAm = -172;
149
+ var phi1Am = degreesToRadians(lat1DegAm);
150
+ var lambda1Am = degreesToRadians(lon1DegAm);
151
+ var phi2Am = degreesToRadians(lat2DegAm);
152
+ var lambda2Am = degreesToRadians(lon2DegAm);
153
+ var _b = getGreatCircleArcBBox(phi1Am, lambda1Am, phi2Am, lambda2Am), phiMinRadAm = _b[0], phiMaxRadAm = _b[1], lambdaMinRadAm = _b[2], lambdaMaxRadAm = _b[3];
154
+ var phiMinDegAm = radiansToDegrees(phiMinRadAm);
155
+ var phiMaxDegAm = radiansToDegrees(phiMaxRadAm);
156
+ var lambdaMinDegAm = radiansToDegrees(lambdaMinRadAm);
157
+ var lambdaMaxDegAm = radiansToDegrees(lambdaMaxRadAm);
158
+ console.log("Input Points (Degrees): P1=(".concat(lat1DegAm, ", ").concat(lon1DegAm, "), P2=(").concat(lat2DegAm, ", ").concat(lon2DegAm, ")"));
157
159
  console.log("Bounding Box (Radians):");
158
- console.log(` phi_min=${phiMinRadAm.toFixed(4)}, phi_max=${phiMaxRadAm.toFixed(4)}`);
159
- console.log(` lambda_min=${lambdaMinRadAm.toFixed(4)}, lambda_max=${lambdaMaxRadAm.toFixed(4)}`);
160
+ console.log(" phi_min=".concat(phiMinRadAm.toFixed(4), ", phi_max=").concat(phiMaxRadAm.toFixed(4)));
161
+ console.log(" lambda_min=".concat(lambdaMinRadAm.toFixed(4), ", lambda_max=").concat(lambdaMaxRadAm.toFixed(4)));
160
162
  console.log("Bounding Box (Degrees):");
161
- console.log(` Min Latitude: ${phiMinDegAm.toFixed(2)}°`);
162
- console.log(` Max Latitude: ${phiMaxDegAm.toFixed(2)}°`);
163
- console.log(` Min Longitude: ${lambdaMinDegAm.toFixed(2) (178° expected)`);
164
- console.log(` Max Longitude: ${lambdaMaxDegAm.toFixed(2) (188° expected, which is -172° + 360°)`);
163
+ console.log(" Min Latitude: ".concat(phiMinDegAm.toFixed(2), "\u00B0"));
164
+ console.log(" Max Latitude: ".concat(phiMaxDegAm.toFixed(2), "\u00B0"));
165
+ console.log(" Min Longitude: ".concat(lambdaMinDegAm.toFixed(2), "\u00B0 (178\u00B0 expected)"));
166
+ console.log(" Max Longitude: ".concat(lambdaMaxDegAm.toFixed(2), "\u00B0 (188\u00B0 expected, which is -172\u00B0 + 360\u00B0)"));
165
167
  // --- Polar Crossing Test ---
166
168
  console.log("\n" + "=".repeat(30));
167
169
  console.log("Polar Crossing Test");
168
- const lat1DegP = 80, lon1DegP = 20;
169
- const lat2DegP = 80, lon2DegP = -100;
170
- const phi1P = degreesToRadians(lat1DegP);
171
- const lambda1P = degreesToRadians(lon1DegP);
172
- const phi2P = degreesToRadians(lat2DegP);
173
- const lambda2P = degreesToRadians(lon2DegP);
174
- const [phiMinRadP, phiMaxRadP, lambdaMinRadP, lambdaMaxRadP] = getGreatCircleArcBBox(phi1P, lambda1P, phi2P, lambda2P);
175
- const phiMinDegP = radiansToDegrees(phiMinRadP);
176
- const phiMaxDegP = radiansToDegrees(phiMaxRadP);
177
- const lambdaMinDegP = radiansToDegrees(lambdaMinRadP);
178
- const lambdaMaxDegP = radiansToDegrees(lambdaMaxRadP);
179
- console.log(`Input Points (Degrees): P1=(${lat1DegP}, ${lon1DegP}), P2=(${lat2DegP}, ${lon2DegP})`);
170
+ var lat1DegP = 80, lon1DegP = 20;
171
+ var lat2DegP = 80, lon2DegP = -100;
172
+ var phi1P = degreesToRadians(lat1DegP);
173
+ var lambda1P = degreesToRadians(lon1DegP);
174
+ var phi2P = degreesToRadians(lat2DegP);
175
+ var lambda2P = degreesToRadians(lon2DegP);
176
+ var _c = getGreatCircleArcBBox(phi1P, lambda1P, phi2P, lambda2P), phiMinRadP = _c[0], phiMaxRadP = _c[1], lambdaMinRadP = _c[2], lambdaMaxRadP = _c[3];
177
+ var phiMinDegP = radiansToDegrees(phiMinRadP);
178
+ var phiMaxDegP = radiansToDegrees(phiMaxRadP);
179
+ var lambdaMinDegP = radiansToDegrees(lambdaMinRadP);
180
+ var lambdaMaxDegP = radiansToDegrees(lambdaMaxRadP);
181
+ console.log("Input Points (Degrees): P1=(".concat(lat1DegP, ", ").concat(lon1DegP, "), P2=(").concat(lat2DegP, ", ").concat(lon2DegP, ")"));
180
182
  console.log("Bounding Box (Radians):");
181
- console.log(` phi_min=${phiMinRadP.toFixed(4)}, phi_max=${phiMaxRadP.toFixed(4)}`);
182
- console.log(` lambda_min=${lambdaMinRadP.toFixed(4)}, lambda_max=${lambdaMaxRadP.toFixed(4)}`);
183
+ console.log(" phi_min=".concat(phiMinRadP.toFixed(4), ", phi_max=").concat(phiMaxRadP.toFixed(4)));
184
+ console.log(" lambda_min=".concat(lambdaMinRadP.toFixed(4), ", lambda_max=").concat(lambdaMaxRadP.toFixed(4)));
183
185
  console.log("Bounding Box (Degrees):");
184
- console.log(` Min Latitude: ${phiMinDegP.toFixed(2)}°`);
185
- console.log(` Max Latitude: ${phiMaxDegP.toFixed(2) (Should be close to North Pole > 80°)`);
186
- console.log(` Min Longitude: ${lambdaMinDegP.toFixed(2)}°`);
187
- console.log(` Max Longitude: ${lambdaMaxDegP.toFixed(2)}°`);
186
+ console.log(" Min Latitude: ".concat(phiMinDegP.toFixed(2), "\u00B0"));
187
+ console.log(" Max Latitude: ".concat(phiMaxDegP.toFixed(2), "\u00B0 (Should be close to North Pole > 80\u00B0)"));
188
+ console.log(" Min Longitude: ".concat(lambdaMinDegP.toFixed(2), "\u00B0"));
189
+ console.log(" Max Longitude: ".concat(lambdaMaxDegP.toFixed(2), "\u00B0"));
188
190
  // --- line points intersection with bbox ---
package/Math/constants.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EPSILON = exports.WORLD_RADIUS_MERCATOR = exports.WORLD_RADIUS_3D = void 0;
4
- const WORLD_RADIUS_3D = 6378.137;
4
+ var WORLD_RADIUS_3D = 6378.137;
5
5
  exports.WORLD_RADIUS_3D = WORLD_RADIUS_3D;
6
- const WORLD_RADIUS_MERCATOR = 6378136.99911;
6
+ var WORLD_RADIUS_MERCATOR = 6378136.99911;
7
7
  exports.WORLD_RADIUS_MERCATOR = WORLD_RADIUS_MERCATOR;
8
- const EPSILON = 1e-10; // Used for floating point comparisons
8
+ var EPSILON = 1e-10; // Used for floating point comparisons
9
9
  exports.EPSILON = EPSILON;
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.arcSlice = arcSlice;
4
- const constants_1 = require("../constants");
5
- const vec3_1 = require("../vec3");
6
- const line_1 = require("../line");
7
- const plane_1 = require("../plane");
8
- const arc_1 = require("../arc");
9
- const plane_plane_1 = require("./plane-plane");
10
- const line_sphere_1 = require("./line-sphere");
11
- const _intersectionLine = /*@__PURE__*/ line_1.line.create();
12
- const _originPlane = /*@__PURE__*/ plane_1.plane.create();
4
+ var constants_1 = require("../constants");
5
+ var vec3_1 = require("../vec3");
6
+ var line_1 = require("../line");
7
+ var plane_1 = require("../plane");
8
+ var arc_1 = require("../arc");
9
+ var plane_plane_1 = require("./plane-plane");
10
+ var line_sphere_1 = require("./line-sphere");
11
+ var _intersectionLine = /*@__PURE__*/ line_1.line.create();
12
+ var _originPlane = /*@__PURE__*/ plane_1.plane.create();
13
13
  _originPlane.distance = 0;
14
- const _originSphere = /*@__PURE__*/ { center: vec3_1.vec3.create(0, 0, 0), radius: 1 };
15
- const _intersectionPoints = /*@__PURE__*/ [vec3_1.vec3.create(), vec3_1.vec3.create()];
14
+ var _originSphere = /*@__PURE__*/ { center: vec3_1.vec3.create(0, 0, 0), radius: 1 };
15
+ var _intersectionPoints = /*@__PURE__*/ [vec3_1.vec3.create(), vec3_1.vec3.create()];
16
16
  // TODO: out must be [Arc, Arc] there is a case where split into three arcs, visible by points or arcs but middle is not visible
17
17
  /**
18
18
  *
@@ -23,10 +23,10 @@ const _intersectionPoints = /*@__PURE__*/ [vec3_1.vec3.create(), vec3_1.vec3.cre
23
23
  */
24
24
  function arcSlice(out, inArc, juctionPlane) {
25
25
  // arc coverPlane and junctionPlane intersection exist in the range of unit sphere
26
- const coverRadiusAngle = plane_1.plane.getUnitSphereRadiusAngle(inArc.coverPlane);
27
- const visibleRadiusAngle = plane_1.plane.getUnitSphereRadiusAngle(juctionPlane);
26
+ var coverRadiusAngle = plane_1.plane.getUnitSphereRadiusAngle(inArc.coverPlane);
27
+ var visibleRadiusAngle = plane_1.plane.getUnitSphereRadiusAngle(juctionPlane);
28
28
  // TODO: RESEARCH efficient approach --
29
- const angleBetween_Cover_Visible = Math.acos(vec3_1.vec3.dot(inArc.coverPlane.normal, juctionPlane.normal));
29
+ var angleBetween_Cover_Visible = Math.acos(vec3_1.vec3.dot(inArc.coverPlane.normal, juctionPlane.normal));
30
30
  if (coverRadiusAngle + visibleRadiusAngle < angleBetween_Cover_Visible - constants_1.EPSILON) { // case A: out of range
31
31
  return 0; // No intersection
32
32
  }
@@ -38,7 +38,7 @@ function arcSlice(out, inArc, juctionPlane) {
38
38
  }
39
39
  // plane-plane intersection line should be calculated for the rest of the calculations
40
40
  vec3_1.vec3.copy(_originPlane.normal, inArc.normal);
41
- const isPlaneJunctions = (0, plane_plane_1.planePlaneJuction)(_intersectionLine, _originPlane, juctionPlane);
41
+ var isPlaneJunctions = (0, plane_plane_1.planePlaneJuction)(_intersectionLine, _originPlane, juctionPlane);
42
42
  if (!isPlaneJunctions) { // case C: planes are parallel.
43
43
  // case A covers opposite directions
44
44
  // case B Covers they face each other
@@ -46,23 +46,23 @@ function arcSlice(out, inArc, juctionPlane) {
46
46
  }
47
47
  // --- read until here ---
48
48
  // calculate the intersection points
49
- const isSphereIntersection = (0, line_sphere_1.lineSphereIntersection)(_intersectionPoints, _intersectionLine, _originSphere);
49
+ var isSphereIntersection = (0, line_sphere_1.lineSphereIntersection)(_intersectionPoints, _intersectionLine, _originSphere);
50
50
  if (!isSphereIntersection) {
51
51
  // other edge caes should be covered by now
52
52
  return 0; // No intersection
53
53
  }
54
- const i0IsCovered = plane_1.plane.distanceToPoint(inArc.coverPlane, _intersectionPoints[0]) > -constants_1.EPSILON;
55
- const i1IsCovered = plane_1.plane.distanceToPoint(inArc.coverPlane, _intersectionPoints[1]) > -constants_1.EPSILON;
56
- const p0IsVisible = plane_1.plane.distanceToPoint(juctionPlane, inArc.p0) > -constants_1.EPSILON;
57
- const p1IsVisible = plane_1.plane.distanceToPoint(juctionPlane, inArc.p1) > -constants_1.EPSILON;
54
+ var i0IsCovered = plane_1.plane.distanceToPoint(inArc.coverPlane, _intersectionPoints[0]) > -constants_1.EPSILON;
55
+ var i1IsCovered = plane_1.plane.distanceToPoint(inArc.coverPlane, _intersectionPoints[1]) > -constants_1.EPSILON;
56
+ var p0IsVisible = plane_1.plane.distanceToPoint(juctionPlane, inArc.p0) > -constants_1.EPSILON;
57
+ var p1IsVisible = plane_1.plane.distanceToPoint(juctionPlane, inArc.p1) > -constants_1.EPSILON;
58
58
  if (!p0IsVisible && !p1IsVisible && !i0IsCovered && !i1IsCovered) {
59
59
  return 0; // No intersection
60
60
  }
61
61
  if (i0IsCovered && i1IsCovered && p0IsVisible && p1IsVisible) {
62
62
  // calculate which points are closer
63
- const p0i0DistanceSquared = vec3_1.vec3.distanceSquared(inArc.p0, _intersectionPoints[0]);
64
- const p0i1DistanceSquared = vec3_1.vec3.distanceSquared(inArc.p0, _intersectionPoints[1]);
65
- const case0 = p0i0DistanceSquared < p0i1DistanceSquared;
63
+ var p0i0DistanceSquared = vec3_1.vec3.distanceSquared(inArc.p0, _intersectionPoints[0]);
64
+ var p0i1DistanceSquared = vec3_1.vec3.distanceSquared(inArc.p0, _intersectionPoints[1]);
65
+ var case0 = p0i0DistanceSquared < p0i1DistanceSquared;
66
66
  arc_1.arc.set(out[0], inArc.p0, case0 ? _intersectionPoints[0] : _intersectionPoints[1]);
67
67
  arc_1.arc.set(out[1], inArc.p1, !case0 ? _intersectionPoints[0] : _intersectionPoints[1]);
68
68
  return 2;
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lineSphereIntersection = lineSphereIntersection;
4
- const vec3_1 = require("../vec3");
5
- const line_1 = require("../line");
6
- const _0vector = /*@__PURE__*/ vec3_1.vec3.create(0, 0, 0);
4
+ var vec3_1 = require("../vec3");
5
+ var line_1 = require("../line");
6
+ var _0vector = /*@__PURE__*/ vec3_1.vec3.create(0, 0, 0);
7
7
  function lineSphereIntersection(out, inLine, inSphere) {
8
8
  vec3_1.vec3.subtract(_0vector, inLine.origin, inSphere.center);
9
- const distanceSquared = vec3_1.vec3.lengthSquared(_0vector);
10
- const radiusSquared = inSphere.radius * inSphere.radius;
11
- const dot = vec3_1.vec3.dot(_0vector, inLine.direction);
12
- const dotSquared = dot * dot;
13
- const _a = dotSquared + radiusSquared - distanceSquared;
9
+ var distanceSquared = vec3_1.vec3.lengthSquared(_0vector);
10
+ var radiusSquared = inSphere.radius * inSphere.radius;
11
+ var dot = vec3_1.vec3.dot(_0vector, inLine.direction);
12
+ var dotSquared = dot * dot;
13
+ var _a = dotSquared + radiusSquared - distanceSquared;
14
14
  if (_a < 0) {
15
15
  return false; // no intersection
16
16
  }
17
17
  else {
18
- const a = Math.sqrt(_a);
19
- const t1 = dot - a;
20
- const t2 = dot + a;
18
+ var a = Math.sqrt(_a);
19
+ var t1 = dot - a;
20
+ var t2 = dot + a;
21
21
  line_1.line.at(out[0], inLine, t1);
22
22
  line_1.line.at(out[1], inLine, t2);
23
23
  return true;
@@ -1,30 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.planePlaneJuction = planePlaneJuction;
4
- const constants_1 = require("../constants");
5
- const vec3_1 = require("../vec3");
6
- const _normal1 = vec3_1.vec3.create();
7
- const _normal2 = vec3_1.vec3.create();
4
+ var constants_1 = require("../constants");
5
+ var vec3_1 = require("../vec3");
6
+ var _normal1 = vec3_1.vec3.create();
7
+ var _normal2 = vec3_1.vec3.create();
8
8
  function planePlaneJuction(out, plane1, plane2) {
9
9
  vec3_1.vec3.copy(_normal1, plane1.normal);
10
10
  vec3_1.vec3.copy(_normal2, plane2.normal);
11
- const distance1 = plane1.distance;
12
- const distance2 = plane2.distance;
13
- const { origin, direction } = out;
14
- const dot = vec3_1.vec3.dot(_normal1, _normal2);
11
+ var distance1 = plane1.distance;
12
+ var distance2 = plane2.distance;
13
+ var origin = out.origin, direction = out.direction;
14
+ var dot = vec3_1.vec3.dot(_normal1, _normal2);
15
15
  if (Math.abs(dot) > 1 - constants_1.EPSILON) {
16
16
  return false; // Planes are parallel, no intersection
17
17
  }
18
18
  vec3_1.vec3.cross(direction, _normal1, _normal2);
19
- const magnitudeSquired = vec3_1.vec3.lengthSquared(out.direction);
19
+ var magnitudeSquired = vec3_1.vec3.lengthSquared(out.direction);
20
20
  if (magnitudeSquired < constants_1.EPSILON) {
21
21
  return false; // No valid intersection line
22
22
  }
23
- const magnitude = Math.sqrt(magnitudeSquired);
23
+ var magnitude = Math.sqrt(magnitudeSquired);
24
24
  direction[0] /= magnitude;
25
25
  direction[1] /= magnitude;
26
26
  direction[2] /= magnitude;
27
- let determinant;
27
+ var determinant;
28
28
  // Calculate the intersection point
29
29
  // set z = 0
30
30
  determinant = _normal1[0] * _normal2[1] - _normal1[1] * _normal2[0];
package/Math/line.js CHANGED
@@ -1,54 +1,56 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.line = void 0;
4
- const constants_1 = require("./constants");
5
- const vec3_1 = require("./vec3");
6
- const _0vector = /*@__PURE__*/ vec3_1.vec3.create(0, 0, 0);
4
+ var constants_1 = require("./constants");
5
+ var vec3_1 = require("./vec3");
6
+ var _0vector = /*@__PURE__*/ vec3_1.vec3.create(0, 0, 0);
7
7
  exports.line = Object.freeze({
8
- create(origin = vec3_1.vec3.create(), direction = vec3_1.vec3.create()) {
9
- const direction_ = vec3_1.vec3.clone(direction);
8
+ create: function (origin, direction) {
9
+ if (origin === void 0) { origin = vec3_1.vec3.create(); }
10
+ if (direction === void 0) { direction = vec3_1.vec3.create(); }
11
+ var direction_ = vec3_1.vec3.clone(direction);
10
12
  vec3_1.vec3.normalize(direction_, direction_);
11
13
  return {
12
14
  origin: vec3_1.vec3.clone(origin),
13
15
  direction: direction_
14
16
  };
15
17
  },
16
- set(out, origin, direction) {
18
+ set: function (out, origin, direction) {
17
19
  vec3_1.vec3.copy(out.origin, origin);
18
20
  vec3_1.vec3.copy(out.direction, direction);
19
21
  },
20
- copy(out, a) {
22
+ copy: function (out, a) {
21
23
  out.origin = vec3_1.vec3.copy(out.origin, a.origin);
22
24
  out.direction = vec3_1.vec3.copy(out.direction, a.direction);
23
25
  },
24
- clone(a) {
26
+ clone: function (a) {
25
27
  return {
26
28
  origin: vec3_1.vec3.clone(a.origin),
27
29
  direction: vec3_1.vec3.clone(a.direction)
28
30
  };
29
31
  },
30
- fromTwoPoints(out, a, b) {
32
+ fromTwoPoints: function (out, a, b) {
31
33
  vec3_1.vec3.subtract(out.direction, b, a);
32
34
  vec3_1.vec3.normalize(out.direction, out.direction);
33
35
  vec3_1.vec3.copy(out.origin, a);
34
36
  },
35
- at(out, line, distance) {
37
+ at: function (out, line, distance) {
36
38
  vec3_1.vec3.multiplyScalar(_0vector, line.direction, distance);
37
39
  vec3_1.vec3.add(out, _0vector, line.origin);
38
40
  },
39
- closestPoint(out, line, point) {
41
+ closestPoint: function (out, line, point) {
40
42
  vec3_1.vec3.subtract(_0vector, point, line.origin);
41
- const dot = vec3_1.vec3.dot(_0vector, line.direction);
43
+ var dot = vec3_1.vec3.dot(_0vector, line.direction);
42
44
  vec3_1.vec3.copy(out, line.direction);
43
45
  vec3_1.vec3.multiplyScalar(out, out, dot);
44
46
  vec3_1.vec3.add(out, out, line.origin);
45
47
  },
46
- contains(line, point) {
48
+ contains: function (line, point) {
47
49
  vec3_1.vec3.subtract(_0vector, point, line.origin);
48
50
  vec3_1.vec3.cross(_0vector, _0vector, line.direction);
49
51
  return vec3_1.vec3.lengthSquared(_0vector) < constants_1.EPSILON;
50
52
  },
51
- applyQuaternion(out, line, quaternion) {
53
+ applyQuaternion: function (out, line, quaternion) {
52
54
  vec3_1.vec3.applyQuaternion(out.origin, line.origin, quaternion);
53
55
  vec3_1.vec3.applyQuaternion(out.direction, line.direction, quaternion);
54
56
  vec3_1.vec3.normalize(out.direction, out.direction);