@interstellar-tools/types 0.1.1

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.
Files changed (58) hide show
  1. package/README.md +18 -0
  2. package/dist/celestial-bodies/asteroid-belts.d.ts +47 -0
  3. package/dist/celestial-bodies/asteroid-belts.d.ts.map +1 -0
  4. package/dist/celestial-bodies/asteroid-belts.js +2 -0
  5. package/dist/celestial-bodies/asteroid-belts.js.map +1 -0
  6. package/dist/celestial-bodies/asteroids.d.ts +191 -0
  7. package/dist/celestial-bodies/asteroids.d.ts.map +1 -0
  8. package/dist/celestial-bodies/asteroids.js +2 -0
  9. package/dist/celestial-bodies/asteroids.js.map +1 -0
  10. package/dist/celestial-bodies/celestial-bodies.d.ts +45 -0
  11. package/dist/celestial-bodies/celestial-bodies.d.ts.map +1 -0
  12. package/dist/celestial-bodies/celestial-bodies.js +2 -0
  13. package/dist/celestial-bodies/celestial-bodies.js.map +1 -0
  14. package/dist/celestial-bodies/comets.d.ts +94 -0
  15. package/dist/celestial-bodies/comets.d.ts.map +1 -0
  16. package/dist/celestial-bodies/comets.js +2 -0
  17. package/dist/celestial-bodies/comets.js.map +1 -0
  18. package/dist/celestial-bodies/galaxies.d.ts +82 -0
  19. package/dist/celestial-bodies/galaxies.d.ts.map +1 -0
  20. package/dist/celestial-bodies/galaxies.js +2 -0
  21. package/dist/celestial-bodies/galaxies.js.map +1 -0
  22. package/dist/celestial-bodies/index.d.ts +10 -0
  23. package/dist/celestial-bodies/index.d.ts.map +1 -0
  24. package/dist/celestial-bodies/index.js +10 -0
  25. package/dist/celestial-bodies/index.js.map +1 -0
  26. package/dist/celestial-bodies/moons.d.ts +75 -0
  27. package/dist/celestial-bodies/moons.d.ts.map +1 -0
  28. package/dist/celestial-bodies/moons.js +2 -0
  29. package/dist/celestial-bodies/moons.js.map +1 -0
  30. package/dist/celestial-bodies/planets.d.ts +96 -0
  31. package/dist/celestial-bodies/planets.d.ts.map +1 -0
  32. package/dist/celestial-bodies/planets.js +2 -0
  33. package/dist/celestial-bodies/planets.js.map +1 -0
  34. package/dist/celestial-bodies/stars.d.ts +100 -0
  35. package/dist/celestial-bodies/stars.d.ts.map +1 -0
  36. package/dist/celestial-bodies/stars.js +2 -0
  37. package/dist/celestial-bodies/stars.js.map +1 -0
  38. package/dist/celestial-bodies/systems.d.ts +18 -0
  39. package/dist/celestial-bodies/systems.d.ts.map +1 -0
  40. package/dist/celestial-bodies/systems.js +2 -0
  41. package/dist/celestial-bodies/systems.js.map +1 -0
  42. package/dist/distance.d.ts +111 -0
  43. package/dist/distance.d.ts.map +1 -0
  44. package/dist/distance.js +2 -0
  45. package/dist/distance.js.map +1 -0
  46. package/dist/index.d.ts +5 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +5 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/numeric.d.ts +31 -0
  51. package/dist/numeric.d.ts.map +1 -0
  52. package/dist/numeric.js +6 -0
  53. package/dist/numeric.js.map +1 -0
  54. package/dist/temporal.d.ts +100 -0
  55. package/dist/temporal.d.ts.map +1 -0
  56. package/dist/temporal.js +2 -0
  57. package/dist/temporal.js.map +1 -0
  58. package/package.json +53 -0
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @interstellar-tools/types
2
+
3
+ ## Installation
4
+
5
+ - [Node.js](https://nodejs.org/) version 22.9.0 or higher
6
+ - npm version 11.5.1 or higher
7
+
8
+ ::: code-group
9
+
10
+ ```shell [npm]
11
+ npm i --save @interstellar-tools/types
12
+ ```
13
+
14
+ ```shell [yarn]
15
+ yarn add @interstellar-tools/types
16
+ ```
17
+
18
+ :::
@@ -0,0 +1,47 @@
1
+ import { CartesianCoordinatesInterface } from './planets';
2
+ /**
3
+ * Represents an asteroid belt within the solar system simulation.
4
+ *
5
+ * **Asteroid Belt Properties:**
6
+ * - **Inner and Outer Radius**: Defines the spatial boundaries of the belt in **Astronomical Units (AU)**.
7
+ * - **Density**: Determines the number of simulated asteroids within the belt.
8
+ * - **Color and Opacity**: Used for visualization.
9
+ * - **Orbit Path (Optional)**: Stores a precomputed path for asteroid positioning.
10
+ *
11
+ * @category Celestial Bodies
12
+ */
13
+ export interface AsteroidBeltInterface {
14
+ /** Name of the asteroid belt. */
15
+ name: string;
16
+ /** Inner radius of the belt in Astronomical Units (AU). */
17
+ innerRadius: number;
18
+ /** Outer radius of the belt in Astronomical Units (AU). */
19
+ outerRadius: number;
20
+ /** Belt color for visualization. */
21
+ color: string;
22
+ /** Transparency level (0 = fully transparent, 1 = solid). */
23
+ opacity: number;
24
+ /** Density factor affecting how many asteroids are simulated. */
25
+ density: number;
26
+ /** Optional: Orbit path for finer asteroid positioning. */
27
+ orbitPath?: CartesianCoordinatesInterface[];
28
+ }
29
+ /**
30
+ * Type alias for a collection of asteroid belts.
31
+ *
32
+ * @typedef {AsteroidBeltInterface[]} AsteroidBeltsType
33
+ * @example
34
+ * ```ts
35
+ * const asteroidBelt: AsteroidBeltInterface = {
36
+ * name: 'Main Belt',
37
+ * innerRadius: 2.1,
38
+ * outerRadius: 3.3,
39
+ * color: '#888888',
40
+ * opacity: 0.5,
41
+ * density: 100,
42
+ * };
43
+ * ```
44
+ * @category Celestial Bodies
45
+ */
46
+ export type AsteroidBeltsType = AsteroidBeltInterface[];
47
+ //# sourceMappingURL=asteroid-belts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asteroid-belts.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/asteroid-belts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,6BAA6B,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=asteroid-belts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asteroid-belts.js","sourceRoot":"","sources":["../../src/celestial-bodies/asteroid-belts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,191 @@
1
+ import { DistanceInterface, MeasureInterface } from '../distance';
2
+ import { Radians } from '../numeric';
3
+ import { TemporalInterface } from '../temporal';
4
+ import { CartesianCoordinatesInterface } from './planets';
5
+ /**
6
+ * High-level **orbital class** of an asteroid (by dynamical region).
7
+ *
8
+ *
9
+ * ::: info
10
+ *
11
+ * These labels group objects by where they reside or co-orbit:
12
+ * - *Main-belt* (between Mars and Jupiter)
13
+ * - *Near-Earth* (perihelion near Earth’s orbit)
14
+ * - *Trojan* (co-orbital with a planet at L4/L5)
15
+ * - *Centaur* (between Jupiter and Neptune)
16
+ * - *Trans-Neptunian Object* (beyond Neptune)
17
+ *
18
+ * :::
19
+ *
20
+ * @category Celestial Bodies
21
+ */
22
+ export type AsteroidType = 'main-belt asteroid' | 'near-earth asteroid' | 'trojan asteroid' | 'centaur' | 'trans-neptunian object';
23
+ /**
24
+ * More specific **group/category** for dynamical families or special bodies.
25
+ *
26
+ *
27
+ * ::: info
28
+ *
29
+ * Common near-Earth subgroups: Amor / Apollo / Aten / Atira.
30
+ * Outer main-belt families: Cybele / Hilda. TNOs: Plutinos (2:3 resonance),
31
+ * "classical" Kuiper belt objects (*cubewanos*), and *scattered disk* objects.
32
+ *
33
+ * :::
34
+ *
35
+ * @category Celestial Bodies
36
+ */
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
+ /**
39
+ * **Spectral (taxonomic) class** based on reflectance spectra & albedo.
40
+ *
41
+ *
42
+ * ::: info
43
+ *
44
+ * Examples:
45
+ * - **C** (carbonaceous, dark), **S** (stony, silicaceous), **M** (metal-rich)
46
+ * - **V** (Vesta-like, basaltic), **D/P** (very red/dark, outer system)
47
+ * - **B/F/G** (subclasses of C/X), **E** (high-albedo enstatite), **X** (degenerate group)
48
+ *
49
+ * :::
50
+ *
51
+ * @category Celestial Bodies
52
+ */
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
+ /**
55
+ * Canonical shape for an **asteroid record**: identity, dynamics, and optional
56
+ * visualization aides.
57
+ *
58
+ *
59
+ * ::: info
60
+ *
61
+ * **Orbital elements (angles & distances):**
62
+ *
63
+ * - Semi-major axis `a` should be in **astronomical units (au)** via {@link MeasureInterface}.
64
+ * - Eccentricity `e` for bound ellipses typically satisfies \(0 \le e < 1\).
65
+ * - Inclination `i`, argument of perihelion `w` (ω), and longitude of ascending node `om` (Ω)
66
+ * are given in **degrees**.
67
+ * - True anomaly `angle` (ν) is in **radians**.
68
+ * - Perihelion distance \(q\) should satisfy:
69
+ *
70
+ * $$
71
+ * q \;=\; a\,(1 - e)
72
+ * $$
73
+ *
74
+ * **Period convention:** `period` is a duration (e.g., in **days**) using {@link TemporalInterface}.
75
+ * If you encode direction, a **negative value** indicates **counter-clockwise** in your display
76
+ * convention (visualization-specific; not a physical requirement).
77
+ *
78
+ * **Coordinates:** Optional `x,y,z` are distances in a chosen reference frame (e.g., ecliptic
79
+ * J2000). Always document the frame you use in calling code.
80
+ *
81
+ * :::
82
+ *
83
+ * @category Celestial Bodies
84
+ */
85
+ export interface AsteroidInterface {
86
+ /** Name of the asteroid (e.g., `"Ceres"`, `"Vesta"`). */
87
+ name: string;
88
+ /** General dynamical region (e.g., main-belt, NEO, Trojan). */
89
+ type: AsteroidType;
90
+ /** Specific family/group classification (e.g., Apollo group, Plutino). */
91
+ category: AsteroidCategory;
92
+ /** Spectral/taxonomic class (composition & albedo proxy). */
93
+ spectralType: AsteroidSpectralType;
94
+ /** Star system identifier (e.g., `"Solar System"`). */
95
+ system: string;
96
+ /**
97
+ * **Semi-major axis** (typically in **au**).
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * a: { value: 2.77, unit: 'au' }
102
+ * ```
103
+ */
104
+ a: MeasureInterface;
105
+ /**
106
+ * **Eccentricity** of the orbit.
107
+ * ::: info
108
+ *
109
+ * Elliptical orbits: \(0 \le e < 1\). Parabolic: \(e=1\). Hyperbolic: \(e>1\).
110
+ *
111
+ * :::
112
+ */
113
+ e: number;
114
+ /** **Inclination** \(i\) in **degrees**. */
115
+ i: number;
116
+ /** **Argument of perihelion** \( \omega \) in **degrees**. */
117
+ w: number;
118
+ /** **Longitude of ascending node** \( \Omega \) in **degrees**. */
119
+ om: number;
120
+ /** **True anomaly** \( \nu \) (current orbital position) in **radians**. */
121
+ angle: Radians;
122
+ /**
123
+ * **Orbital period** as a duration (e.g., in **days**).
124
+ * ::: info
125
+ *
126
+ * A **negative** value may be used to flag **counter-clockwise** drawing direction in UIs.
127
+ *
128
+ * :::
129
+ */
130
+ period: TemporalInterface;
131
+ /**
132
+ * **Perihelion distance** \( q = a(1-e) \) (typically in **au**).
133
+ * @see a
134
+ * @see e
135
+ */
136
+ q: number;
137
+ /**
138
+ * Optional **Cartesian coordinates** (distance values) in a specified frame.
139
+ * ::: info
140
+ *
141
+ * Provide the reference frame (e.g., ecliptic J2000) in calling code.
142
+ *
143
+ * :::
144
+ */
145
+ x?: DistanceInterface;
146
+ /** See {@link x}. */
147
+ y?: DistanceInterface;
148
+ /** See {@link x}. */
149
+ z?: DistanceInterface;
150
+ /**
151
+ * Optional **semi-minor axis** in **pixels** (for 2D ellipse rendering).
152
+ *
153
+ * ::: info
154
+ *
155
+ * Visualization aid only; not a physical quantity.
156
+ *
157
+ * :::
158
+ */
159
+ miA?: number;
160
+ /**
161
+ * Optional **focus offset** along X for ellipse rendering (pixels).
162
+ *
163
+ * ::: info
164
+ *
165
+ * Visualization aid only; not a physical quantity.
166
+ *
167
+ * :::
168
+ */
169
+ focus_x?: number;
170
+ /** Mean/characteristic **radius** (e.g., in **km**) as a distance value. */
171
+ radius: DistanceInterface;
172
+ /**
173
+ * Optional precomputed **orbit path** for plotting.
174
+ * ::: info
175
+ *
176
+ * Commonly a list of points in your rendering coordinate system.
177
+ *
178
+ * :::
179
+ */
180
+ orbitPath?: CartesianCoordinatesInterface[];
181
+ /** Display color (hex string, e.g., `#AABBCC`). */
182
+ color: string;
183
+ /** Visual **scale factor** (UI only; not physical size). */
184
+ size: number;
185
+ }
186
+ /**
187
+ * Convenience alias for a list of asteroids.
188
+ * @category Celestial Bodies
189
+ */
190
+ export type AsteroidsType = AsteroidInterface[];
191
+ //# sourceMappingURL=asteroids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asteroids.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/asteroids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;;;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,Y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Eb;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,4EAA4E;IAC5E,MAAM,EAAE,iBAAiB,CAAC;IAE1B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,6BAA6B,EAAE,CAAC;IAE5C,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IAEd,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=asteroids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asteroids.js","sourceRoot":"","sources":["../../src/celestial-bodies/asteroids.ts"],"names":[],"mappings":""}
@@ -0,0 +1,45 @@
1
+ import { AsteroidInterface, AsteroidsType } from './asteroids';
2
+ import { CometInterface, CometsType } from './comets';
3
+ import { MoonInterface, MoonsType } from './moons';
4
+ import { PlanetInterface, PlanetsType } from './planets';
5
+ import { StarInterface, StarsType } from './stars';
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
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const celestialObjects: CelestialBodiesType = [
20
+ * { name: 'Sun', type: 'star', mass: 1.989e30 },
21
+ * { name: 'Earth', type: 'planet', mass: 5.972e24 }
22
+ * ];
23
+ * ```
24
+ * @category Celestial Bodies
25
+ */
26
+ export type CelestialBodiesType = StarsType | PlanetsType | MoonsType | CometsType | AsteroidsType;
27
+ /**
28
+ * Type alias representing a single celestial body.
29
+ *
30
+ * Includes:
31
+ * - **Stars** (`StarInterface`)
32
+ * - **Planets** (`PlanetInterface`)
33
+ * - **Moons** (`MoonInterface`)
34
+ * - **Comets** (`CometInterface`)
35
+ *
36
+ * @typedef {StarInterface | PlanetInterface | MoonInterface | CometInterface | AsteroidInterface} CelestialBodyType
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const earth: CelestialBodyType = { name: 'Earth', type: 'planet', mass: 5.972e24 };
41
+ * ```
42
+ * @category Celestial Bodies
43
+ */
44
+ export type CelestialBodyType = StarInterface | PlanetInterface | MoonInterface | CometInterface | AsteroidInterface;
45
+ //# sourceMappingURL=celestial-bodies.d.ts.map
@@ -0,0 +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,aAAa,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,aAAa,CAAC;AAElB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,eAAe,GACf,aAAa,GACb,cAAc,GACd,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=celestial-bodies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"celestial-bodies.js","sourceRoot":"","sources":["../../src/celestial-bodies/celestial-bodies.ts"],"names":[],"mappings":""}
@@ -0,0 +1,94 @@
1
+ import { DistanceInterface, MeasureInterface } from '../distance';
2
+ import { Radians } from '../numeric';
3
+ import { TemporalInterface } from '../temporal';
4
+ import { CartesianCoordinatesInterface } from './planets';
5
+ /**
6
+ * Represents a **comet** in the solar system simulation.
7
+ *
8
+ * **Cometary Orbital Parameters:**
9
+ * - **Semi-major axis (`a`)**: Defines the **size** of the comet’s orbit in **Astronomical Units (AU)**.
10
+ * - **Orbital eccentricity (`e`)**: Determines how **elliptical** the orbit is ($0 = $ circular, closer to $1$ = highly elliptical).
11
+ * - **Inclination (`i`)**: The tilt of the orbit relative to the **ecliptic plane**, measured in **degrees**.
12
+ * - **Argument of perihelion (`w`)**: The angle from the **ascending node** to the **perihelion**.
13
+ * - **Longitude of the ascending node (`om`)**: Defines where the orbit crosses the ecliptic.
14
+ * - **Perihelion distance (`q`)**: The closest approach to the Sun in **AU**.
15
+ *
16
+ * **Visualization Parameters:**
17
+ * - **Orbit Path (`orbitPath`)**: Precomputed trajectory for rendering.
18
+ * - **Color (`color`)**: Used for visual representation.
19
+ * - **Size (`size`)**: Scaled size for display (not the actual physical size).
20
+ *
21
+ * @category Celestial Bodies
22
+ */
23
+ export interface CometInterface {
24
+ /** Name of the comet (e.g., "Halley", "Hale-Bopp"). */
25
+ name: string;
26
+ /** Type of comet based on its orbital characteristics. */
27
+ type: 'periodic comet' | 'oort cloud comet' | 'short-period comet';
28
+ /** Category classification of the comet. */
29
+ category: 'halley-type comet' | 'long-period comet' | 'jupiter-family comet';
30
+ /** The star system where the comet is located. */
31
+ system: string;
32
+ /** Semi-major axis of the orbit in AU. */
33
+ a: MeasureInterface;
34
+ /** Orbital eccentricity (0 = circular, closer to 1 = highly elliptical). */
35
+ e: number;
36
+ /** Orbital inclination in degrees. */
37
+ i: number;
38
+ /** Argument of perihelion in degrees. */
39
+ w: number;
40
+ /** Longitude of the ascending node in degrees. */
41
+ om: number;
42
+ /** Mean anomaly at epoch in radians. */
43
+ angle: Radians;
44
+ /** Orbital period in Earth days. Negative values indicate counter clockwise orbit */
45
+ period: TemporalInterface;
46
+ /** Perihelion distance in AU. */
47
+ q: number;
48
+ /** X-coordinate in a distance-based system (optional). */
49
+ x?: DistanceInterface;
50
+ /** Y-coordinate in a distance-based system (optional). */
51
+ y?: DistanceInterface;
52
+ /** Z-coordinate in a distance-based system (optional). */
53
+ z?: DistanceInterface;
54
+ /** Semi-minor axis converted to pixels (calculated from `a` and `e`). */
55
+ miA?: number;
56
+ /** X-offset for the ellipse focus (accounts for eccentricity). */
57
+ focus_x?: number;
58
+ /** Radius of the comet (for visualization purposes). */
59
+ radius: DistanceInterface;
60
+ /** Precomputed orbital path points for visualization (optional). */
61
+ orbitPath?: CartesianCoordinatesInterface[];
62
+ /** Visual representation color. */
63
+ color: string;
64
+ /** Scaled size for visualization (not actual physical size). */
65
+ size: number;
66
+ }
67
+ /**
68
+ * Type alias for an array of **comets**.
69
+ *
70
+ * @typedef {CometInterface[]} CometsType
71
+ * @example
72
+ * ```ts
73
+ * const halley: CometInterface = {
74
+ * name: 'Halley',
75
+ * type: 'periodic comet',
76
+ * category: 'halley-type comet',
77
+ * system: 'Sun,
78
+ * a: { value: 17.8, unit: 'au' },
79
+ * e: 0.967,
80
+ * i: 162.26,
81
+ * w: 111.33,
82
+ * om: 58.42,
83
+ * angle: 0,
84
+ * period: { value: 76, unit: 'years' },
85
+ * q: 0.586,
86
+ * radius: { value: 11, unit: 'km' },
87
+ * color: '#ffffff',
88
+ * size: 1.2
89
+ * };
90
+ * ```
91
+ * @category Celestial Bodies
92
+ */
93
+ export type CometsType = CometInterface[];
94
+ //# sourceMappingURL=comets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comets.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/comets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,6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E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=comets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comets.js","sourceRoot":"","sources":["../../src/celestial-bodies/comets.ts"],"names":[],"mappings":""}
@@ -0,0 +1,82 @@
1
+ import { DistanceInterface } from '../distance';
2
+ /**
3
+ * Represents a **black hole** at the center of a galaxy.
4
+ *
5
+ * **Black Hole Properties:**
6
+ * - **Mass (`mass`)**: Measured in **solar masses** ($M_\odot$).
7
+ * - **Schwarzschild radius (`radius`)**: Defined in **Astronomical Units (AU)**.
8
+ * - **Position (`x`, `y`)**: Coordinates relative to the galaxy center in **AU**.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const sagittariusA: BlackHoleInterface = {
13
+ * name: 'Sagittarius A*',
14
+ * mass: 4.154e6,
15
+ * radius: { value: 0.08, unit: 'au' },
16
+ * x: { value: 0, unit: 'au' },
17
+ * y: { value: 0, unit: 'au' }
18
+ * };
19
+ * ```
20
+ * @category Celestial Bodies
21
+ */
22
+ export interface BlackHoleInterface {
23
+ /** Name of the central black hole. */
24
+ name: string;
25
+ /** Mass of the black hole in solar masses. */
26
+ mass: number;
27
+ /** Schwarzschild radius of the black hole in AU. */
28
+ radius: DistanceInterface;
29
+ /** X-coordinate relative to the galaxy center in AU. */
30
+ x: DistanceInterface;
31
+ /** Y-coordinate relative to the galaxy center in AU. */
32
+ y: DistanceInterface;
33
+ }
34
+ /**
35
+ * Represents a **galaxy** in the universe simulation.
36
+ *
37
+ * **Galaxy Properties:**
38
+ * - **Name (`name`)**: The galaxy's official designation.
39
+ * - **Type (`type`)**: The morphological classification (e.g., Spiral, Elliptical).
40
+ * - **Diameter (`diameter`)**: Measured in **light-years**.
41
+ * - **Distance (`distance`)**: The distance from the **Milky Way**, also in **light-years**.
42
+ * - **Black Hole (`blackHole`)**: The central supermassive black hole.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const milkyWay: GalaxyInterface = {
47
+ * name: 'Milky Way',
48
+ * type: 'Spiral',
49
+ * diameter: { value: 105700, unit: 'lightyears' },
50
+ * distance: { value: 0, unit: 'lightyears' },
51
+ * blackHole: sagittariusA
52
+ * };
53
+ * ```
54
+ * @category Celestial Bodies
55
+ */
56
+ export interface GalaxyInterface {
57
+ /** Name of the galaxy. */
58
+ name: string;
59
+ /** Morphological classification of the galaxy. */
60
+ type: string;
61
+ /** Diameter of the galaxy in light-years. */
62
+ diameter: DistanceInterface;
63
+ /** Distance from the Milky Way in light-years. */
64
+ distance: DistanceInterface;
65
+ /** Central black hole of the galaxy. */
66
+ blackHole: BlackHoleInterface;
67
+ }
68
+ /**
69
+ * Type alias for a collection of **galaxies**.
70
+ *
71
+ * @typedef {GalaxyInterface[]} GalaxiesType
72
+ * @category Celestial Bodies
73
+ */
74
+ export type GalaxiesType = GalaxyInterface[];
75
+ /**
76
+ * Type alias for a collection of **black holes**.
77
+ *
78
+ * @typedef {BlackHoleInterface[]} BlackHolesType
79
+ * @category Celestial Bodies
80
+ */
81
+ export type BlackHolesType = BlackHoleInterface[];
82
+ //# sourceMappingURL=galaxies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"galaxies.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/galaxies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,wDAAwD;IACxD,CAAC,EAAE,iBAAiB,CAAC;IACrB,wDAAwD;IACxD,CAAC,EAAE,iBAAiB,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,wCAAwC;IACxC,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=galaxies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"galaxies.js","sourceRoot":"","sources":["../../src/celestial-bodies/galaxies.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export * from './celestial-bodies';
2
+ export * from './asteroids';
3
+ export * from './comets';
4
+ export * from './galaxies';
5
+ export * from './moons';
6
+ export * from './planets';
7
+ export * from './stars';
8
+ export * from './systems';
9
+ export * from './asteroid-belts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAE5B,cAAc,UAAU,CAAC;AAEzB,cAAc,YAAY,CAAC;AAE3B,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAE1B,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAE1B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from './celestial-bodies';
2
+ export * from './asteroids';
3
+ export * from './comets';
4
+ export * from './galaxies';
5
+ export * from './moons';
6
+ export * from './planets';
7
+ export * from './stars';
8
+ export * from './systems';
9
+ export * from './asteroid-belts';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/celestial-bodies/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAE5B,cAAc,UAAU,CAAC;AAEzB,cAAc,YAAY,CAAC;AAE3B,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAE1B,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAE1B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { DistanceInterface, MeasureInterface } from '../distance';
2
+ import { Radians } from '../numeric';
3
+ import { TemporalInterface } from '../temporal';
4
+ import { CartesianCoordinatesInterface } from './planets';
5
+ /**
6
+ * Represents a **moon** (natural satellite) orbiting a planet.
7
+ *
8
+ * **Orbital Properties:**
9
+ * - **Semi-major axis (`a`)**: Defines the moon’s orbit size in **Astronomical Units (AU)**.
10
+ * - **Orbital eccentricity (`e`)**: Determines how elliptical the orbit is ($0 =$ circular, closer to $1 =$ highly elliptical).
11
+ * - **Orbital period (`period`)**: Time taken for one full orbit in **Earth days**. Negative values indicate counter clockwise direction.
12
+ * - **True anomaly (`angle`)**: The moon’s current position in its orbit (in **radians**).
13
+ *
14
+ * **Visualization Properties:**
15
+ * - **Orbit Path (`orbitPath`)**: Precomputed trajectory for rendering.
16
+ * - **Color (`color`)**: Visual representation.
17
+ * - **Size (`radius`)**: Actual moon radius in **kilometers (km)**.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const europa: MoonInterface = {
22
+ * name: 'Europa',
23
+ * category: 'natural satellite',
24
+ * system: 'Jupiter',
25
+ * a: { value: 0.00448, unit: 'au' },
26
+ * e: 0.009,
27
+ * period: { value: 3.55, unit: 'd' },
28
+ * radius: { value: 1560.8, unit: 'km' },
29
+ * color: '#a6a6a6',
30
+ * angle: 0,
31
+ * };
32
+ * ```
33
+ * @category Celestial Bodies
34
+ */
35
+ export interface MoonInterface {
36
+ /** Name of the moon (e.g., "Io", "Europa", "Titan"). */
37
+ name: string;
38
+ type?: undefined;
39
+ /** Classification of the moon. */
40
+ category: 'natural satellite' | 'irregular satellite' | 'retrograde satellite';
41
+ /** The planetary system where the moon is located (e.g., "Jupiter"). */
42
+ system: string;
43
+ /** Semi-major axis of the orbit in AU. */
44
+ a: MeasureInterface;
45
+ /** Orbital eccentricity (0 = circular, closer to 1 = highly elliptical). */
46
+ e: number;
47
+ /** Semi-minor axis converted to pixels (calculated from `a` and `e`). */
48
+ miA?: number;
49
+ /** X-offset for the ellipse focus (accounts for eccentricity). */
50
+ focus_x?: number;
51
+ /** Orbital period in Earth days. Negative values indicate counter clockwise orbit */
52
+ period: TemporalInterface;
53
+ /** Physical radius of the moon in kilometres. */
54
+ radius: DistanceInterface;
55
+ /** Visual representation color. */
56
+ color: string;
57
+ /** Current orbital position in radians (True Anomaly). */
58
+ angle: Radians;
59
+ /** X-coordinate in a distance-based system (optional). */
60
+ x?: DistanceInterface;
61
+ /** Y-coordinate in a distance-based system (optional). */
62
+ y?: DistanceInterface;
63
+ /** Z-coordinate in a distance-based system (optional). */
64
+ z?: DistanceInterface;
65
+ /** Precomputed orbital path points for visualization (optional). */
66
+ orbitPath?: CartesianCoordinatesInterface[];
67
+ }
68
+ /**
69
+ * Type alias for a collection of **moons**.
70
+ *
71
+ * @typedef {MoonInterface[]} MoonsType
72
+ * @category Celestial Bodies
73
+ */
74
+ export type MoonsType = MoonInterface[];
75
+ //# sourceMappingURL=moons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moons.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/moons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kCAAkC;IAClC,QAAQ,EACJ,mBAAmB,GACnB,qBAAqB,GACrB,sBAAsB,CAAC;IAC3B,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,CAAC,EAAE,gBAAgB,CAAC;IACpB,4EAA4E;IAC5E,CAAC,EAAE,MAAM,CAAC;IACV,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,MAAM,EAAE,iBAAiB,CAAC;IAC1B,iDAAiD;IACjD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,0DAA0D;IAC1D,CAAC,CAAC,EAAE,iBAAiB,CAAC;IACtB,oEAAoE;IACpE,SAAS,CAAC,EAAE,6BAA6B,EAAE,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=moons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moons.js","sourceRoot":"","sources":["../../src/celestial-bodies/moons.ts"],"names":[],"mappings":""}