@saber-usa/node-common 1.7.7-alpha.1 → 1.7.7
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/README.md +41 -41
- package/package.json +52 -52
- package/src/FrameConverter.js +1121 -1121
- package/src/LLA.js +179 -179
- package/src/LaunchNominalClass.js +753 -753
- package/src/NodeVector3D.js +71 -71
- package/src/OrbitUtils.js +309 -309
- package/src/PropagateUtils.js +100 -100
- package/src/ShadowGEOCalculator.js +203 -203
- package/src/TimeConverter.js +309 -309
- package/src/astro.js +3301 -3301
- package/src/ballisticPropagator.js +1037 -1037
- package/src/checkNetwork.cjs +20 -20
- package/src/constants.js +37 -37
- package/src/fixDate.js +62 -62
- package/src/index.js +47 -47
- package/src/launchNominal.js +208 -208
- package/src/loggerFactory.cjs +98 -98
- package/src/s3.js +59 -59
- package/src/transform.js +35 -35
- package/src/udl.js +116 -116
- package/src/utils.js +406 -406
package/src/NodeVector3D.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import {Vector3D} from "pious-squid";
|
|
2
|
-
|
|
3
|
-
class NodeVector3D {
|
|
4
|
-
constructor(x, y, z) {
|
|
5
|
-
this.x = x;
|
|
6
|
-
this.y = y;
|
|
7
|
-
this.z = z;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
add(vector) {
|
|
11
|
-
return new NodeVector3D(this.x + vector.x, this.y + vector.y, this.z + vector.z);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
subtract(vector) {
|
|
15
|
-
return new NodeVector3D(this.x - vector.x, this.y - vector.y, this.z - vector.z);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
dot(vector) {
|
|
19
|
-
return this.x * vector.x + this.y * vector.y + this.z * vector.z;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
cross(vector) {
|
|
23
|
-
return new NodeVector3D(
|
|
24
|
-
this.y * vector.z - this.z * vector.y,
|
|
25
|
-
this.z * vector.x - this.x * vector.z,
|
|
26
|
-
this.x * vector.y - this.y * vector.x,
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
scale(scalar) {
|
|
31
|
-
return new NodeVector3D(this.x * scalar, this.y * scalar, this.z * scalar);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
negate() {
|
|
35
|
-
return this.scale(-1);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
magnitude() {
|
|
39
|
-
return Math.sqrt(this.x ** 2 + this.y ** 2 + this.z ** 2);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
distance(vector) {
|
|
43
|
-
const dx = this.x - vector.x;
|
|
44
|
-
const dy = this.y - vector.y;
|
|
45
|
-
const dz = this.z - vector.z;
|
|
46
|
-
return Math.sqrt(dx ** 2 + dy ** 2 + dz ** 2);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
toString() {
|
|
50
|
-
const xStr = this.x.toFixed(4);
|
|
51
|
-
const yStr = this.y.toFixed(4);
|
|
52
|
-
const zStr = this.z.toFixed(4);
|
|
53
|
-
return `(${xStr}, ${yStr}, ${zStr})`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
normalized() {
|
|
57
|
-
const mag = this.magnitude();
|
|
58
|
-
if (mag === 0) {
|
|
59
|
-
throw new Error("Cannot normalize a zero vector");
|
|
60
|
-
}
|
|
61
|
-
return new NodeVector3D(this.x / mag, this.y / mag, this.z / mag);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
toSquid() {
|
|
65
|
-
return new Vector3D(this.x, this.y, this.z);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// TODO: add angle and join operation methods
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export {NodeVector3D};
|
|
1
|
+
import {Vector3D} from "pious-squid";
|
|
2
|
+
|
|
3
|
+
class NodeVector3D {
|
|
4
|
+
constructor(x, y, z) {
|
|
5
|
+
this.x = x;
|
|
6
|
+
this.y = y;
|
|
7
|
+
this.z = z;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
add(vector) {
|
|
11
|
+
return new NodeVector3D(this.x + vector.x, this.y + vector.y, this.z + vector.z);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
subtract(vector) {
|
|
15
|
+
return new NodeVector3D(this.x - vector.x, this.y - vector.y, this.z - vector.z);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
dot(vector) {
|
|
19
|
+
return this.x * vector.x + this.y * vector.y + this.z * vector.z;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
cross(vector) {
|
|
23
|
+
return new NodeVector3D(
|
|
24
|
+
this.y * vector.z - this.z * vector.y,
|
|
25
|
+
this.z * vector.x - this.x * vector.z,
|
|
26
|
+
this.x * vector.y - this.y * vector.x,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
scale(scalar) {
|
|
31
|
+
return new NodeVector3D(this.x * scalar, this.y * scalar, this.z * scalar);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
negate() {
|
|
35
|
+
return this.scale(-1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
magnitude() {
|
|
39
|
+
return Math.sqrt(this.x ** 2 + this.y ** 2 + this.z ** 2);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
distance(vector) {
|
|
43
|
+
const dx = this.x - vector.x;
|
|
44
|
+
const dy = this.y - vector.y;
|
|
45
|
+
const dz = this.z - vector.z;
|
|
46
|
+
return Math.sqrt(dx ** 2 + dy ** 2 + dz ** 2);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
toString() {
|
|
50
|
+
const xStr = this.x.toFixed(4);
|
|
51
|
+
const yStr = this.y.toFixed(4);
|
|
52
|
+
const zStr = this.z.toFixed(4);
|
|
53
|
+
return `(${xStr}, ${yStr}, ${zStr})`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
normalized() {
|
|
57
|
+
const mag = this.magnitude();
|
|
58
|
+
if (mag === 0) {
|
|
59
|
+
throw new Error("Cannot normalize a zero vector");
|
|
60
|
+
}
|
|
61
|
+
return new NodeVector3D(this.x / mag, this.y / mag, this.z / mag);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
toSquid() {
|
|
65
|
+
return new Vector3D(this.x, this.y, this.z);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// TODO: add angle and join operation methods
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export {NodeVector3D};
|