gl-draw 0.17.0-beta.37 → 0.17.0-beta.38

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.
@@ -1 +1 @@
1
- "use strict";var C=Math.pow;const n=require("three"),x=t=>t instanceof n.Vector3?t:new n.Vector3(...t),y=t=>t instanceof n.Vector2?t:new n.Vector2(...t),c={a:6378137,b:6356752314245179e-9,f:1/298.257223563};function z(t,T,d=0,o=1/c.a,l=!1){const i=n.MathUtils.degToRad(t),e=n.MathUtils.degToRad(T),a=Math.cos(e),r=Math.sin(e),g=Math.cos(i),q=Math.sin(i);let V,h,u;if(l){const s=(c.a+d)*o;V=s*a*g,h=s*r,u=s*a*q}else{const M=c.a,s=c.b,b=M*M,S=s*s,f=(b-S)/b,p=M/Math.sqrt(1-f*r*r),U=(p+d)*a*g*o,L=(p+d)*a*q*o,m=(p*(1-f)+d)*r*o;V=U,h=m,u=L}return new n.Vector3(V,h,u)}function G(t,T=1/c.a,d=!1){const o=t.x/T,l=t.y/T,i=t.z/T;if(d){const m=Math.sqrt(o*o+l*l+i*i),D=Math.atan2(i,o),R=Math.asin(l/m),w=m-c.a;return{longitude:n.MathUtils.radToDeg(D),latitude:n.MathUtils.radToDeg(R),height:w}}const e=c.a,a=c.b,r=e*e,g=a*a,q=(r-g)/r,V=(r-g)/g,h=o,u=i,M=l,s=Math.sqrt(h*h+u*u),b=Math.atan2(M*e,s*a),S=Math.atan2(u,h),f=Math.atan2(M+V*a*C(Math.sin(b),3),s-q*e*C(Math.cos(b),3)),p=Math.sin(f),U=e/Math.sqrt(1-q*p*p),L=s/Math.cos(f)-U;return{longitude:n.MathUtils.radToDeg(S),latitude:n.MathUtils.radToDeg(f),height:L}}exports.WGS84=c;exports.cartesianToCartographic=G;exports.cartographicToCartesian=z;exports.parseVector2=y;exports.parseVector3=x;
1
+ "use strict";var U=Math.pow;const o=require("three"),R=t=>t instanceof o.Vector3?t:new o.Vector3(...t),w=t=>t instanceof o.Vector2?t:new o.Vector2(...t),e={a:6378137,b:6356752314245179e-9,f:1/298.257223563};function x(t,p,u=0,n=1/e.a,h=!1){const s=o.MathUtils.degToRad(t),r=o.MathUtils.degToRad(p),c=Math.cos(r),i=Math.sin(r),d=Math.cos(s),T=Math.sin(s);let q,M,l;if(h){const a=(e.a+u)*n;q=a*c*T,M=a*i,l=a*c*d}else{const g=e.a,a=e.b,V=g*g,S=a*a,b=(V-S)/V,f=g/Math.sqrt(1-b*i*i);q=(f+u)*c*T*n,M=(f*(1-b)+u)*i*n,l=(f+u)*c*d*n}return new o.Vector3(q,M,l)}function y(t,p=1/e.a,u=!1){const n=t.x/p,h=t.y/p,s=t.z/p;if(u){const f=Math.sqrt(n*n+h*h+s*s),L=Math.atan2(n,s),C=Math.asin(h/f),D=f-e.a;return{longitude:o.MathUtils.radToDeg(L),latitude:o.MathUtils.radToDeg(C),height:D}}const r=e.a,c=e.b,i=r*r,d=c*c,T=(i-d)/i,q=(i-d)/d,M=Math.sqrt(n*n+s*s),l=Math.atan2(h*r,M*c),g=Math.atan2(n,s),a=Math.atan2(h+q*c*U(Math.sin(l),3),M-T*r*U(Math.cos(l),3)),V=Math.sin(a),S=r/Math.sqrt(1-T*V*V),b=M/Math.cos(a)-S;return{longitude:o.MathUtils.radToDeg(g),latitude:o.MathUtils.radToDeg(a),height:b}}exports.WGS84=e;exports.cartesianToCartographic=y;exports.cartographicToCartesian=x;exports.parseVector2=w;exports.parseVector3=R;
@@ -1,6 +1,6 @@
1
- var R = Math.pow;
2
- import { Vector3 as V, Vector2 as w, MathUtils as p } from "three";
3
- const X = (t) => t instanceof V ? t : new V(...t), Y = (t) => t instanceof w ? t : new w(...t), e = {
1
+ var x = Math.pow;
2
+ import { Vector3 as D, Vector2 as R, MathUtils as l } from "three";
3
+ const C = (t) => t instanceof D ? t : new D(...t), N = (t) => t instanceof R ? t : new R(...t), r = {
4
4
  a: 6378137,
5
5
  // 赤道半径
6
6
  b: 6356752314245179e-9,
@@ -8,42 +8,42 @@ const X = (t) => t instanceof V ? t : new V(...t), Y = (t) => t instanceof w ? t
8
8
  f: 1 / 298.257223563
9
9
  // 扁率
10
10
  };
11
- function Z(t, b, d = 0, s = 1 / e.a, M = !1) {
12
- const i = p.degToRad(t), a = p.degToRad(b), o = Math.cos(a), c = Math.sin(a), f = Math.cos(i), m = Math.sin(i);
13
- let q, r, u;
14
- if (M) {
15
- const n = (e.a + d) * s;
16
- q = n * o * f, r = n * c, u = n * o * m;
11
+ function W(t, p, d = 0, n = 1 / r.a, i = !1) {
12
+ const a = l.degToRad(t), c = l.degToRad(p), s = Math.cos(c), e = Math.sin(c), M = Math.cos(a), b = Math.sin(a);
13
+ let q, h, u;
14
+ if (i) {
15
+ const o = (r.a + d) * n;
16
+ q = o * s * b, h = o * e, u = o * s * M;
17
17
  } else {
18
- const h = e.a, n = e.b, T = h * h, S = n * n, g = (T - S) / T, l = h / Math.sqrt(1 - g * c * c), x = (l + d) * o * f * s, D = (l + d) * o * m * s, L = (l * (1 - g) + d) * c * s;
19
- q = x, r = L, u = D;
18
+ const f = r.a, o = r.b, T = f * f, S = o * o, L = (T - S) / T, g = f / Math.sqrt(1 - L * e * e);
19
+ q = (g + d) * s * b * n, h = (g * (1 - L) + d) * e * n, u = (g + d) * s * M * n;
20
20
  }
21
- return new V(q, r, u);
21
+ return new D(q, h, u);
22
22
  }
23
- function G(t, b = 1 / e.a, d = !1) {
24
- const s = t.x / b, M = t.y / b, i = t.z / b;
23
+ function G(t, p = 1 / r.a, d = !1) {
24
+ const n = t.x / p, i = t.y / p, a = t.z / p;
25
25
  if (d) {
26
- const L = Math.sqrt(s * s + M * M + i * i), y = Math.atan2(i, s), z = Math.asin(M / L), C = L - e.a;
26
+ const g = Math.sqrt(n * n + i * i + a * a), V = Math.atan2(n, a), w = Math.asin(i / g), y = g - r.a;
27
27
  return {
28
- longitude: p.radToDeg(y),
29
- latitude: p.radToDeg(z),
30
- height: C
28
+ longitude: l.radToDeg(V),
29
+ latitude: l.radToDeg(w),
30
+ height: y
31
31
  };
32
32
  }
33
- const a = e.a, o = e.b, c = a * a, f = o * o, m = (c - f) / c, q = (c - f) / f, r = s, u = i, h = M, n = Math.sqrt(r * r + u * u), T = Math.atan2(h * a, n * o), S = Math.atan2(u, r), g = Math.atan2(
34
- h + q * o * R(Math.sin(T), 3),
35
- n - m * a * R(Math.cos(T), 3)
36
- ), l = Math.sin(g), x = a / Math.sqrt(1 - m * l * l), D = n / Math.cos(g) - x;
33
+ const c = r.a, s = r.b, e = c * c, M = s * s, b = (e - M) / e, q = (e - M) / M, h = Math.sqrt(n * n + a * a), u = Math.atan2(i * c, h * s), f = Math.atan2(n, a), o = Math.atan2(
34
+ i + q * s * x(Math.sin(u), 3),
35
+ h - b * c * x(Math.cos(u), 3)
36
+ ), T = Math.sin(o), S = c / Math.sqrt(1 - b * T * T), L = h / Math.cos(o) - S;
37
37
  return {
38
- longitude: p.radToDeg(S),
39
- latitude: p.radToDeg(g),
40
- height: D
38
+ longitude: l.radToDeg(f),
39
+ latitude: l.radToDeg(o),
40
+ height: L
41
41
  };
42
42
  }
43
43
  export {
44
- e as W,
45
- Y as a,
44
+ r as W,
45
+ N as a,
46
46
  G as b,
47
- Z as c,
48
- X as p
47
+ W as c,
48
+ C as p
49
49
  };