@interstellar-tools/types 0.2.0 → 0.3.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.
@@ -8,7 +8,7 @@ import { CartesianCoordinatesInterface } from './planets';
8
8
  * - **Color and Opacity**: Used for visualization.
9
9
  * - **Orbit Path (Optional)**: Stores a precomputed path for asteroid positioning.
10
10
  *
11
- * @category Celestial Bodies
11
+ * @group Celestial Bodies
12
12
  */
13
13
  export interface AsteroidBeltInterface {
14
14
  /** Name of the asteroid belt. */
@@ -41,7 +41,7 @@ export interface AsteroidBeltInterface {
41
41
  * density: 100,
42
42
  * };
43
43
  * ```
44
- * @category Celestial Bodies
44
+ * @group Celestial Bodies
45
45
  */
46
46
  export type AsteroidBeltsType = AsteroidBeltInterface[];
47
47
  //# sourceMappingURL=asteroid-belts.d.ts.map
@@ -17,7 +17,7 @@ import { CartesianCoordinatesInterface } from './planets';
17
17
  *
18
18
  * :::
19
19
  *
20
- * @category Celestial Bodies
20
+ * @group Celestial Bodies
21
21
  */
22
22
  export type AsteroidType = 'main-belt asteroid' | 'near-earth asteroid' | 'trojan asteroid' | 'centaur' | 'trans-neptunian object';
23
23
  /**
@@ -32,7 +32,7 @@ export type AsteroidType = 'main-belt asteroid' | 'near-earth asteroid' | 'troja
32
32
  *
33
33
  * :::
34
34
  *
35
- * @category Celestial Bodies
35
+ * @group Celestial Bodies
36
36
  */
37
37
  export type AsteroidCategory = 'dwarf planet' | 'large asteroid' | 'amor group' | 'apollo group' | 'aten group' | 'atira group' | 'cybele group' | 'hilda group' | 'jupiter trojan' | 'plutino' | 'cubewano' | 'scattered disk object';
38
38
  /**
@@ -48,7 +48,7 @@ export type AsteroidCategory = 'dwarf planet' | 'large asteroid' | 'amor group'
48
48
  *
49
49
  * :::
50
50
  *
51
- * @category Celestial Bodies
51
+ * @group Celestial Bodies
52
52
  */
53
53
  export type AsteroidSpectralType = 'c-type' | 's-type' | 'v-type' | 'm-type' | 'b-type' | 'd-type' | 'p-type' | 'f-type' | 'g-type' | 'x-type' | 'e-type' | 'other';
54
54
  /**
@@ -80,7 +80,7 @@ export type AsteroidSpectralType = 'c-type' | 's-type' | 'v-type' | 'm-type' | '
80
80
  *
81
81
  * :::
82
82
  *
83
- * @category Celestial Bodies
83
+ * @group Celestial Bodies
84
84
  */
85
85
  export interface AsteroidInterface {
86
86
  /** Name of the asteroid (e.g., `"Ceres"`, `"Vesta"`). */
@@ -185,7 +185,7 @@ export interface AsteroidInterface {
185
185
  }
186
186
  /**
187
187
  * Convenience alias for a list of asteroids.
188
- * @category Celestial Bodies
188
+ * @group Celestial Bodies
189
189
  */
190
190
  export type AsteroidsType = AsteroidInterface[];
191
191
  //# sourceMappingURL=asteroids.d.ts.map
@@ -21,7 +21,7 @@ import { StarInterface, StarsType } from './stars';
21
21
  * { name: 'Earth', type: 'planet', mass: 5.972e24 }
22
22
  * ];
23
23
  * ```
24
- * @category Celestial Bodies
24
+ * @group Celestial Bodies
25
25
  */
26
26
  export type CelestialBodiesType = StarsType | PlanetsType | MoonsType | CometsType | AsteroidsType;
27
27
  /**
@@ -39,7 +39,7 @@ export type CelestialBodiesType = StarsType | PlanetsType | MoonsType | CometsTy
39
39
  * ```ts
40
40
  * const earth: CelestialBodyType = { name: 'Earth', type: 'planet', mass: 5.972e24 };
41
41
  * ```
42
- * @category Celestial Bodies
42
+ * @group Celestial Bodies
43
43
  */
44
44
  export type CelestialBodyType = StarInterface | PlanetInterface | MoonInterface | CometInterface | AsteroidInterface;
45
45
  //# sourceMappingURL=celestial-bodies.d.ts.map
@@ -18,7 +18,7 @@ import { CartesianCoordinatesInterface } from './planets';
18
18
  * - **Color (`color`)**: Used for visual representation.
19
19
  * - **Size (`size`)**: Scaled size for display (not the actual physical size).
20
20
  *
21
- * @category Celestial Bodies
21
+ * @group Celestial Bodies
22
22
  */
23
23
  export interface CometInterface {
24
24
  /** Name of the comet (e.g., "Halley", "Hale-Bopp"). */
@@ -88,7 +88,7 @@ export interface CometInterface {
88
88
  * size: 1.2
89
89
  * };
90
90
  * ```
91
- * @category Celestial Bodies
91
+ * @group Celestial Bodies
92
92
  */
93
93
  export type CometsType = CometInterface[];
94
94
  //# sourceMappingURL=comets.d.ts.map
@@ -17,7 +17,7 @@ import { DistanceInterface } from '../distance';
17
17
  * y: { value: 0, unit: 'au' }
18
18
  * };
19
19
  * ```
20
- * @category Celestial Bodies
20
+ * @group Celestial Bodies
21
21
  */
22
22
  export interface BlackHoleInterface {
23
23
  /** Name of the central black hole. */
@@ -51,7 +51,7 @@ export interface BlackHoleInterface {
51
51
  * blackHole: sagittariusA
52
52
  * };
53
53
  * ```
54
- * @category Celestial Bodies
54
+ * @group Celestial Bodies
55
55
  */
56
56
  export interface GalaxyInterface {
57
57
  /** Name of the galaxy. */
@@ -69,14 +69,14 @@ export interface GalaxyInterface {
69
69
  * Type alias for a collection of **galaxies**.
70
70
  *
71
71
  * @typedef {GalaxyInterface[]} GalaxiesType
72
- * @category Celestial Bodies
72
+ * @group Celestial Bodies
73
73
  */
74
74
  export type GalaxiesType = GalaxyInterface[];
75
75
  /**
76
76
  * Type alias for a collection of **black holes**.
77
77
  *
78
78
  * @typedef {BlackHoleInterface[]} BlackHolesType
79
- * @category Celestial Bodies
79
+ * @group Celestial Bodies
80
80
  */
81
81
  export type BlackHolesType = BlackHoleInterface[];
82
82
  //# sourceMappingURL=galaxies.d.ts.map
@@ -30,7 +30,7 @@ import { CartesianCoordinatesInterface } from './planets';
30
30
  * angle: 0,
31
31
  * };
32
32
  * ```
33
- * @category Celestial Bodies
33
+ * @group Celestial Bodies
34
34
  */
35
35
  export interface MoonInterface {
36
36
  /** Name of the moon (e.g., "Io", "Europa", "Titan"). */
@@ -69,7 +69,7 @@ export interface MoonInterface {
69
69
  * Type alias for a collection of **moons**.
70
70
  *
71
71
  * @typedef {MoonInterface[]} MoonsType
72
- * @category Celestial Bodies
72
+ * @group Celestial Bodies
73
73
  */
74
74
  export type MoonsType = MoonInterface[];
75
75
  //# sourceMappingURL=moons.d.ts.map
@@ -11,7 +11,7 @@ import { TemporalInterface } from '../temporal';
11
11
  * ```ts
12
12
  * const position: CartesianCoordinatesInterface = { x: 100, y: 200 };
13
13
  * ```
14
- * @category Celestial Bodies
14
+ * @group Celestial Bodies
15
15
  */
16
16
  export interface CartesianCoordinatesInterface {
17
17
  x: number;
@@ -50,7 +50,7 @@ export interface CartesianCoordinatesInterface {
50
50
  * z: { value: 0, unit: 'au' }
51
51
  * };
52
52
  * ```
53
- * @category Celestial Bodies
53
+ * @group Celestial Bodies
54
54
  */
55
55
  export interface PlanetInterface {
56
56
  /** Name of the planet (e.g., "Earth", "Mars"). */
@@ -90,7 +90,7 @@ export interface PlanetInterface {
90
90
  * Type alias for a collection of **planets**.
91
91
  *
92
92
  * @typedef {PlanetInterface[]} PlanetsType
93
- * @category Celestial Bodies
93
+ * @group Celestial Bodies
94
94
  */
95
95
  export type PlanetsType = PlanetInterface[];
96
96
  //# sourceMappingURL=planets.d.ts.map
@@ -15,7 +15,7 @@ import { CartesianCoordinatesInterface } from './planets';
15
15
  * type: 'planetary system'
16
16
  * };
17
17
  * ```
18
- * @category Celestial Bodies
18
+ * @group Celestial Bodies
19
19
  */
20
20
  export interface StarSystemInterface {
21
21
  name: string;
@@ -54,7 +54,7 @@ export interface StarSystemInterface {
54
54
  * z: { value: 0, unit: 'au' }
55
55
  * };
56
56
  * ```
57
- * @category Celestial Bodies
57
+ * @group Celestial Bodies
58
58
  */
59
59
  export interface StarInterface {
60
60
  /** Name of the star. */
@@ -94,7 +94,7 @@ export interface StarInterface {
94
94
  * Type alias for a collection of **stars**.
95
95
  *
96
96
  * @typedef {StarInterface[]} StarsType
97
- * @category Celestial Bodies
97
+ * @group Celestial Bodies
98
98
  */
99
99
  export type StarsType = StarInterface[];
100
100
  //# sourceMappingURL=stars.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Represents a star system within the space visualization.
3
- * @category Celestial Bodies
3
+ * @group Celestial Bodies
4
4
  */
5
5
  export interface SystemInterface {
6
6
  /** Name of the star system. */
@@ -12,7 +12,7 @@ export interface SystemInterface {
12
12
  }
13
13
  /**
14
14
  * Type alias for a collection of star systems.
15
- * @category Celestial Bodies
15
+ * @group Celestial Bodies
16
16
  */
17
17
  export type SystemsType = SystemInterface[];
18
18
  //# sourceMappingURL=systems.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { ValueInterface } from './numeric';
2
2
  /**
3
- * @showCategories
3
+ *
4
4
  * @module
5
5
  */
6
6
  /**
@@ -36,7 +36,7 @@ import { ValueInterface } from './numeric';
36
36
  * @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 - definition of the astronomical unit)
37
37
  * @see https://en.wikipedia.org/wiki/Light-year (Light-year based on Julian year)
38
38
  * @see https://en.wikipedia.org/wiki/Parsec (Parsec definition & meter equivalence)
39
- * @category Distance
39
+ * @group Distance
40
40
  */
41
41
  export type DistanceUnitType = 'm' | 'km' | 'au' | 'ly' | 'kly' | 'Mly' | 'Gly' | 'pc' | 'kpc' | 'Mpc' | 'Gpc';
42
42
  /**
@@ -75,7 +75,7 @@ export type DistanceUnitType = 'm' | 'km' | 'au' | 'ly' | 'kly' | 'Mly' | 'Gly'
75
75
  * @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 - astronomical unit, symbol "au")
76
76
  * @see https://en.wikipedia.org/wiki/Light-year (Light-year; Julian-year convention)
77
77
  * @see https://en.wikipedia.org/wiki/Parsec (Parsec definition)
78
- * @category Distance
78
+ * @group Distance
79
79
  */
80
80
  export type DistanceUnitAliasType = 'meter' | 'meters' | 'metre' | 'metres' | 'kilometer' | 'kilometers' | 'kilometre' | 'kilometres' | 'AU' | 'Au' | 'astronomical-unit' | 'astronomical-units' | 'astronomical unit' | 'astronomical units' | 'lightyear' | 'lightyears' | 'light-year' | 'light-years' | 'kilolightyear' | 'kilolightyears' | 'kly' | 'megalightyear' | 'megalightyears' | 'Mly' | 'gigalightyear' | 'gigalightyears' | 'Gly' | 'parsec' | 'parsecs' | 'kiloparsec' | 'kiloparsecs' | 'kpc' | 'megaparsec' | 'megaparsecs' | 'Mpc' | 'gigaparsec' | 'gigaparsecs' | 'Gpc';
81
81
  /**
@@ -88,7 +88,7 @@ export type DistanceUnitAliasType = 'meter' | 'meters' | 'metre' | 'metres' | 'k
88
88
  * ```ts
89
89
  * const planetRadius: MeasureInterface = { value: 6371, unit: 'km' };
90
90
  * ```
91
- * @category Distance
91
+ * @group Distance
92
92
  */
93
93
  export interface MeasureInterface extends ValueInterface {
94
94
  unit: DistanceUnitType;
@@ -103,7 +103,7 @@ export interface MeasureInterface extends ValueInterface {
103
103
  * ```ts
104
104
  * const distanceToAlphaCentauri: DistanceInterface = { value: 4.367, unit: 'lightyears' };
105
105
  * ```
106
- * @category Distance
106
+ * @group Distance
107
107
  */
108
108
  export interface DistanceInterface extends ValueInterface {
109
109
  unit: DistanceUnitType;
package/dist/numeric.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @showCategories
2
+ *
3
3
  * @module
4
4
  */
5
5
  /**
@@ -11,7 +11,7 @@
11
11
  * ```ts
12
12
  * const distance: ValueInterface = { value: 100 };
13
13
  * ```
14
- * @category Numeric
14
+ * @group Numeric
15
15
  */
16
16
  export interface ValueInterface {
17
17
  value: number;
@@ -25,7 +25,7 @@ export interface ValueInterface {
25
25
  * ```ts
26
26
  * const angle: Radians = Math.PI / 2; // 90 degrees in radians
27
27
  * ```
28
- * @category Numeric
28
+ * @group Numeric
29
29
  */
30
30
  export type Radians = number;
31
31
  //# sourceMappingURL=numeric.d.ts.map
package/dist/numeric.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @showCategories
2
+ *
3
3
  * @module
4
4
  */
5
5
  export {};
package/dist/physics.d.ts CHANGED
@@ -27,9 +27,9 @@ import { Vector3DTupleType } from './math';
27
27
  * $$
28
28
  *
29
29
  * **Mappings to fields**
30
- * - `vector` ↔ \( \mathbf F \)
31
- * - `magnitude` ↔ \( \|\mathbf F\| \)
32
- * - `direction` ↔ \( \hat{\mathbf r} \)
30
+ * - `vector` ↔ ($ \mathbf F $)
31
+ * - `magnitude` ↔ ($ \|\mathbf F\| $)
32
+ * - `direction` ↔ ($ \hat{\mathbf r} $)
33
33
  *
34
34
  * @property vector Force vector on body 1 due to body 2 (N).
35
35
  * @property magnitude Scalar magnitude of the force (N).
@@ -54,4 +54,44 @@ export interface ForceResultInterface {
54
54
  /** Unit direction from body 1 to body 2 (dimensionless). */
55
55
  readonly direction: Vector3DTupleType;
56
56
  }
57
+ /**
58
+ * **Peri/apoapsis radii pair**.
59
+ *
60
+ * **Definitions**
61
+ *
62
+ * $$
63
+ * r_p = a(1-e),\qquad r_a = a(1+e)
64
+ * $$
65
+ *
66
+ * **Conic validity**
67
+ * - **Elliptic / circular** (($ a>0,\;0\le e<1 $)): both ($ r_p>0 $) and ($ r_a>0 $).
68
+ * - **Hyperbolic** (($ a<0,\;e>1 $)): ($ r_p = |a|(e-1) > 0 $) and **no apoapsis** (unbounded), so set `ra = null`.
69
+ * - **Parabolic** (($ e=1 $)) with finite ($ a $) is not represented; use parabolic relations or state vectors.
70
+ *
71
+ * **Units**
72
+ * - Values are in **meters (m)**.
73
+ *
74
+ * @property {number} rp Periapsis radius ($ r_p $) (m).
75
+ * @property {number|null} ra Apoapsis radius ($ r_a $) (m) for closed orbits; `null` for hyperbolic trajectories.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * // Elliptic example
80
+ * const radii: PeriApoRadiiType = { rp: 6930e3, ra: 7070e3 };
81
+ * ```
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * // Hyperbolic example - no apoapsis
86
+ * const flyby: PeriApoRadiiType = { rp: 10_000e3, ra: null };
87
+ * ```
88
+ *
89
+ * @see periApoapsisRadii - function that computes `{ rp, ra }` from `(a, e)`.
90
+ * @see https://en.wikipedia.org/wiki/Apsis
91
+ * @group Orbits
92
+ */
93
+ export type PeriApoRadiiType = {
94
+ rp: number;
95
+ ra: number | null;
96
+ };
57
97
  //# sourceMappingURL=physics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"physics.d.ts","sourceRoot":"","sources":["../src/physics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;CACvC"}
1
+ {"version":3,"file":"physics.d.ts","sourceRoot":"","sources":["../src/physics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { ValueInterface } from './numeric';
2
2
  /**
3
- * @showCategories
3
+ *
4
4
  * @module
5
5
  */
6
6
  /**
@@ -30,7 +30,7 @@ import { ValueInterface } from './numeric';
30
30
  *
31
31
  * @see https://www.bipm.org/en/publications/si-brochure ([SI](https://en.wikipedia.org/wiki/International_System_of_Units) Brochure - second & day)
32
32
  * @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year used for `yr`)
33
- * @category Temporal
33
+ * @group Temporal
34
34
  */
35
35
  export type TemporalUnitType = 's' | 'ms' | 'μs' | 'ns' | 'ps' | 'fs' | 'as' | 'zs' | 'ys' | 'min' | 'h' | 'd' | 'yr' | 'kyr' | 'Myr' | 'Gyr';
36
36
  /**
@@ -57,7 +57,7 @@ export type TemporalUnitType = 's' | 'ms' | 'μs' | 'ns' | 'ps' | 'fs' | 'as' |
57
57
  * @see https://www.bipm.org/en/publications/si-brochure ([SI](https://en.wikipedia.org/wiki/International_System_of_Units) Brochure - second & day)
58
58
  * @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year used for `yr`/`kyr`/`Myr`/`Gyr`)
59
59
  * @see https://en.wikipedia.org/wiki/Year#SI_multiples (Usage of `ka`/`Ma`/`Ga` vs `kyr`/`Myr`/`Gyr`)
60
- * @category Temporal
60
+ * @group Temporal
61
61
  */
62
62
  export type TemporalUnitAliasType = 'second' | 'seconds' | 'millisecond' | 'milliseconds' | 'microsecond' | 'microseconds' | 'us' | 'minute' | 'minutes' | 'hour' | 'hours' | 'day' | 'days' | 'year' | 'years' | 'yr' | 'yrs' | 'kiloyear' | 'kiloyears' | 'kyr' | 'megayear' | 'megayears' | 'megaannum' | 'megaannums' | 'Myr' | 'Ma' | 'gigayear' | 'gigayears' | 'gigaannum' | 'gigaannums' | 'Gyr' | 'Ga';
63
63
  /**
@@ -76,7 +76,7 @@ export type TemporalUnitAliasType = 'second' | 'seconds' | 'millisecond' | 'mill
76
76
  *
77
77
  *
78
78
  * @see {@link TemporalUnitType}
79
- * @category Temporal
79
+ * @group Temporal
80
80
  */
81
81
  export interface TemporalInterface extends ValueInterface {
82
82
  /** Canonical temporal unit symbol (case-sensitive). */
@@ -92,7 +92,7 @@ export interface TemporalInterface extends ValueInterface {
92
92
  * ```ts
93
93
  * const timeStep: TimeStepInterface = { value: 1, unit: 'day' };
94
94
  * ```
95
- * @category Temporal
95
+ * @group Temporal
96
96
  */
97
97
  export interface TimeStepInterface extends ValueInterface {
98
98
  unit: 'd';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interstellar-tools/types",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "types",
5
5
  "keywords": [
6
6
  "types",