@interstellar-tools/constants 0.1.1 → 0.2.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/README.md +0 -8
- package/dist/distance.d.ts +1 -1
- package/dist/distance.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +1 -1
- package/dist/physics.d.ts +25 -0
- package/dist/physics.d.ts.map +1 -0
- package/dist/physics.js +25 -0
- package/dist/physics.js.map +1 -0
- package/dist/temporal.d.ts +1 -1
- package/dist/temporal.js +2 -2
- package/package.json +74 -2
package/README.md
CHANGED
|
@@ -5,14 +5,6 @@
|
|
|
5
5
|
- [Node.js](https://nodejs.org/) version 22.9.0 or higher
|
|
6
6
|
- npm version 11.5.1 or higher
|
|
7
7
|
|
|
8
|
-
::: code-group
|
|
9
|
-
|
|
10
8
|
```shell [npm]
|
|
11
9
|
npm i --save @interstellar-tools/constants
|
|
12
10
|
```
|
|
13
|
-
|
|
14
|
-
```shell [yarn]
|
|
15
|
-
yarn add @interstellar-tools/constants
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
:::
|
package/dist/distance.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - **Parsec** is defined by trigonometric parallax: `pc = au / tan(1″)`.
|
|
9
9
|
*
|
|
10
10
|
* @see https://www.bipm.org/en/publications/si-brochure (SI Brochure)
|
|
11
|
-
* @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2
|
|
11
|
+
* @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 - astronomical unit)
|
|
12
12
|
* @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year)
|
|
13
13
|
* @see https://en.wikipedia.org/wiki/Parsec (Parsec definition)
|
|
14
14
|
*/
|
package/dist/distance.js
CHANGED
|
@@ -9,7 +9,7 @@ import { JULIAN_YEAR_SECONDS } from './temporal';
|
|
|
9
9
|
* - **Parsec** is defined by trigonometric parallax: `pc = au / tan(1″)`.
|
|
10
10
|
*
|
|
11
11
|
* @see https://www.bipm.org/en/publications/si-brochure (SI Brochure)
|
|
12
|
-
* @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2
|
|
12
|
+
* @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 - astronomical unit)
|
|
13
13
|
* @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year)
|
|
14
14
|
* @see https://en.wikipedia.org/wiki/Parsec (Parsec definition)
|
|
15
15
|
*/
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,QAAQ,CAAC;AAEvB,cAAc,YAAY,CAAC;AAE3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,WAAW,CAAC;AAE1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,QAAQ,CAAC;AAEvB,cAAc,YAAY,CAAC;AAE3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,WAAW,CAAC;AAE1B,cAAc,YAAY,CAAC;AAE3B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,QAAQ,CAAC;AAEvB,cAAc,YAAY,CAAC;AAE3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,WAAW,CAAC;AAE1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,QAAQ,CAAC;AAEvB,cAAc,YAAY,CAAC;AAE3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,WAAW,CAAC;AAE1B,cAAc,YAAY,CAAC;AAE3B,cAAc,WAAW,CAAC"}
|
package/dist/math.d.ts
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* - Using **τ** often simplifies formulas that involve *full cycles* (e.g., Fourier analysis,
|
|
30
30
|
* rotations, oscillator phase), eliminating stray factors of 2.
|
|
31
31
|
* - `TWO_PI` is a runtime numeric constant; do not compare floating-point results using `===`
|
|
32
|
-
* when they involve trigonometric operations
|
|
32
|
+
* when they involve trigonometric operations-prefer tolerance checks.
|
|
33
33
|
*
|
|
34
34
|
* :::
|
|
35
35
|
*
|
package/dist/math.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* - Using **τ** often simplifies formulas that involve *full cycles* (e.g., Fourier analysis,
|
|
30
30
|
* rotations, oscillator phase), eliminating stray factors of 2.
|
|
31
31
|
* - `TWO_PI` is a runtime numeric constant; do not compare floating-point results using `===`
|
|
32
|
-
* when they involve trigonometric operations
|
|
32
|
+
* when they involve trigonometric operations-prefer tolerance checks.
|
|
33
33
|
*
|
|
34
34
|
* :::
|
|
35
35
|
*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gravitational constant **G** in SI units.
|
|
3
|
+
*
|
|
4
|
+
* Numerical value from CODATA 2018: `6.67430 × 10⁻¹¹ m³·kg⁻¹·s⁻²` (relative standard uncertainty 2.2e-5).
|
|
5
|
+
* Use this for Newtonian gravity calculations:
|
|
6
|
+
*
|
|
7
|
+
* $$
|
|
8
|
+
* F = G\,\frac{m_1 m_2}{r^2}
|
|
9
|
+
* $$
|
|
10
|
+
*
|
|
11
|
+
* @type {number}
|
|
12
|
+
* @default 6.67430e-11
|
|
13
|
+
*
|
|
14
|
+
* @see https://physics.nist.gov/cgi-bin/cuu/Value?bg
|
|
15
|
+
* @see https://en.wikipedia.org/wiki/Gravitational_constant
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Standard gravitational parameter (mu) for Earth:
|
|
20
|
+
* const M_earth = 5.97219e24; // kg
|
|
21
|
+
* const mu_earth = G_SI * M_earth; // ≈ 3.986004e14 m^3/s^2
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const G_SI: number;
|
|
25
|
+
//# sourceMappingURL=physics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physics.d.ts","sourceRoot":"","sources":["../src/physics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,IAAI,EAAE,MAAmB,CAAC"}
|
package/dist/physics.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gravitational constant **G** in SI units.
|
|
3
|
+
*
|
|
4
|
+
* Numerical value from CODATA 2018: `6.67430 × 10⁻¹¹ m³·kg⁻¹·s⁻²` (relative standard uncertainty 2.2e-5).
|
|
5
|
+
* Use this for Newtonian gravity calculations:
|
|
6
|
+
*
|
|
7
|
+
* $$
|
|
8
|
+
* F = G\,\frac{m_1 m_2}{r^2}
|
|
9
|
+
* $$
|
|
10
|
+
*
|
|
11
|
+
* @type {number}
|
|
12
|
+
* @default 6.67430e-11
|
|
13
|
+
*
|
|
14
|
+
* @see https://physics.nist.gov/cgi-bin/cuu/Value?bg
|
|
15
|
+
* @see https://en.wikipedia.org/wiki/Gravitational_constant
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Standard gravitational parameter (mu) for Earth:
|
|
20
|
+
* const M_earth = 5.97219e24; // kg
|
|
21
|
+
* const mu_earth = G_SI * M_earth; // ≈ 3.986004e14 m^3/s^2
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export const G_SI = 6.6743e-11;
|
|
25
|
+
//# sourceMappingURL=physics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physics.js","sourceRoot":"","sources":["../src/physics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAW,UAAU,CAAC"}
|
package/dist/temporal.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - **SI day**: exactly `86 400 s`.
|
|
7
7
|
* - **Julian year** (astronomy): exactly `365.25 d = 31 557 600 s`.
|
|
8
8
|
*
|
|
9
|
-
* @see https://www.bipm.org/en/publications/si-brochure (SI Brochure
|
|
9
|
+
* @see https://www.bipm.org/en/publications/si-brochure (SI Brochure - second & day)
|
|
10
10
|
* @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year definition)
|
|
11
11
|
*
|
|
12
12
|
* @example
|
package/dist/temporal.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - **SI day**: exactly `86 400 s`.
|
|
7
7
|
* - **Julian year** (astronomy): exactly `365.25 d = 31 557 600 s`.
|
|
8
8
|
*
|
|
9
|
-
* @see https://www.bipm.org/en/publications/si-brochure (SI Brochure
|
|
9
|
+
* @see https://www.bipm.org/en/publications/si-brochure (SI Brochure - second & day)
|
|
10
10
|
* @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year definition)
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
@@ -38,7 +38,7 @@ export const MILLISECONDS_PER_SECOND = 1000;
|
|
|
38
38
|
* @category Temporal
|
|
39
39
|
*/
|
|
40
40
|
export const MILLISECONDS_PER_DAY = SECONDS_PER_DAY * MILLISECONDS_PER_SECOND;
|
|
41
|
-
// Julian year (astronomy)
|
|
41
|
+
// Julian year (astronomy) - EXACT 365.25 d
|
|
42
42
|
/**
|
|
43
43
|
* Length of the **Julian year** in SI days (exactly 365.25).
|
|
44
44
|
* @category Temporal
|
package/package.json
CHANGED
|
@@ -1,9 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interstellar-tools/constants",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "constants",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
6
|
+
"interstellar",
|
|
7
|
+
"tools",
|
|
8
|
+
"near",
|
|
9
|
+
"earth",
|
|
10
|
+
"objects",
|
|
11
|
+
"planets",
|
|
12
|
+
"orbit",
|
|
13
|
+
"rotation",
|
|
14
|
+
"stars",
|
|
15
|
+
"star",
|
|
16
|
+
"sun",
|
|
17
|
+
"planet",
|
|
18
|
+
"earth",
|
|
19
|
+
"moon",
|
|
20
|
+
"mercury",
|
|
21
|
+
"venus",
|
|
22
|
+
"mars",
|
|
23
|
+
"tellus",
|
|
24
|
+
"gaia",
|
|
25
|
+
"jupiter",
|
|
26
|
+
"saturn",
|
|
27
|
+
"neptune",
|
|
28
|
+
"pluto",
|
|
29
|
+
"dwarf",
|
|
30
|
+
"planets",
|
|
31
|
+
"trajectory",
|
|
32
|
+
"asteroids",
|
|
33
|
+
"comets",
|
|
34
|
+
"collision",
|
|
35
|
+
"satellite",
|
|
36
|
+
"satellites",
|
|
37
|
+
"sky map",
|
|
38
|
+
"nasa",
|
|
39
|
+
"jpl",
|
|
40
|
+
"esa",
|
|
41
|
+
"astrodynamics",
|
|
42
|
+
"orbital-mechanics",
|
|
43
|
+
"celestial-mechanics",
|
|
44
|
+
"two-body",
|
|
45
|
+
"n-body",
|
|
46
|
+
"gravity",
|
|
47
|
+
"newtonian-gravity",
|
|
48
|
+
"newtons-law-of-gravitation",
|
|
49
|
+
"gravitational-constant",
|
|
50
|
+
"G_SI",
|
|
51
|
+
"standard-gravitational-parameter",
|
|
52
|
+
"gravitational-parameter",
|
|
53
|
+
"mu",
|
|
54
|
+
"gravitational-force",
|
|
55
|
+
"gravitational-acceleration",
|
|
56
|
+
"specific-mechanical-energy",
|
|
57
|
+
"vis-viva",
|
|
58
|
+
"kepler-period",
|
|
59
|
+
"keplers-third-law",
|
|
60
|
+
"orbital-speed",
|
|
61
|
+
"trajectory",
|
|
62
|
+
"orbit",
|
|
63
|
+
"satellite",
|
|
64
|
+
"simulation",
|
|
65
|
+
"numerics",
|
|
66
|
+
"si-units",
|
|
67
|
+
"vector3",
|
|
68
|
+
"vec3",
|
|
69
|
+
"vector-math",
|
|
70
|
+
"typescript",
|
|
71
|
+
"javascript",
|
|
72
|
+
"interstellar-tools",
|
|
73
|
+
"spaceflight",
|
|
74
|
+
"space-dynamics",
|
|
75
|
+
"heliocentric",
|
|
76
|
+
"leo",
|
|
77
|
+
"geo",
|
|
78
|
+
"earth-sun"
|
|
7
79
|
],
|
|
8
80
|
"homepage": "https://phun-ky.net/projects/interstellar-tools",
|
|
9
81
|
"bugs": {
|