@interstellar-tools/equations 0.2.0 → 0.4.0
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/dist/__tests__/circular-speed.spec.d.ts +2 -0
- package/dist/__tests__/circular-speed.spec.d.ts.map +1 -0
- package/dist/__tests__/circular-speed.spec.js +69 -0
- package/dist/__tests__/circular-speed.spec.js.map +1 -0
- package/dist/__tests__/compute-angle.int.spec.js +2 -2
- package/dist/__tests__/compute-angle.int.spec.js.map +1 -1
- package/dist/__tests__/eccentric-to-true-anomaly.spec.js +1 -1
- package/dist/__tests__/eccentric-to-true-anomaly.spec.js.map +1 -1
- package/dist/__tests__/escape-speed.spec.d.ts +2 -0
- package/dist/__tests__/escape-speed.spec.d.ts.map +1 -0
- package/dist/__tests__/escape-speed.spec.js +79 -0
- package/dist/__tests__/escape-speed.spec.js.map +1 -0
- package/dist/__tests__/gravitational-acceleration-on1-by2.int.spec.js +16 -16
- package/dist/__tests__/gravitational-acceleration-on1-by2.int.spec.js.map +1 -1
- package/dist/__tests__/gravitational-force-on1-by2.int.spec.js +20 -20
- package/dist/__tests__/gravitational-force-on1-by2.int.spec.js.map +1 -1
- package/dist/__tests__/gravitational-force.spec.js +1 -1
- package/dist/__tests__/gravitational-force.spec.js.map +1 -1
- package/dist/__tests__/gravitational-parameters.spec.js +1 -1
- package/dist/__tests__/gravitational-parameters.spec.js.map +1 -1
- package/dist/__tests__/helpers/index.d.ts +2 -1
- package/dist/__tests__/helpers/index.d.ts.map +1 -1
- package/dist/__tests__/helpers/index.js +6 -0
- package/dist/__tests__/helpers/index.js.map +1 -1
- package/dist/__tests__/kepler-period.spec.js +1 -1
- package/dist/__tests__/kepler-period.spec.js.map +1 -1
- package/dist/__tests__/mean-to-eccentric-anomaly.spec.d.ts +2 -0
- package/dist/__tests__/mean-to-eccentric-anomaly.spec.d.ts.map +1 -0
- package/dist/__tests__/{compute-mean-anomaly.int.spec.js → mean-to-eccentric-anomaly.spec.js} +49 -27
- package/dist/__tests__/mean-to-eccentric-anomaly.spec.js.map +1 -0
- package/dist/__tests__/peri-apoapsis-radii.spec.d.ts +2 -0
- package/dist/__tests__/peri-apoapsis-radii.spec.d.ts.map +1 -0
- package/dist/__tests__/peri-apoapsis-radii.spec.js +74 -0
- package/dist/__tests__/peri-apoapsis-radii.spec.js.map +1 -0
- package/dist/__tests__/solve-kepler-bisection.spec.js +1 -1
- package/dist/__tests__/solve-kepler-bisection.spec.js.map +1 -1
- package/dist/__tests__/solve-kepler-high-eccentricity.spec.js +1 -1
- package/dist/__tests__/solve-kepler-high-eccentricity.spec.js.map +1 -1
- package/dist/__tests__/solve-kepler-newton-raphson.spec.js +1 -1
- package/dist/__tests__/solve-kepler-newton-raphson.spec.js.map +1 -1
- package/dist/__tests__/solve-kepler.int.spec.js +1 -1
- package/dist/__tests__/solve-kepler.int.spec.js.map +1 -1
- package/dist/__tests__/specific-angular-momentum-from-elements.spec.d.ts +2 -0
- package/dist/__tests__/specific-angular-momentum-from-elements.spec.d.ts.map +1 -0
- package/dist/__tests__/specific-angular-momentum-from-elements.spec.js +86 -0
- package/dist/__tests__/specific-angular-momentum-from-elements.spec.js.map +1 -0
- package/dist/__tests__/specific-angular-momentum.spec.d.ts +2 -0
- package/dist/__tests__/specific-angular-momentum.spec.d.ts.map +1 -0
- package/dist/__tests__/specific-angular-momentum.spec.js +84 -0
- package/dist/__tests__/specific-angular-momentum.spec.js.map +1 -0
- package/dist/__tests__/specific-mechanical-energy.spec.js +1 -1
- package/dist/__tests__/specific-mechanical-energy.spec.js.map +1 -1
- package/dist/__tests__/true-to-mean-anomaly.spec.d.ts +2 -0
- package/dist/__tests__/true-to-mean-anomaly.spec.d.ts.map +1 -0
- package/dist/__tests__/{true-anomaly-to-mean-anomaly.int.spec.js → true-to-mean-anomaly.spec.js} +13 -13
- package/dist/__tests__/true-to-mean-anomaly.spec.js.map +1 -0
- package/dist/__tests__/vis-viva-speed.spec.js +1 -1
- package/dist/__tests__/vis-viva-speed.spec.js.map +1 -1
- package/dist/__tests__/wrap-angle.spec.js +1 -1
- package/dist/__tests__/wrap-angle.spec.js.map +1 -1
- package/dist/{compute-angle.d.ts → categories/angle/compute-angle.d.ts} +1 -1
- package/dist/categories/angle/compute-angle.d.ts.map +1 -0
- package/dist/{compute-angle.js → categories/angle/compute-angle.js} +5 -5
- package/dist/categories/angle/compute-angle.js.map +1 -0
- package/dist/{wrap-angle.d.ts → categories/angle/wrap-angle.d.ts} +1 -1
- package/dist/categories/angle/wrap-angle.d.ts.map +1 -0
- package/dist/{wrap-angle.js → categories/angle/wrap-angle.js} +1 -1
- package/dist/categories/angle/wrap-angle.js.map +1 -0
- package/dist/{eccentric-to-true-anomaly.d.ts → categories/anomalies/eccentric-to-true-anomaly.d.ts} +1 -1
- package/dist/categories/anomalies/eccentric-to-true-anomaly.d.ts.map +1 -0
- package/dist/{eccentric-to-true-anomaly.js → categories/anomalies/eccentric-to-true-anomaly.js} +1 -1
- package/dist/categories/anomalies/eccentric-to-true-anomaly.js.map +1 -0
- package/dist/{compute-mean-anomaly.d.ts → categories/anomalies/mean-to-eccentric-anomaly.d.ts} +5 -5
- package/dist/categories/anomalies/mean-to-eccentric-anomaly.d.ts.map +1 -0
- package/dist/{compute-mean-anomaly.js → categories/anomalies/mean-to-eccentric-anomaly.js} +11 -20
- package/dist/categories/anomalies/mean-to-eccentric-anomaly.js.map +1 -0
- package/dist/{true-anomaly-to-mean-anomaly.d.ts → categories/anomalies/true-to-mean-anomaly.d.ts} +6 -6
- package/dist/categories/anomalies/true-to-mean-anomaly.d.ts.map +1 -0
- package/dist/{true-anomaly-to-mean-anomaly.js → categories/anomalies/true-to-mean-anomaly.js} +7 -7
- package/dist/categories/anomalies/true-to-mean-anomaly.js.map +1 -0
- package/dist/categories/anomalies/utils/are-equal.d.ts +10 -0
- package/dist/categories/anomalies/utils/are-equal.d.ts.map +1 -0
- package/dist/categories/anomalies/utils/are-equal.js +13 -0
- package/dist/categories/anomalies/utils/are-equal.js.map +1 -0
- package/dist/categories/gravity/acceleration-on1-by2.d.ts +66 -0
- package/dist/categories/gravity/acceleration-on1-by2.d.ts.map +1 -0
- package/dist/categories/gravity/acceleration-on1-by2.js +75 -0
- package/dist/categories/gravity/acceleration-on1-by2.js.map +1 -0
- package/dist/categories/gravity/force-on1-by2.d.ts +87 -0
- package/dist/categories/gravity/force-on1-by2.d.ts.map +1 -0
- package/dist/categories/gravity/force-on1-by2.js +96 -0
- package/dist/categories/gravity/force-on1-by2.js.map +1 -0
- package/dist/categories/gravity/gravitational-force.d.ts +94 -0
- package/dist/categories/gravity/gravitational-force.d.ts.map +1 -0
- package/dist/categories/gravity/gravitational-force.js +119 -0
- package/dist/categories/gravity/gravitational-force.js.map +1 -0
- package/dist/{gravitational-parameter.d.ts → categories/gravity/gravitational-parameter.d.ts} +1 -1
- package/dist/categories/gravity/gravitational-parameter.d.ts.map +1 -0
- package/dist/{gravitational-parameter.js → categories/gravity/gravitational-parameter.js} +1 -1
- package/dist/categories/gravity/gravitational-parameter.js.map +1 -0
- package/dist/{solve-kepler-bisection.d.ts → categories/kepler/solve-kepler-bisection.d.ts} +1 -1
- package/dist/categories/kepler/solve-kepler-bisection.d.ts.map +1 -0
- package/dist/{solve-kepler-bisection.js → categories/kepler/solve-kepler-bisection.js} +1 -1
- package/dist/categories/kepler/solve-kepler-bisection.js.map +1 -0
- package/dist/{solve-kepler-high-eccentricity.d.ts → categories/kepler/solve-kepler-high-eccentricity.d.ts} +2 -8
- package/dist/categories/kepler/solve-kepler-high-eccentricity.d.ts.map +1 -0
- package/dist/{solve-kepler-high-eccentricity.js → categories/kepler/solve-kepler-high-eccentricity.js} +5 -9
- package/dist/categories/kepler/solve-kepler-high-eccentricity.js.map +1 -0
- package/dist/{solve-kepler-newton-raphson.d.ts → categories/kepler/solve-kepler-newton-raphson.d.ts} +1 -1
- package/dist/categories/kepler/solve-kepler-newton-raphson.d.ts.map +1 -0
- package/dist/{solve-kepler-newton-raphson.js → categories/kepler/solve-kepler-newton-raphson.js} +1 -1
- package/dist/categories/kepler/solve-kepler-newton-raphson.js.map +1 -0
- package/dist/{solve-kepler.d.ts → categories/kepler/solve-kepler.d.ts} +1 -1
- package/dist/categories/kepler/solve-kepler.d.ts.map +1 -0
- package/dist/{solve-kepler.js → categories/kepler/solve-kepler.js} +2 -2
- package/dist/categories/kepler/solve-kepler.js.map +1 -0
- package/dist/categories/orbits/circular-speed.d.ts +42 -0
- package/dist/categories/orbits/circular-speed.d.ts.map +1 -0
- package/dist/categories/orbits/circular-speed.js +50 -0
- package/dist/categories/orbits/circular-speed.js.map +1 -0
- package/dist/categories/orbits/escape-speed.d.ts +50 -0
- package/dist/categories/orbits/escape-speed.d.ts.map +1 -0
- package/dist/categories/orbits/escape-speed.js +58 -0
- package/dist/categories/orbits/escape-speed.js.map +1 -0
- package/dist/{kepler-period.d.ts → categories/orbits/kepler-period.d.ts} +1 -1
- package/dist/categories/orbits/kepler-period.d.ts.map +1 -0
- package/dist/{kepler-period.js → categories/orbits/kepler-period.js} +1 -1
- package/dist/categories/orbits/kepler-period.js.map +1 -0
- package/dist/categories/orbits/peri-apoapsis-radii.d.ts +46 -0
- package/dist/categories/orbits/peri-apoapsis-radii.d.ts.map +1 -0
- package/dist/categories/orbits/peri-apoapsis-radii.js +85 -0
- package/dist/categories/orbits/peri-apoapsis-radii.js.map +1 -0
- package/dist/categories/orbits/specific-angular-momentum-from-elements.d.ts +60 -0
- package/dist/categories/orbits/specific-angular-momentum-from-elements.d.ts.map +1 -0
- package/dist/categories/orbits/specific-angular-momentum-from-elements.js +76 -0
- package/dist/categories/orbits/specific-angular-momentum-from-elements.js.map +1 -0
- package/dist/categories/orbits/specific-angular-momentum.d.ts +55 -0
- package/dist/categories/orbits/specific-angular-momentum.d.ts.map +1 -0
- package/dist/categories/orbits/specific-angular-momentum.js +76 -0
- package/dist/categories/orbits/specific-angular-momentum.js.map +1 -0
- package/dist/{specific-mechanical-energy.d.ts → categories/orbits/specific-mechanical-energy.d.ts} +1 -1
- package/dist/categories/orbits/specific-mechanical-energy.d.ts.map +1 -0
- package/dist/{specific-mechanical-energy.js → categories/orbits/specific-mechanical-energy.js} +1 -1
- package/dist/categories/orbits/specific-mechanical-energy.js.map +1 -0
- package/dist/{vis-viva-speed.d.ts → categories/orbits/vis-viva-speed.d.ts} +1 -1
- package/dist/categories/orbits/vis-viva-speed.d.ts.map +1 -0
- package/dist/{vis-viva-speed.js → categories/orbits/vis-viva-speed.js} +1 -1
- package/dist/categories/orbits/vis-viva-speed.js.map +1 -0
- package/dist/index.d.ts +20 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/__tests__/compute-mean-anomaly.int.spec.d.ts +0 -2
- package/dist/__tests__/compute-mean-anomaly.int.spec.d.ts.map +0 -1
- package/dist/__tests__/compute-mean-anomaly.int.spec.js.map +0 -1
- package/dist/__tests__/true-anomaly-to-mean-anomaly.int.spec.d.ts +0 -2
- package/dist/__tests__/true-anomaly-to-mean-anomaly.int.spec.d.ts.map +0 -1
- package/dist/__tests__/true-anomaly-to-mean-anomaly.int.spec.js.map +0 -1
- package/dist/compute-angle.d.ts.map +0 -1
- package/dist/compute-angle.js.map +0 -1
- package/dist/compute-mean-anomaly.d.ts.map +0 -1
- package/dist/compute-mean-anomaly.js.map +0 -1
- package/dist/eccentric-to-true-anomaly.d.ts.map +0 -1
- package/dist/eccentric-to-true-anomaly.js.map +0 -1
- package/dist/gravitational-parameter.d.ts.map +0 -1
- package/dist/gravitational-parameter.js.map +0 -1
- package/dist/kepler-period.d.ts.map +0 -1
- package/dist/kepler-period.js.map +0 -1
- package/dist/law-of-gravitation.d.ts +0 -243
- package/dist/law-of-gravitation.d.ts.map +0 -1
- package/dist/law-of-gravitation.js +0 -284
- package/dist/law-of-gravitation.js.map +0 -1
- package/dist/solve-kepler-bisection.d.ts.map +0 -1
- package/dist/solve-kepler-bisection.js.map +0 -1
- package/dist/solve-kepler-high-eccentricity.d.ts.map +0 -1
- package/dist/solve-kepler-high-eccentricity.js.map +0 -1
- package/dist/solve-kepler-newton-raphson.d.ts.map +0 -1
- package/dist/solve-kepler-newton-raphson.js.map +0 -1
- package/dist/solve-kepler.d.ts.map +0 -1
- package/dist/solve-kepler.js.map +0 -1
- package/dist/specific-mechanical-energy.d.ts.map +0 -1
- package/dist/specific-mechanical-energy.js.map +0 -1
- package/dist/true-anomaly-to-mean-anomaly.d.ts.map +0 -1
- package/dist/true-anomaly-to-mean-anomaly.js.map +0 -1
- package/dist/vis-viva-speed.d.ts.map +0 -1
- package/dist/vis-viva-speed.js.map +0 -1
- package/dist/wrap-angle.d.ts.map +0 -1
- package/dist/wrap-angle.js.map +0 -1
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import type { ForceResultInterface, Vector3DTupleType } from '@interstellar-tools/types';
|
|
2
|
-
/**
|
|
3
|
-
* Compute the Newtonian **gravitational force** on body 1 due to body 2.
|
|
4
|
-
*
|
|
5
|
-
* **Definitions**
|
|
6
|
-
*
|
|
7
|
-
* $$
|
|
8
|
-
* \mathbf r=\mathbf r_2-\mathbf r_1,\quad
|
|
9
|
-
* r=\lVert\mathbf r\rVert,\quad
|
|
10
|
-
* \hat{\mathbf r}=\frac{\mathbf r}{r}
|
|
11
|
-
* $$
|
|
12
|
-
*
|
|
13
|
-
* **Law & Decomposition**
|
|
14
|
-
*
|
|
15
|
-
* $$
|
|
16
|
-
* \mathbf F_{1\leftarrow2}
|
|
17
|
-
* = G\,\frac{m_1 m_2}{r^2}\,\hat{\mathbf r}
|
|
18
|
-
* $$
|
|
19
|
-
*
|
|
20
|
-
* $$
|
|
21
|
-
* \lVert\mathbf F\rVert
|
|
22
|
-
* = G\,\frac{m_1 m_2}{r^2},\qquad
|
|
23
|
-
* \mathbf F=\langle F_x,F_y,F_z\rangle
|
|
24
|
-
* = \lVert\mathbf F\rVert\,\hat{\mathbf r}
|
|
25
|
-
* $$
|
|
26
|
-
*
|
|
27
|
-
* $$
|
|
28
|
-
* F_x=\lVert\mathbf F\rVert\,\hat r_x,\quad
|
|
29
|
-
* F_y=\lVert\mathbf F\rVert\,\hat r_y,\quad
|
|
30
|
-
* F_z=\lVert\mathbf F\rVert\,\hat r_z
|
|
31
|
-
* $$
|
|
32
|
-
*
|
|
33
|
-
* **Newton's 3rd law, for context**
|
|
34
|
-
*
|
|
35
|
-
* $$
|
|
36
|
-
* \mathbf F_{1\leftarrow2}=-\,\mathbf F_{2\leftarrow1}
|
|
37
|
-
* $$
|
|
38
|
-
*
|
|
39
|
-
* **Conventions & units**
|
|
40
|
-
* - Input masses in **kilograms (kg)**; positions in **meters (m)**.
|
|
41
|
-
* - Output force in **newtons (N)**.
|
|
42
|
-
* - Returned `vector` and `direction` point **from body 1 toward body 2**; i.e., `direction = \hat{\mathbf r}`.
|
|
43
|
-
*
|
|
44
|
-
* **Invariants (within numerical tolerance)**
|
|
45
|
-
* - `vector = magnitude * direction`
|
|
46
|
-
* - `magnitude = sqrt(Fx² + Fy² + Fz²)`
|
|
47
|
-
* - `||direction|| = 1`
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param {number} m1 Mass of body 1 (kg).
|
|
51
|
-
* @param {number} m2 Mass of body 2 (kg).
|
|
52
|
-
* @param {Vector3DTupleType} r1 Position of body 1 as a 3-tuple `[x, y, z]` in meters.
|
|
53
|
-
* @param {Vector3DTupleType} r2 Position of body 2 as a 3-tuple `[x, y, z]` in meters.
|
|
54
|
-
* @param {number} [G] Gravitational constant (defaults to `G_SI`, m³·kg⁻¹·s⁻²).
|
|
55
|
-
* @returns {ForceResultInterface} `{ vector, magnitude, direction }`.
|
|
56
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If `m1` or `m2` are non-finite or negative.
|
|
57
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If positions coincide (`r = 0`).
|
|
58
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If `G` is non-finite or not positive.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* import { gravitationalForce } from "@interstellar-tools/equations";
|
|
63
|
-
* import { G_SI } from "@interstellar-tools/constants";
|
|
64
|
-
*
|
|
65
|
-
* // Earth–Sun at ~1 AU
|
|
66
|
-
* const mEarth = 5.972e24; // kg
|
|
67
|
-
* const mSun = 1.9885e30; // kg
|
|
68
|
-
* const rEarth: [number, number, number] = [0, 0, 0];
|
|
69
|
-
* const rSun : [number, number, number] = [1.495978707e11, 0, 0]; // m
|
|
70
|
-
*
|
|
71
|
-
* const F = gravitationalForce(mEarth, mSun, rEarth, rSun, G_SI);
|
|
72
|
-
* console.log(F.magnitude.toExponential(3)); // ≈ "3.542e+22" N
|
|
73
|
-
* console.log(F.vector); // Points from Earth toward Sun (−x here)
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* **Get F directly (recommended)**
|
|
77
|
-
*
|
|
78
|
-
* ```ts
|
|
79
|
-
* import { gravitationalForce } from "@interstellar-tools/equations";
|
|
80
|
-
* import type { Vector3DTupleType, ForceResultInterface } from "@interstellar-tools/types";
|
|
81
|
-
*
|
|
82
|
-
* const m1 = 5.972e24; // kg
|
|
83
|
-
* const m2 = 1.9885e30; // kg
|
|
84
|
-
* const r1: Vector3DTupleType = [0, 0, 0]; // m
|
|
85
|
-
* const r2: Vector3DTupleType = [1.495978707e11, 0, 0]; // m
|
|
86
|
-
*
|
|
87
|
-
* const { vector: F, magnitude, direction }: ForceResultInterface = gravitationalForce(m1, m2, r1, r2);
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @see https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
|
|
91
|
-
* @category Dynamics
|
|
92
|
-
*/
|
|
93
|
-
export declare const gravitationalForce: (m1: number, m2: number, r1: Vector3DTupleType, r2: Vector3DTupleType, G?: number) => ForceResultInterface;
|
|
94
|
-
/**
|
|
95
|
-
* Gravitational **acceleration** of body 1 due to body 2 (vector, m/s²).
|
|
96
|
-
*
|
|
97
|
-
* **Definitions**
|
|
98
|
-
*
|
|
99
|
-
* $$
|
|
100
|
-
* \mathbf r=\mathbf r_2-\mathbf r_1,\quad
|
|
101
|
-
* r=\lVert\mathbf r\rVert,\quad
|
|
102
|
-
* \hat{\mathbf r}=\frac{\mathbf r}{r}
|
|
103
|
-
* $$
|
|
104
|
-
*
|
|
105
|
-
* **Acceleration field**
|
|
106
|
-
*
|
|
107
|
-
* $$
|
|
108
|
-
* \mathbf a_{1\leftarrow2}
|
|
109
|
-
* = \frac{\mathbf F_{1\leftarrow2}}{m_1}
|
|
110
|
-
* = G\,\frac{m_2}{r^2}\,\hat{\mathbf r}
|
|
111
|
-
* $$
|
|
112
|
-
*
|
|
113
|
-
* **Units**
|
|
114
|
-
* - Inputs: masses in **kg**, positions in **m**, ($ G $) in **m³·kg⁻¹·s⁻²**.
|
|
115
|
-
* - Output: acceleration in **m/s²**.
|
|
116
|
-
*
|
|
117
|
-
* ::: info
|
|
118
|
-
*
|
|
119
|
-
* - Implemented via `gravitationalForce(1, m2, r1, r2, G)`, so the returned vector equals the force on a **1 kg** test mass (i.e., the acceleration).
|
|
120
|
-
* - Direction points **from body 1 toward body 2**: ($ \hat{\mathbf r} $).
|
|
121
|
-
*
|
|
122
|
-
* :::
|
|
123
|
-
*
|
|
124
|
-
* **Invariants (within FP tolerance)**
|
|
125
|
-
* - `||a|| = G*m2/r^2`
|
|
126
|
-
* - `a = ||a|| * r̂`
|
|
127
|
-
*
|
|
128
|
-
* @param {number} m2 Mass of body 2 (kg).
|
|
129
|
-
* @param {Vector3DTupleType} r1 Position of body 1 `[x, y, z]` in meters.
|
|
130
|
-
* @param {Vector3DTupleType} r2 Position of body 2 `[x, y, z]` in meters.
|
|
131
|
-
* @param {number} [G=G_SI] Gravitational constant.
|
|
132
|
-
* @returns {Vector3DTupleType} Acceleration of body 1 due to body 2 (m/s²).
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* ```ts
|
|
136
|
-
* // Acceleration of a satellite due to Earth at ~7000 km from Earth's center
|
|
137
|
-
* const mSat = 500; // kg (any value; a is independent of mSat)
|
|
138
|
-
* const mEarth = 5.972e24; // kg
|
|
139
|
-
* const rSat: [number, number, number] = [7.0e6, 0, 0]; // m
|
|
140
|
-
* const rEarth: [number, number, number] = [0, 0, 0];
|
|
141
|
-
*
|
|
142
|
-
* const a = gravitationalAccelerationOn1By2(mSat, mEarth, rSat, rEarth);
|
|
143
|
-
* // ≈ [-8.14, 0, 0] m/s² (toward Earth)
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* // Derive force from acceleration (F = m1 * a)
|
|
149
|
-
* const m1 = 1200; // kg spacecraft
|
|
150
|
-
* const a = gravitationalAccelerationOn1By2(m1, mEarth, rSat, rEarth);
|
|
151
|
-
* const F: [number, number, number] = [a[0]*m1, a[1]*m1, a[2]*m1]; // newtons
|
|
152
|
-
* ```
|
|
153
|
-
*
|
|
154
|
-
* @see https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
|
|
155
|
-
* @category Dynamics
|
|
156
|
-
*/
|
|
157
|
-
export declare const gravitationalAccelerationOn1By2: (m2: number, r1: Vector3DTupleType, r2: Vector3DTupleType, G?: number) => Vector3DTupleType;
|
|
158
|
-
/**
|
|
159
|
-
* Gravitational **force vector** on body 1 due to body 2 (newtons, N).
|
|
160
|
-
*
|
|
161
|
-
* **Definitions**
|
|
162
|
-
*
|
|
163
|
-
* $$
|
|
164
|
-
* \mathbf r=\mathbf r_2-\mathbf r_1,\quad
|
|
165
|
-
* r=\lVert\mathbf r\rVert,\quad
|
|
166
|
-
* \hat{\mathbf r}=\frac{\mathbf r}{r}
|
|
167
|
-
* $$
|
|
168
|
-
*
|
|
169
|
-
* **Newton's law (vector form)**
|
|
170
|
-
*
|
|
171
|
-
* $$
|
|
172
|
-
* \mathbf F_{1\leftarrow2}
|
|
173
|
-
* = G\,\frac{m_1 m_2}{r^2}\,\hat{\mathbf r}
|
|
174
|
-
* $$
|
|
175
|
-
*
|
|
176
|
-
* **Magnitude & Components**
|
|
177
|
-
*
|
|
178
|
-
* $$
|
|
179
|
-
* \lVert\mathbf F\rVert=G\,\frac{m_1 m_2}{r^2},\qquad
|
|
180
|
-
* \mathbf F=\langle F_x,F_y,F_z\rangle=\lVert\mathbf F\rVert\,\hat{\mathbf r}
|
|
181
|
-
* $$
|
|
182
|
-
*
|
|
183
|
-
* $$
|
|
184
|
-
* F_x=\lVert\mathbf F\rVert\,\hat r_x,\quad
|
|
185
|
-
* F_y=\lVert\mathbf F\rVert\,\hat r_y,\quad
|
|
186
|
-
* F_z=\lVert\mathbf F\rVert\,\hat r_z
|
|
187
|
-
* $$
|
|
188
|
-
*
|
|
189
|
-
* **Newton's 3rd law (context)**
|
|
190
|
-
*
|
|
191
|
-
* $$
|
|
192
|
-
* \mathbf F_{1\leftarrow2}=-\,\mathbf F_{2\leftarrow1}
|
|
193
|
-
* $$
|
|
194
|
-
*
|
|
195
|
-
* **Units**
|
|
196
|
-
* - Inputs: masses in **kg**, positions in **m**, ($ G $) in **m³·kg⁻¹·s⁻²**.
|
|
197
|
-
* - Output: force vector in **newtons (N)**.
|
|
198
|
-
*
|
|
199
|
-
* ::: info
|
|
200
|
-
*
|
|
201
|
-
* - The returned vector points **from body 1 toward body 2** (i.e., along ($ \hat{\mathbf r} $)).
|
|
202
|
-
* - Internally delegates to `gravitationalForce(m1, m2, r1, r2, G)` and returns its
|
|
203
|
-
* direction-scaled magnitude as a 3-tuple.
|
|
204
|
-
* - For acceleration instead of force, use `gravitationalAccelerationOn1By2` or compute ($ \mathbf a=\mathbf F/m_1 $).
|
|
205
|
-
*
|
|
206
|
-
* :::
|
|
207
|
-
*
|
|
208
|
-
* **Invariants (within FP tolerance)**
|
|
209
|
-
* - `||F|| = G*m1*m2/r^2`
|
|
210
|
-
* - `F = ||F|| * r̂`
|
|
211
|
-
*
|
|
212
|
-
* @param {number} m1 Mass of body 1 (kg).
|
|
213
|
-
* @param {number} m2 Mass of body 2 (kg).
|
|
214
|
-
* @param {Vector3DTupleType} r1 Position of body 1 `[x, y, z]` in meters.
|
|
215
|
-
* @param {Vector3DTupleType} r2 Position of body 2 `[x, y, z]` in meters.
|
|
216
|
-
* @param {number} [G=G_SI] Gravitational constant.
|
|
217
|
-
* @returns {Vector3DTupleType} Force on body 1 due to body 2, in newtons `[Fx, Fy, Fz]`.
|
|
218
|
-
*
|
|
219
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} Propagated from `gravitationalForce` if inputs are invalid (non-finite/negative masses, coincident positions ($ r=0 $), or non-positive ($ G $)).
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* ```ts
|
|
223
|
-
* // Earth–Sun at ~1 AU (force on Earth due to Sun)
|
|
224
|
-
* const mEarth = 5.972e24; // kg
|
|
225
|
-
* const mSun = 1.9885e30; // kg
|
|
226
|
-
* const rEarth: [number, number, number] = [0, 0, 0];
|
|
227
|
-
* const rSun : [number, number, number] = [1.495978707e11, 0, 0]; // m
|
|
228
|
-
*
|
|
229
|
-
* const F = gravitationalForceOn1By2(mEarth, mSun, rEarth, rSun); // N
|
|
230
|
-
* const Fmag = Math.hypot(F[0], F[1], F[2]); // ≈ 3.54e22 N
|
|
231
|
-
* ```
|
|
232
|
-
*
|
|
233
|
-
* @example
|
|
234
|
-
* ```ts
|
|
235
|
-
* // Derive acceleration from the returned force: a = F / m1
|
|
236
|
-
* const a: [number, number, number] = [F[0]/mEarth, F[1]/mEarth, F[2]/mEarth]; // m/s^2
|
|
237
|
-
* ```
|
|
238
|
-
*
|
|
239
|
-
* @see https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
|
|
240
|
-
* @category Dynamics
|
|
241
|
-
*/
|
|
242
|
-
export declare const gravitationalForceOn1By2: (m1: number, m2: number, r1: Vector3DTupleType, r2: Vector3DTupleType, G?: number) => Vector3DTupleType;
|
|
243
|
-
//# sourceMappingURL=law-of-gravitation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"law-of-gravitation.d.ts","sourceRoot":"","sources":["../src/law-of-gravitation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,IAAI,MAAM,EACV,IAAI,iBAAiB,EACrB,IAAI,iBAAiB,EACrB,IAAG,MAAa,KACf,oBAgCF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,eAAO,MAAM,+BAA+B,GAC1C,IAAI,MAAM,EACV,IAAI,iBAAiB,EACrB,IAAI,iBAAiB,EACrB,IAAG,MAAa,KACf,iBASF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,eAAO,MAAM,wBAAwB,GACnC,IAAI,MAAM,EACV,IAAI,MAAM,EACV,IAAI,iBAAiB,EACrB,IAAI,iBAAiB,EACrB,IAAG,MAAa,KACf,iBASF,CAAC"}
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { G_SI } from '@interstellar-tools/constants';
|
|
2
|
-
/**
|
|
3
|
-
* Compute the Newtonian **gravitational force** on body 1 due to body 2.
|
|
4
|
-
*
|
|
5
|
-
* **Definitions**
|
|
6
|
-
*
|
|
7
|
-
* $$
|
|
8
|
-
* \mathbf r=\mathbf r_2-\mathbf r_1,\quad
|
|
9
|
-
* r=\lVert\mathbf r\rVert,\quad
|
|
10
|
-
* \hat{\mathbf r}=\frac{\mathbf r}{r}
|
|
11
|
-
* $$
|
|
12
|
-
*
|
|
13
|
-
* **Law & Decomposition**
|
|
14
|
-
*
|
|
15
|
-
* $$
|
|
16
|
-
* \mathbf F_{1\leftarrow2}
|
|
17
|
-
* = G\,\frac{m_1 m_2}{r^2}\,\hat{\mathbf r}
|
|
18
|
-
* $$
|
|
19
|
-
*
|
|
20
|
-
* $$
|
|
21
|
-
* \lVert\mathbf F\rVert
|
|
22
|
-
* = G\,\frac{m_1 m_2}{r^2},\qquad
|
|
23
|
-
* \mathbf F=\langle F_x,F_y,F_z\rangle
|
|
24
|
-
* = \lVert\mathbf F\rVert\,\hat{\mathbf r}
|
|
25
|
-
* $$
|
|
26
|
-
*
|
|
27
|
-
* $$
|
|
28
|
-
* F_x=\lVert\mathbf F\rVert\,\hat r_x,\quad
|
|
29
|
-
* F_y=\lVert\mathbf F\rVert\,\hat r_y,\quad
|
|
30
|
-
* F_z=\lVert\mathbf F\rVert\,\hat r_z
|
|
31
|
-
* $$
|
|
32
|
-
*
|
|
33
|
-
* **Newton's 3rd law, for context**
|
|
34
|
-
*
|
|
35
|
-
* $$
|
|
36
|
-
* \mathbf F_{1\leftarrow2}=-\,\mathbf F_{2\leftarrow1}
|
|
37
|
-
* $$
|
|
38
|
-
*
|
|
39
|
-
* **Conventions & units**
|
|
40
|
-
* - Input masses in **kilograms (kg)**; positions in **meters (m)**.
|
|
41
|
-
* - Output force in **newtons (N)**.
|
|
42
|
-
* - Returned `vector` and `direction` point **from body 1 toward body 2**; i.e., `direction = \hat{\mathbf r}`.
|
|
43
|
-
*
|
|
44
|
-
* **Invariants (within numerical tolerance)**
|
|
45
|
-
* - `vector = magnitude * direction`
|
|
46
|
-
* - `magnitude = sqrt(Fx² + Fy² + Fz²)`
|
|
47
|
-
* - `||direction|| = 1`
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param {number} m1 Mass of body 1 (kg).
|
|
51
|
-
* @param {number} m2 Mass of body 2 (kg).
|
|
52
|
-
* @param {Vector3DTupleType} r1 Position of body 1 as a 3-tuple `[x, y, z]` in meters.
|
|
53
|
-
* @param {Vector3DTupleType} r2 Position of body 2 as a 3-tuple `[x, y, z]` in meters.
|
|
54
|
-
* @param {number} [G] Gravitational constant (defaults to `G_SI`, m³·kg⁻¹·s⁻²).
|
|
55
|
-
* @returns {ForceResultInterface} `{ vector, magnitude, direction }`.
|
|
56
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If `m1` or `m2` are non-finite or negative.
|
|
57
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If positions coincide (`r = 0`).
|
|
58
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If `G` is non-finite or not positive.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* import { gravitationalForce } from "@interstellar-tools/equations";
|
|
63
|
-
* import { G_SI } from "@interstellar-tools/constants";
|
|
64
|
-
*
|
|
65
|
-
* // Earth–Sun at ~1 AU
|
|
66
|
-
* const mEarth = 5.972e24; // kg
|
|
67
|
-
* const mSun = 1.9885e30; // kg
|
|
68
|
-
* const rEarth: [number, number, number] = [0, 0, 0];
|
|
69
|
-
* const rSun : [number, number, number] = [1.495978707e11, 0, 0]; // m
|
|
70
|
-
*
|
|
71
|
-
* const F = gravitationalForce(mEarth, mSun, rEarth, rSun, G_SI);
|
|
72
|
-
* console.log(F.magnitude.toExponential(3)); // ≈ "3.542e+22" N
|
|
73
|
-
* console.log(F.vector); // Points from Earth toward Sun (−x here)
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* **Get F directly (recommended)**
|
|
77
|
-
*
|
|
78
|
-
* ```ts
|
|
79
|
-
* import { gravitationalForce } from "@interstellar-tools/equations";
|
|
80
|
-
* import type { Vector3DTupleType, ForceResultInterface } from "@interstellar-tools/types";
|
|
81
|
-
*
|
|
82
|
-
* const m1 = 5.972e24; // kg
|
|
83
|
-
* const m2 = 1.9885e30; // kg
|
|
84
|
-
* const r1: Vector3DTupleType = [0, 0, 0]; // m
|
|
85
|
-
* const r2: Vector3DTupleType = [1.495978707e11, 0, 0]; // m
|
|
86
|
-
*
|
|
87
|
-
* const { vector: F, magnitude, direction }: ForceResultInterface = gravitationalForce(m1, m2, r1, r2);
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @see https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
|
|
91
|
-
* @category Dynamics
|
|
92
|
-
*/
|
|
93
|
-
export const gravitationalForce = (m1, m2, r1, r2, G = G_SI) => {
|
|
94
|
-
if (!Number.isFinite(m1) || !Number.isFinite(m2) || m1 < 0 || m2 < 0) {
|
|
95
|
-
throw new Error('m1 and m2 must be finite, non-negative numbers (kg).');
|
|
96
|
-
}
|
|
97
|
-
if (!Number.isFinite(G) || G <= 0) {
|
|
98
|
-
throw new Error('G must be a finite, positive number (m^3·kg^-1·s^-2).');
|
|
99
|
-
}
|
|
100
|
-
const rx = r2[0] - r1[0];
|
|
101
|
-
const ry = r2[1] - r1[1];
|
|
102
|
-
const rz = r2[2] - r1[2];
|
|
103
|
-
const r2mag = rx * rx + ry * ry + rz * rz;
|
|
104
|
-
if (r2mag === 0) {
|
|
105
|
-
throw new Error('Bodies are at the same position: gravitational force is singular (r = 0).');
|
|
106
|
-
}
|
|
107
|
-
const invR = 1 / Math.sqrt(r2mag);
|
|
108
|
-
const dir = [rx * invR, ry * invR, rz * invR];
|
|
109
|
-
// |F| = G m1 m2 / r^2
|
|
110
|
-
const magnitude = (G * m1 * m2) / r2mag;
|
|
111
|
-
// Vector points from body 1 toward body 2.
|
|
112
|
-
const Fx = dir[0] * magnitude;
|
|
113
|
-
const Fy = dir[1] * magnitude;
|
|
114
|
-
const Fz = dir[2] * magnitude;
|
|
115
|
-
// Ensure the tuple type is preserved for callers.
|
|
116
|
-
const vector = [Fx, Fy, Fz];
|
|
117
|
-
return { vector, magnitude, direction: dir };
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Gravitational **acceleration** of body 1 due to body 2 (vector, m/s²).
|
|
121
|
-
*
|
|
122
|
-
* **Definitions**
|
|
123
|
-
*
|
|
124
|
-
* $$
|
|
125
|
-
* \mathbf r=\mathbf r_2-\mathbf r_1,\quad
|
|
126
|
-
* r=\lVert\mathbf r\rVert,\quad
|
|
127
|
-
* \hat{\mathbf r}=\frac{\mathbf r}{r}
|
|
128
|
-
* $$
|
|
129
|
-
*
|
|
130
|
-
* **Acceleration field**
|
|
131
|
-
*
|
|
132
|
-
* $$
|
|
133
|
-
* \mathbf a_{1\leftarrow2}
|
|
134
|
-
* = \frac{\mathbf F_{1\leftarrow2}}{m_1}
|
|
135
|
-
* = G\,\frac{m_2}{r^2}\,\hat{\mathbf r}
|
|
136
|
-
* $$
|
|
137
|
-
*
|
|
138
|
-
* **Units**
|
|
139
|
-
* - Inputs: masses in **kg**, positions in **m**, ($ G $) in **m³·kg⁻¹·s⁻²**.
|
|
140
|
-
* - Output: acceleration in **m/s²**.
|
|
141
|
-
*
|
|
142
|
-
* ::: info
|
|
143
|
-
*
|
|
144
|
-
* - Implemented via `gravitationalForce(1, m2, r1, r2, G)`, so the returned vector equals the force on a **1 kg** test mass (i.e., the acceleration).
|
|
145
|
-
* - Direction points **from body 1 toward body 2**: ($ \hat{\mathbf r} $).
|
|
146
|
-
*
|
|
147
|
-
* :::
|
|
148
|
-
*
|
|
149
|
-
* **Invariants (within FP tolerance)**
|
|
150
|
-
* - `||a|| = G*m2/r^2`
|
|
151
|
-
* - `a = ||a|| * r̂`
|
|
152
|
-
*
|
|
153
|
-
* @param {number} m2 Mass of body 2 (kg).
|
|
154
|
-
* @param {Vector3DTupleType} r1 Position of body 1 `[x, y, z]` in meters.
|
|
155
|
-
* @param {Vector3DTupleType} r2 Position of body 2 `[x, y, z]` in meters.
|
|
156
|
-
* @param {number} [G=G_SI] Gravitational constant.
|
|
157
|
-
* @returns {Vector3DTupleType} Acceleration of body 1 due to body 2 (m/s²).
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```ts
|
|
161
|
-
* // Acceleration of a satellite due to Earth at ~7000 km from Earth's center
|
|
162
|
-
* const mSat = 500; // kg (any value; a is independent of mSat)
|
|
163
|
-
* const mEarth = 5.972e24; // kg
|
|
164
|
-
* const rSat: [number, number, number] = [7.0e6, 0, 0]; // m
|
|
165
|
-
* const rEarth: [number, number, number] = [0, 0, 0];
|
|
166
|
-
*
|
|
167
|
-
* const a = gravitationalAccelerationOn1By2(mSat, mEarth, rSat, rEarth);
|
|
168
|
-
* // ≈ [-8.14, 0, 0] m/s² (toward Earth)
|
|
169
|
-
* ```
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```ts
|
|
173
|
-
* // Derive force from acceleration (F = m1 * a)
|
|
174
|
-
* const m1 = 1200; // kg spacecraft
|
|
175
|
-
* const a = gravitationalAccelerationOn1By2(m1, mEarth, rSat, rEarth);
|
|
176
|
-
* const F: [number, number, number] = [a[0]*m1, a[1]*m1, a[2]*m1]; // newtons
|
|
177
|
-
* ```
|
|
178
|
-
*
|
|
179
|
-
* @see https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
|
|
180
|
-
* @category Dynamics
|
|
181
|
-
*/
|
|
182
|
-
export const gravitationalAccelerationOn1By2 = (m2, r1, r2, G = G_SI) => {
|
|
183
|
-
const { direction, magnitude } = gravitationalForce(1, m2, r1, r2, G); // |F| on 1 kg == |a|
|
|
184
|
-
const a = [
|
|
185
|
-
direction[0] * magnitude,
|
|
186
|
-
direction[1] * magnitude,
|
|
187
|
-
direction[2] * magnitude
|
|
188
|
-
];
|
|
189
|
-
return a;
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* Gravitational **force vector** on body 1 due to body 2 (newtons, N).
|
|
193
|
-
*
|
|
194
|
-
* **Definitions**
|
|
195
|
-
*
|
|
196
|
-
* $$
|
|
197
|
-
* \mathbf r=\mathbf r_2-\mathbf r_1,\quad
|
|
198
|
-
* r=\lVert\mathbf r\rVert,\quad
|
|
199
|
-
* \hat{\mathbf r}=\frac{\mathbf r}{r}
|
|
200
|
-
* $$
|
|
201
|
-
*
|
|
202
|
-
* **Newton's law (vector form)**
|
|
203
|
-
*
|
|
204
|
-
* $$
|
|
205
|
-
* \mathbf F_{1\leftarrow2}
|
|
206
|
-
* = G\,\frac{m_1 m_2}{r^2}\,\hat{\mathbf r}
|
|
207
|
-
* $$
|
|
208
|
-
*
|
|
209
|
-
* **Magnitude & Components**
|
|
210
|
-
*
|
|
211
|
-
* $$
|
|
212
|
-
* \lVert\mathbf F\rVert=G\,\frac{m_1 m_2}{r^2},\qquad
|
|
213
|
-
* \mathbf F=\langle F_x,F_y,F_z\rangle=\lVert\mathbf F\rVert\,\hat{\mathbf r}
|
|
214
|
-
* $$
|
|
215
|
-
*
|
|
216
|
-
* $$
|
|
217
|
-
* F_x=\lVert\mathbf F\rVert\,\hat r_x,\quad
|
|
218
|
-
* F_y=\lVert\mathbf F\rVert\,\hat r_y,\quad
|
|
219
|
-
* F_z=\lVert\mathbf F\rVert\,\hat r_z
|
|
220
|
-
* $$
|
|
221
|
-
*
|
|
222
|
-
* **Newton's 3rd law (context)**
|
|
223
|
-
*
|
|
224
|
-
* $$
|
|
225
|
-
* \mathbf F_{1\leftarrow2}=-\,\mathbf F_{2\leftarrow1}
|
|
226
|
-
* $$
|
|
227
|
-
*
|
|
228
|
-
* **Units**
|
|
229
|
-
* - Inputs: masses in **kg**, positions in **m**, ($ G $) in **m³·kg⁻¹·s⁻²**.
|
|
230
|
-
* - Output: force vector in **newtons (N)**.
|
|
231
|
-
*
|
|
232
|
-
* ::: info
|
|
233
|
-
*
|
|
234
|
-
* - The returned vector points **from body 1 toward body 2** (i.e., along ($ \hat{\mathbf r} $)).
|
|
235
|
-
* - Internally delegates to `gravitationalForce(m1, m2, r1, r2, G)` and returns its
|
|
236
|
-
* direction-scaled magnitude as a 3-tuple.
|
|
237
|
-
* - For acceleration instead of force, use `gravitationalAccelerationOn1By2` or compute ($ \mathbf a=\mathbf F/m_1 $).
|
|
238
|
-
*
|
|
239
|
-
* :::
|
|
240
|
-
*
|
|
241
|
-
* **Invariants (within FP tolerance)**
|
|
242
|
-
* - `||F|| = G*m1*m2/r^2`
|
|
243
|
-
* - `F = ||F|| * r̂`
|
|
244
|
-
*
|
|
245
|
-
* @param {number} m1 Mass of body 1 (kg).
|
|
246
|
-
* @param {number} m2 Mass of body 2 (kg).
|
|
247
|
-
* @param {Vector3DTupleType} r1 Position of body 1 `[x, y, z]` in meters.
|
|
248
|
-
* @param {Vector3DTupleType} r2 Position of body 2 `[x, y, z]` in meters.
|
|
249
|
-
* @param {number} [G=G_SI] Gravitational constant.
|
|
250
|
-
* @returns {Vector3DTupleType} Force on body 1 due to body 2, in newtons `[Fx, Fy, Fz]`.
|
|
251
|
-
*
|
|
252
|
-
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} Propagated from `gravitationalForce` if inputs are invalid (non-finite/negative masses, coincident positions ($ r=0 $), or non-positive ($ G $)).
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* ```ts
|
|
256
|
-
* // Earth–Sun at ~1 AU (force on Earth due to Sun)
|
|
257
|
-
* const mEarth = 5.972e24; // kg
|
|
258
|
-
* const mSun = 1.9885e30; // kg
|
|
259
|
-
* const rEarth: [number, number, number] = [0, 0, 0];
|
|
260
|
-
* const rSun : [number, number, number] = [1.495978707e11, 0, 0]; // m
|
|
261
|
-
*
|
|
262
|
-
* const F = gravitationalForceOn1By2(mEarth, mSun, rEarth, rSun); // N
|
|
263
|
-
* const Fmag = Math.hypot(F[0], F[1], F[2]); // ≈ 3.54e22 N
|
|
264
|
-
* ```
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* ```ts
|
|
268
|
-
* // Derive acceleration from the returned force: a = F / m1
|
|
269
|
-
* const a: [number, number, number] = [F[0]/mEarth, F[1]/mEarth, F[2]/mEarth]; // m/s^2
|
|
270
|
-
* ```
|
|
271
|
-
*
|
|
272
|
-
* @see https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
|
|
273
|
-
* @category Dynamics
|
|
274
|
-
*/
|
|
275
|
-
export const gravitationalForceOn1By2 = (m1, m2, r1, r2, G = G_SI) => {
|
|
276
|
-
const { direction, magnitude } = gravitationalForce(m1, m2, r1, r2, G); // |F|
|
|
277
|
-
const F = [
|
|
278
|
-
direction[0] * magnitude,
|
|
279
|
-
direction[1] * magnitude,
|
|
280
|
-
direction[2] * magnitude
|
|
281
|
-
];
|
|
282
|
-
return F;
|
|
283
|
-
};
|
|
284
|
-
//# sourceMappingURL=law-of-gravitation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"law-of-gravitation.js","sourceRoot":"","sources":["../src/law-of-gravitation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAMrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,EAAU,EACV,EAAU,EACV,EAAqB,EACrB,EAAqB,EACrB,IAAY,IAAI,EACM,EAAE;IACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,E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AACX,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solve-kepler-bisection.d.ts","sourceRoot":"","sources":["../src/solve-kepler-bisection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,GAAG,OAAO,EACV,GAAG,MAAM,EACT,SAAS,MAAM,EACf,WAAW,MAAM,KAChB,OAwBF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solve-kepler-bisection.js","sourceRoot":"","sources":["../src/solve-kepler-bisection.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,CAAU,EACV,CAAS,EACT,OAAe,EACf,SAAiB,EACR,EAAE;IACX,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACrB,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,GAAG,OAAO,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC;YAC5B,OAAO,CAAC,CAAC,CAAC,YAAY;QACxB,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,MAAM,GAAG,CAAC,CAAC;QACb,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,CAAC,CAAC;QACZ,CAAC;QAED,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,EAAE,CAAC;IACT,CAAC;IAED,OAAO,CAAC,CAAC,CAAC,qBAAqB;AACjC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solve-kepler-high-eccentricity.d.ts","sourceRoot":"","sources":["../src/solve-kepler-high-eccentricity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,eAAO,MAAM,2BAA2B,GACtC,GAAG,OAAO,EACV,GAAG,MAAM,EACT,gBAAsE,EACtE,kBAAgB,KACf,OAgEF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solve-kepler-high-eccentricity.js","sourceRoot":"","sources":["../src/solve-kepler-high-eccentricity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,CAAU,EACV,CAAS,EACT,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtE,SAAS,GAAG,IAAI,EACP,EAAE;IACX,IA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,"file":"specific-mechanical-energy.d.ts","sourceRoot":"","sources":["../src/specific-mechanical-energy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,wBAAwB,GACnC,GAAG,MAAM,EACT,GAAG,MAAM,EACT,IAAI,MAAM,KACT,MAWF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specific-mechanical-energy.js","sourceRoot":"","sources":["../src/specific-mechanical-energy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,CAAS,EACT,CAAS,EACT,EAAU,EACF,EAAE;IACV,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAEpE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAE9D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAEzE,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"true-anomaly-to-mean-anomaly.d.ts","sourceRoot":"","sources":["../src/true-anomaly-to-mean-anomaly.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,eAAO,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S,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vis-viva-speed.d.ts","sourceRoot":"","sources":["../src/vis-viva-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAsC/D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vis-viva-speed.js","sourceRoot":"","sources":["../src/vis-viva-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAU,EAAU,EAAE;IACvE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,iEAAiE;QACjE,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;YACnB,kBAAkB;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,gDAAgD;IACpE,MAAM,QAAQ,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAErC,oEAAoE;IACpE,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAEvC,IAAI,QAAQ,GAAG,CAAC,GAAG;YAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB;QAExD,MAAM,IAAI,KAAK,CACb,uCAAuC,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAC9D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC,CAAC"}
|
package/dist/wrap-angle.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-angle.d.ts","sourceRoot":"","sources":["../src/wrap-angle.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,WAgBtC,CAAC"}
|
package/dist/wrap-angle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-angle.js","sourceRoot":"","sources":["../src/wrap-angle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEvD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,2CAA2C;AAClE,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,oCAAoC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,qCAAqC;IACrC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAEvB,yCAAyC;IACzC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO;QAAE,OAAO,CAAC,CAAC;IAEjD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO;QAAE,OAAO,CAAC,CAAC;IAEjD,IACE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,aAAa;QACxC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,aAAa;QAExC,OAAO,CAAC,CAAC;IAEX,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|