@interstellar-tools/types 0.62.0 → 0.64.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.
@@ -1,9 +1,10 @@
1
+ import type { DistanceInterface } from '../distance.js';
1
2
  import type { DisplayInterface } from './display.js';
2
3
  /**
3
4
  * Represents an asteroid belt within the solar system simulation.
4
5
  *
5
6
  * **Asteroid Belt Properties:**
6
- * - **Inner and Outer Radius**: Defines the spatial boundaries of the belt in **Astronomical Units (AU)**.
7
+ * - **Inner and Outer Radius**: The belt's boundaries, as distances from the parent.
7
8
  * - **Drawing (`display`)**: colour, opacity, and density (how many asteroids to draw); see
8
9
  * {@link DisplayInterface}.
9
10
  *
@@ -16,10 +17,10 @@ export interface AsteroidBeltInterface {
16
17
  name: string;
17
18
  /** Id of the star the belt orbits (e.g., `'sun'`). */
18
19
  parent: string;
19
- /** Inner radius of the belt in Astronomical Units (AU). */
20
- innerRadius: number;
21
- /** Outer radius of the belt in Astronomical Units (AU). */
22
- outerRadius: number;
20
+ /** Inner radius of the belt, from the parent. */
21
+ innerRadius: DistanceInterface;
22
+ /** Outer radius of the belt, from the parent. */
23
+ outerRadius: DistanceInterface;
23
24
  /** How to draw the belt: colour, opacity and density, and state a renderer computes. */
24
25
  display?: DisplayInterface;
25
26
  }
@@ -33,8 +34,8 @@ export interface AsteroidBeltInterface {
33
34
  * id: 'main-asteroid-belt',
34
35
  * name: 'Main Belt',
35
36
  * parent: 'sun',
36
- * innerRadius: 2.1,
37
- * outerRadius: 3.3,
37
+ * innerRadius: { value: 2.1, unit: 'au' },
38
+ * outerRadius: { value: 3.3, unit: 'au' },
38
39
  * display: { color: '#888888', opacity: 0.5, density: 100 }
39
40
  * }];
40
41
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"asteroid-belts.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/asteroid-belts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"asteroid-belts.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/asteroid-belts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,WAAW,EAAE,iBAAiB,CAAC;IAC/B,iDAAiD;IACjD,WAAW,EAAE,iBAAiB,CAAC;IAC/B,wFAAwF;IACxF,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { DistanceInterface } from '../distance.js';
2
- import type { OrbitInterface } from '../orbits.js';
2
+ import type { FullOrbitInterface } from '../orbits.js';
3
3
  import type { DisplayInterface } from './display.js';
4
4
  /**
5
5
  * High-level **orbital class** of an asteroid (by dynamical region).
@@ -70,9 +70,8 @@ export type AsteroidSpectralType = 'c-type' | 's-type' | 'v-type' | 'm-type' | '
70
70
  * q \;=\; a\,(1 - e)
71
71
  * $$
72
72
  *
73
- * **Period convention:** `period` is a duration (e.g., in **days**).
74
- * If you encode direction, a **negative value** indicates **counter-clockwise** in your display
75
- * convention (visualization-specific; not a physical requirement).
73
+ * **Period convention:** `period` is a positive duration (e.g., in **days**).
74
+ * A retrograde orbit (`i > 90°`) has `retrograde: true`.
76
75
  *
77
76
  * **Coordinates:** Optional `x,y,z` are distances in a chosen reference frame (e.g., ecliptic
78
77
  * J2000). Always document the frame you use in calling code.
@@ -95,7 +94,7 @@ export interface AsteroidInterface {
95
94
  /** Id of the star the asteroid orbits (e.g., `'sun'`). */
96
95
  parent: string;
97
96
  /** Orbit around the parent, with all elements including `i`, `w`, `om` and `q`. */
98
- orbit: Required<OrbitInterface>;
97
+ orbit: FullOrbitInterface;
99
98
  /**
100
99
  * Optional **Cartesian coordinates** (distance values) in a specified frame.
101
100
  * ::: info
@@ -1 +1 @@
1
- {"version":3,"file":"asteroids.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/asteroids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,YAAY,GACpB,oBAAoB,GACpB,qBAAqB,GACrB,iBAAiB,GACjB,SAAS,GACT,wBAAwB,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,aAAa,GACb,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,SAAS,GACT,UAAU,GACV,uBAAuB,CAAC;AAE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AAG,iBAAiB,EAAE,CAAC"}
@@ -1,29 +1,22 @@
1
- import { AsteroidInterface, AsteroidsType } from './asteroids.js';
2
- import { CometInterface, CometsType } from './comets.js';
3
- import { MoonInterface, MoonsType } from './moons.js';
4
- import { PlanetInterface, PlanetsType } from './planets.js';
5
- import { StarInterface, StarsType } from './stars.js';
1
+ import type { AsteroidInterface } from './asteroids.js';
2
+ import type { CometInterface } from './comets.js';
3
+ import type { MoonInterface } from './moons.js';
4
+ import type { PlanetInterface } from './planets.js';
5
+ import type { StarInterface } from './stars.js';
6
6
  /**
7
- * Type alias representing a collection of celestial bodies.
8
- *
9
- * Includes:
10
- * - **Stars** (`StarsType`)
11
- * - **Planets** (`PlanetsType`)
12
- * - **Moons** (`MoonsType`)
13
- * - **Comets** (`CometsType`)
14
- *
15
- * @typedef {StarsType | PlanetsType | MoonsType | CometsType | AsteroidsType} CelestialBodiesType
7
+ * A list of celestial bodies of any kind: stars, planets, moons, comets and
8
+ * asteroids, mixed.
16
9
  *
17
10
  * @example
18
11
  * ```ts
19
- * const celestialObjects: CelestialBodiesType = [
20
- * { name: 'Sun', type: 'star', mass: 1.989e30 },
21
- * { name: 'Earth', type: 'planet', mass: 5.972e24 }
22
- * ];
12
+ * import { MOONS, PLANETS, STARS } from '@interstellar-tools/constants';
13
+ *
14
+ * const solarSystem: CelestialBodiesType = [...STARS, ...PLANETS, ...MOONS];
15
+ * const earth = solarSystem.find((body) => body.id === 'earth');
23
16
  * ```
24
17
  * @group Celestial Bodies
25
18
  */
26
- export type CelestialBodiesType = StarsType | PlanetsType | MoonsType | CometsType | AsteroidsType;
19
+ export type CelestialBodiesType = CelestialBodyType[];
27
20
  /**
28
21
  * Type alias representing a single celestial body.
29
22
  *
@@ -37,7 +30,7 @@ export type CelestialBodiesType = StarsType | PlanetsType | MoonsType | CometsTy
37
30
  *
38
31
  * @example
39
32
  * ```ts
40
- * const earth: CelestialBodyType = { name: 'Earth', type: 'planet', mass: 5.972e24 };
33
+ * const describe = (body: CelestialBodyType) => `${body.name}, bound to ${body.parent}`;
41
34
  * ```
42
35
  * @group Celestial Bodies
43
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"celestial-bodies.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/celestial-bodies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,mBAAmB,GAC7B,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,eAAe,GACf,aAAa,GACb,cAAc,GACd,iBAAiB,CAAC"}
1
+ {"version":3,"file":"celestial-bodies.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/celestial-bodies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,EAAE,CAAC;AAEtD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,eAAe,GACf,aAAa,GACb,cAAc,GACd,iBAAiB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { DistanceInterface } from '../distance.js';
2
- import type { OrbitInterface } from '../orbits.js';
2
+ import type { FullOrbitInterface } from '../orbits.js';
3
3
  import type { DisplayInterface } from './display.js';
4
4
  /**
5
5
  * Represents a **comet** in the solar system simulation.
@@ -10,7 +10,8 @@ import type { DisplayInterface } from './display.js';
10
10
  * - **Inclination (`i`)**: The tilt of the orbit relative to the **ecliptic plane**, measured in **degrees**.
11
11
  * - **Argument of perihelion (`w`)**: The angle from the **ascending node** to the **perihelion**.
12
12
  * - **Longitude of the ascending node (`om`)**: Defines where the orbit crosses the ecliptic.
13
- * - **Perihelion distance (`q`)**: The closest approach to the Sun in **AU**.
13
+ * - **Perihelion distance (`q`)**: The closest approach to the Sun, as a distance.
14
+ * - **Direction (`retrograde`)**: `true` when `i > 90°`, like Halley's comet.
14
15
  * - **Angle (`angle`)**: The **true anomaly** at J2000, as for every other body.
15
16
  *
16
17
  * **Drawing (`display`)**: colour and a scaled drawing size (not the physical
@@ -30,7 +31,7 @@ export interface CometInterface {
30
31
  /** Id of the star the comet orbits (e.g., `'sun'`). */
31
32
  parent: string;
32
33
  /** Orbit around the parent, with all elements including `i`, `w`, `om` and `q`. */
33
- orbit: Required<OrbitInterface>;
34
+ orbit: FullOrbitInterface;
34
35
  /** X-coordinate in a distance-based system (optional). */
35
36
  x?: DistanceInterface;
36
37
  /** Y-coordinate in a distance-based system (optional). */
@@ -57,12 +58,13 @@ export interface CometInterface {
57
58
  * orbit: {
58
59
  * a: { value: 17.834, unit: 'au' },
59
60
  * e: 0.96714,
60
- * i: 162.26,
61
- * w: 111.33,
62
- * om: 58.42,
61
+ * i: 162.26 as DegreesType,
62
+ * w: 111.33 as DegreesType,
63
+ * om: 58.42 as DegreesType,
63
64
  * angle: 2.97966 as Radians,
64
65
  * period: { value: 27576, unit: 'd' },
65
- * q: 0.586
66
+ * retrograde: true,
67
+ * q: { value: 0.586, unit: 'au' }
66
68
  * },
67
69
  * radius: { value: 11, unit: 'km' },
68
70
  * display: { color: '#ffffff', size: 1.2 }
@@ -1 +1 @@
1
- {"version":3,"file":"comets.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/comets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;IACnE,4CAA4C;IAC5C,QAAQ,EAAE,mBAAmB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;IAC7E,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAChC,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,wDAAwD;IACxD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,uFAAuF;IACvF,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"comets.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/comets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;IACnE,4CAA4C;IAC5C,QAAQ,EAAE,mBAAmB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;IAC7E,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,KAAK,EAAE,kBAAkB,CAAC;IAC1B,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,wDAAwD;IACxD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,uFAAuF;IACvF,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC"}
@@ -21,7 +21,7 @@ import type { DisplayInterface } from './display.js';
21
21
  * orbit: {
22
22
  * a: { value: 0.00448, unit: 'au' },
23
23
  * e: 0.009,
24
- * period: { value: -3.551, unit: 'd' },
24
+ * period: { value: 3.551, unit: 'd' },
25
25
  * angle: 0 as Radians
26
26
  * },
27
27
  * radius: { value: 1560.8, unit: 'km' },
@@ -44,6 +44,11 @@ export interface MoonInterface {
44
44
  orbit: OrbitInterface;
45
45
  /** Physical radius of the moon in kilometres. */
46
46
  radius: DistanceInterface;
47
+ /**
48
+ * Standard gravitational parameter $\mu = G M$ of the body alone, in m³/s²,
49
+ * as the orbit equations take it. Given where JPL publishes one.
50
+ */
51
+ mu?: number;
47
52
  /** X-coordinate in a distance-based system (optional). */
48
53
  x?: DistanceInterface;
49
54
  /** Y-coordinate in a distance-based system (optional). */
@@ -1 +1 @@
1
- {"version":3,"file":"moons.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/moons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kCAAkC;IAClC,QAAQ,EACN,mBAAmB,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;IACvE,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,iDAAiD;IACjD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"moons.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/moons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kCAAkC;IAClC,QAAQ,EACN,mBAAmB,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;IACvE,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,iDAAiD;IACjD,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC"}
@@ -25,7 +25,7 @@ import type { DisplayInterface } from './display.js';
25
25
  * orbit: {
26
26
  * a: { value: 1.0, unit: 'au' },
27
27
  * e: 0.0167,
28
- * period: { value: -365.256, unit: 'd' },
28
+ * period: { value: 365.256, unit: 'd' },
29
29
  * angle: 1.753 as Radians
30
30
  * },
31
31
  * radius: { value: 6371, unit: 'km' },
@@ -52,12 +52,17 @@ export interface PlanetInterface {
52
52
  orbit?: OrbitInterface;
53
53
  /** Physical radius of the planet in kilometres. */
54
54
  radius: DistanceInterface;
55
- /** X-coordinate in the parent's frame. */
56
- x: DistanceInterface;
55
+ /**
56
+ * Standard gravitational parameter $\mu = G M$ of the body alone, in m³/s²,
57
+ * as the orbit equations take it. Given where JPL publishes one.
58
+ */
59
+ mu?: number;
60
+ /** X-coordinate in the parent's frame. Optional: a rogue planet or an exoplanet may have no known position. */
61
+ x?: DistanceInterface;
57
62
  /** Y-coordinate in the parent's frame. */
58
- y: DistanceInterface;
63
+ y?: DistanceInterface;
59
64
  /** Z-coordinate in the parent's frame. */
60
- z: DistanceInterface;
65
+ z?: DistanceInterface;
61
66
  /** How to draw the planet: its colour, and state a renderer computes. */
62
67
  display?: DisplayInterface;
63
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"planets.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/planets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EACA,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,WAAW,GACX,WAAW,GACX,eAAe,GACf,eAAe,GACf,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,GACd,cAAc,GACd,YAAY,GACZ,iBAAiB,GACjB,oBAAoB,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,KAAK,CAAC,EAAE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AAM,CAAC;IACZ,+GAA+G;IAC/G,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0CAA0C;IAC1C,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0CAA0C;IAC1C,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,yEAAyE;IACzE,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC"}
@@ -25,7 +25,7 @@ import type { DisplayInterface } from './display.js';
25
25
  * orbit: {
26
26
  * a: { value: 27230, unit: 'ly' },
27
27
  * e: 0.005,
28
- * period: { value: -480, unit: 'Myr' },
28
+ * period: { value: 480, unit: 'Myr' },
29
29
  * angle: 1.5699 as Radians
30
30
  * },
31
31
  * radius: { value: 2600000, unit: 'km' },
@@ -49,6 +49,11 @@ export interface StarInterface {
49
49
  orbit?: OrbitInterface;
50
50
  /** Mass in solar masses ($M_\odot$). */
51
51
  mass?: number;
52
+ /**
53
+ * Standard gravitational parameter $\mu = G M$ of the body alone, in m³/s²,
54
+ * as the orbit equations take it. Given where JPL publishes one.
55
+ */
56
+ mu?: number;
52
57
  /** Physical radius of the star. */
53
58
  radius: DistanceInterface;
54
59
  /** X-coordinate in the parent's frame. */
@@ -1 +1 @@
1
- {"version":3,"file":"stars.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/stars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;I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,CAAC,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,0CAA0C;IAC1C,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0CAA0C;IAC1C,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0CAA0C;IAC1C,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC"}
@@ -34,7 +34,7 @@ export type SystemKindType = 'planetary' | 'binary' | 'multiple' | 'cluster';
34
34
  * orbit: {
35
35
  * a: { value: 503, unit: 'au' },
36
36
  * e: 0.5,
37
- * period: { value: -547, unit: 'kyr' },
37
+ * period: { value: 547, unit: 'kyr' },
38
38
  * angle: Math.PI as Radians
39
39
  * }
40
40
  * };
@@ -58,17 +58,19 @@ export type DistanceUnitType = 'm' | 'km' | 'au' | 'ly' | 'kly' | 'Mly' | 'Gly'
58
58
  *
59
59
  * ### Typical flow
60
60
  * 1) Accept `DistanceUnitAliasType | DistanceUnitType` at your API boundary.
61
- * 2) Normalize to `DistanceUnitType` (e.g., via `normalizeDistanceUnit`).
61
+ * 2) Normalize to `DistanceUnitType` with `normalizeDistanceUnit` from
62
+ * `@interstellar-tools/equations`, or convert directly with `convertDistanceUnit`.
62
63
  * 3) Perform calculations using canonical units only.
63
64
  *
64
65
  * @example
65
66
  * ```ts
66
- * // Assuming `normalizeDistanceUnit` and `NORMALIZE_DISTANCE_UNIT` are defined:
67
- * normalizeDistanceUnit('AU'); // 'au'
68
- * normalizeDistanceUnit('lightyears'); // 'ly'
67
+ * import { normalizeDistanceUnit } from '@interstellar-tools/equations';
68
+ *
69
+ * normalizeDistanceUnit('AU'); // 'au'
70
+ * normalizeDistanceUnit('lightyears'); // 'ly'
69
71
  * normalizeDistanceUnit('kilolightyears'); // 'kly'
70
- * normalizeDistanceUnit('parsecs'); // 'pc'
71
- * normalizeDistanceUnit('Mpc'); // 'Mpc' (already canonical)
72
+ * normalizeDistanceUnit('parsecs'); // 'pc'
73
+ * normalizeDistanceUnit('Mpc'); // 'Mpc' (already canonical)
72
74
  * ```
73
75
  *
74
76
  * @see DistanceUnitType for the canonical symbol set.
@@ -81,6 +83,8 @@ export type DistanceUnitAliasType = 'meter' | 'meters' | 'metre' | 'metres' | 'k
81
83
  /**
82
84
  * Represents a measurement with an associated unit.
83
85
  *
86
+ * @deprecated Use {@link DistanceInterface}, which is identical. `MeasureInterface` will be
87
+ * removed in 2.0.
84
88
  * @extends ValueInterface
85
89
  * @property {DistanceUnitType} unit - The unit of measurement.
86
90
  *
@@ -101,7 +105,7 @@ export interface MeasureInterface extends ValueInterface {
101
105
  *
102
106
  * @example
103
107
  * ```ts
104
- * const distanceToAlphaCentauri: DistanceInterface = { value: 4.367, unit: 'lightyears' };
108
+ * const distanceToAlphaCentauri: DistanceInterface = { value: 4.367, unit: 'ly' };
105
109
  * ```
106
110
  * @group Distance
107
111
  */
@@ -1 +1 @@
1
- {"version":3,"file":"distance.d.ts","sourceRoot":"","sources":["../src/distance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,gBAAgB,GACxB,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,qBAAqB,GAE7B,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GAER,WAAW,GACX,YAAY,GACZ,WAAW,GACX,YAAY,GAEZ,IAAI,GACJ,IAAI,GACJ,mBAA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,GACf,gBAAgB,GAChB,KAAK,GACL,eAAe,GACf,gBAAgB,GAChB,KAAK,GAEL,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,KAAK,GACL,YAAY,GACZ,aAAa,GACb,KAAK,GACL,YAAY,GACZ,aAAa,GACb,KAAK,CAAC;AAEV;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
package/dist/orbits.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { MeasureInterface } from './distance.js';
2
- import type { Radians } from './numeric.js';
1
+ import type { DistanceInterface } from './distance.js';
2
+ import type { DegreesType, Radians } from './numeric.js';
3
3
  import type { TemporalInterface } from './temporal.js';
4
4
  /**
5
5
  * Clohessy–Wiltshire / Hill relative-motion **state vector** in the LVLH frame.
@@ -102,9 +102,11 @@ export type CwStateDerivative = readonly [
102
102
  * B), each carries its own orbit. Both share `e`, `period` and `angle`, their
103
103
  * periapses point in opposite directions, and their semi-major axes split by
104
104
  * mass ratio: $a_1 = a \, m_2 / (m_1 + m_2)$, where $a$ is their separation.
105
- * - **Direction**: a negative `period` indicates a counter-clockwise orbit.
105
+ * - **Direction**: `period` is always a positive duration. A retrograde orbit,
106
+ * moving against its parent's rotation, has `retrograde: true`; a renderer
107
+ * can use `retrograde ? -1 : 1` as the direction of travel.
106
108
  * - `i`, `w`, `om` and `q` are only given where the dataset has them (comets and
107
- * asteroids).
109
+ * asteroids). Where `i` is given, `retrograde` is set exactly when `i > 90°`.
108
110
  *
109
111
  * :::
110
112
  *
@@ -113,7 +115,7 @@ export type CwStateDerivative = readonly [
113
115
  * const earthOrbit: OrbitInterface = {
114
116
  * a: { value: 1.0, unit: 'au' },
115
117
  * e: 0.0167,
116
- * period: { value: -365.256, unit: 'd' },
118
+ * period: { value: 365.256, unit: 'd' },
117
119
  * angle: 1.753 as Radians
118
120
  * };
119
121
  * ```
@@ -121,20 +123,38 @@ export type CwStateDerivative = readonly [
121
123
  */
122
124
  export interface OrbitInterface {
123
125
  /** Semi-major axis of this body's orbit around the parent's centre of mass. */
124
- a: MeasureInterface;
126
+ a: DistanceInterface;
125
127
  /** Orbital eccentricity (0 = circular, closer to 1 = highly elliptical). */
126
128
  e: number;
127
- /** Orbital period. Negative values indicate counter clockwise direction. */
129
+ /** Orbital period, always positive. See `retrograde` for the direction. */
128
130
  period: TemporalInterface;
131
+ /** `true` for a retrograde orbit. Omitted for the usual prograde orbits. */
132
+ retrograde?: boolean;
129
133
  /** Current orbital position at J2000 in radians (true anomaly). */
130
134
  angle: Radians;
135
+ /** Orbital inclination in degrees, as catalogues give it. */
136
+ i?: DegreesType;
137
+ /** Argument of periapsis in degrees. */
138
+ w?: DegreesType;
139
+ /** Longitude of the ascending node in degrees. */
140
+ om?: DegreesType;
141
+ /** Periapsis distance $q = a(1 - e)$. */
142
+ q?: DistanceInterface;
143
+ }
144
+ /**
145
+ * An {@link OrbitInterface} with every orientation element given: `i`, `w`,
146
+ * `om` and `q`. Comets and asteroids carry these.
147
+ *
148
+ * @group Orbits
149
+ */
150
+ export interface FullOrbitInterface extends OrbitInterface {
131
151
  /** Orbital inclination in degrees. */
132
- i?: number;
152
+ i: DegreesType;
133
153
  /** Argument of periapsis in degrees. */
134
- w?: number;
154
+ w: DegreesType;
135
155
  /** Longitude of the ascending node in degrees. */
136
- om?: number;
137
- /** Periapsis distance $q = a(1 - e)$ in the unit of `a`. */
138
- q?: number;
156
+ om: DegreesType;
157
+ /** Periapsis distance $q = a(1 - e)$. */
158
+ q: DistanceInterface;
139
159
  }
140
160
  //# sourceMappingURL=orbits.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orbits.d.ts","sourceRoot":"","sources":["../src/orbits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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E,OAAO,CAAC;IACf,6DAA6D;IAC7D,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,wCAAwC;IACxC,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,kDAAkD;IAClD,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,yCAAyC;IACzC,CAAC,CAAC,EAAE,iBAAiB,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,sCAAsC;IACtC,CAAC,EAAE,WAAW,CAAC;IACf,wCAAwC;IACxC,CAAC,EAAE,WAAW,CAAC;IACf,kDAAkD;IAClD,EAAE,EAAE,WAAW,CAAC;IAChB,yCAAyC;IACzC,CAAC,EAAE,iBAAiB,CAAC;CACtB"}
@@ -86,11 +86,11 @@ export interface TemporalInterface extends ValueInterface {
86
86
  * Represents a **time step measurement** in simulation, restricted to days.
87
87
  *
88
88
  * @extends ValueInterface
89
- * @property {'day'} unit - The unit is always **days**.
89
+ * @property {'d'} unit - The unit is always **days** (`'d'`).
90
90
  *
91
91
  * @example
92
92
  * ```ts
93
- * const timeStep: TimeStepInterface = { value: 1, unit: 'day' };
93
+ * const timeStep: TimeStepInterface = { value: 1, unit: 'd' };
94
94
  * ```
95
95
  * @group Temporal
96
96
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interstellar-tools/types",
3
- "version": "0.62.0",
3
+ "version": "0.64.0",
4
4
  "description": "Shared TypeScript types (e.g., 3D tuples, equation result interfaces) used across the monorepo to keep APIs predictable and safe.",
5
5
  "keywords": [
6
6
  "types",