@interstellar-tools/equations 0.63.1 → 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.
@@ -0,0 +1,58 @@
1
+ import type { DistanceInterface, DistanceUnitAliasType, DistanceUnitType } from '@interstellar-tools/types';
2
+ /**
3
+ * Meters-per-unit lookup for all canonical {@link DistanceUnitType} symbols.
4
+ *
5
+ * - **Base**: conversions are performed via **meters**.
6
+ * - **Astronomical unit**: `au = 149 597 870 700 m`, exact (from {@link AU_METERS}).
7
+ * - **Light-year**: `c × Julian year` (from {@link METERS_PER_LY}); `kly/Mly/Gly`
8
+ * are powers of 10 thereof.
9
+ * - **Parsec**: `(648 000 / π) au` (from {@link METERS_PER_PC}); `kpc/Mpc/Gpc`
10
+ * are powers of 10 thereof.
11
+ * - The table is frozen: it can be read, but not changed at runtime.
12
+ *
13
+ * @group Helpers
14
+ * @example
15
+ * ```ts
16
+ * METERS_PER.km; // 1000
17
+ * METERS_PER.au; // 149_597_870_700
18
+ * ```
19
+ */
20
+ export declare const METERS_PER: Readonly<Record<DistanceUnitType, number>>;
21
+ /**
22
+ * Convert a **distance** between any two {@link DistanceUnitType} units.
23
+ *
24
+ * - Uses {@link METERS_PER} with **meters** as the intermediate unit.
25
+ * - The `distance.unit` is expected to be **canonical**, as in the datasets.
26
+ * - The `targetUnit` may be a canonical unit or an alias such as `'AU'`; it is
27
+ * normalized to a canonical symbol.
28
+ *
29
+ * $$
30
+ * \text{value}_{\text{target}}
31
+ * \;=\;
32
+ * \frac{\text{value}_{\text{in}} \cdot \mathrm{METERS\_PER}[u_{\text{in}}]}
33
+ * {\mathrm{METERS\_PER}[u_{\text{out}}]}
34
+ * $$
35
+ *
36
+ * @param distance Input distance `{ value, unit }` in a canonical unit.
37
+ * @param targetUnit Desired output unit, canonical or an alias (will be normalized).
38
+ * @returns A new `{ value, unit }` where `unit` is the canonical target symbol.
39
+ * @throws {RangeError} If `targetUnit` is not a known unit or alias.
40
+ * @group Helpers
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * convertDistanceUnit({ value: 1, unit: 'au' }, 'km');
45
+ * // → { value: 149_597_870.7, unit: 'km' }
46
+ *
47
+ * convertDistanceUnit({ value: 1, unit: 'pc' }, 'ly');
48
+ * // → { value: 3.2615637771674333, unit: 'ly' }
49
+ *
50
+ * // Put a dataset's semi-major axis in the unit a renderer draws in:
51
+ * const jupiter = PLANETS.find((p) => p.id === 'jupiter');
52
+ * convertDistanceUnit(jupiter.orbit.a, 'au').value;
53
+ * ```
54
+ *
55
+ * @see normalizeDistanceUnit
56
+ */
57
+ export declare const convertDistanceUnit: (distance: DistanceInterface, targetUnit: DistanceUnitType | DistanceUnitAliasType) => DistanceInterface;
58
+ //# sourceMappingURL=convert-distance-unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-distance-unit.d.ts","sourceRoot":"","sources":["../../../src/categories/helpers/convert-distance-unit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAInC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAa9D,CAAC;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,iBAAiB,EAC3B,YAAY,gBAAgB,GAAG,qBAAqB,KACnD,iBAKF,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { AU_METERS, METERS_PER_LY, METERS_PER_PC } from '@interstellar-tools/constants';
2
+ import { normalizeDistanceUnit } from './normalize-distance-unit.js';
3
+ /**
4
+ * Meters-per-unit lookup for all canonical {@link DistanceUnitType} symbols.
5
+ *
6
+ * - **Base**: conversions are performed via **meters**.
7
+ * - **Astronomical unit**: `au = 149 597 870 700 m`, exact (from {@link AU_METERS}).
8
+ * - **Light-year**: `c × Julian year` (from {@link METERS_PER_LY}); `kly/Mly/Gly`
9
+ * are powers of 10 thereof.
10
+ * - **Parsec**: `(648 000 / π) au` (from {@link METERS_PER_PC}); `kpc/Mpc/Gpc`
11
+ * are powers of 10 thereof.
12
+ * - The table is frozen: it can be read, but not changed at runtime.
13
+ *
14
+ * @group Helpers
15
+ * @example
16
+ * ```ts
17
+ * METERS_PER.km; // 1000
18
+ * METERS_PER.au; // 149_597_870_700
19
+ * ```
20
+ */
21
+ export const METERS_PER = Object.freeze({
22
+ m: 1,
23
+ km: 1e3,
24
+ au: AU_METERS,
25
+ ly: METERS_PER_LY,
26
+ kly: METERS_PER_LY * 1e3,
27
+ Mly: METERS_PER_LY * 1e6,
28
+ Gly: METERS_PER_LY * 1e9,
29
+ pc: METERS_PER_PC,
30
+ kpc: METERS_PER_PC * 1e3,
31
+ Mpc: METERS_PER_PC * 1e6,
32
+ Gpc: METERS_PER_PC * 1e9
33
+ });
34
+ /**
35
+ * Convert a **distance** between any two {@link DistanceUnitType} units.
36
+ *
37
+ * - Uses {@link METERS_PER} with **meters** as the intermediate unit.
38
+ * - The `distance.unit` is expected to be **canonical**, as in the datasets.
39
+ * - The `targetUnit` may be a canonical unit or an alias such as `'AU'`; it is
40
+ * normalized to a canonical symbol.
41
+ *
42
+ * $$
43
+ * \text{value}_{\text{target}}
44
+ * \;=\;
45
+ * \frac{\text{value}_{\text{in}} \cdot \mathrm{METERS\_PER}[u_{\text{in}}]}
46
+ * {\mathrm{METERS\_PER}[u_{\text{out}}]}
47
+ * $$
48
+ *
49
+ * @param distance Input distance `{ value, unit }` in a canonical unit.
50
+ * @param targetUnit Desired output unit, canonical or an alias (will be normalized).
51
+ * @returns A new `{ value, unit }` where `unit` is the canonical target symbol.
52
+ * @throws {RangeError} If `targetUnit` is not a known unit or alias.
53
+ * @group Helpers
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * convertDistanceUnit({ value: 1, unit: 'au' }, 'km');
58
+ * // → { value: 149_597_870.7, unit: 'km' }
59
+ *
60
+ * convertDistanceUnit({ value: 1, unit: 'pc' }, 'ly');
61
+ * // → { value: 3.2615637771674333, unit: 'ly' }
62
+ *
63
+ * // Put a dataset's semi-major axis in the unit a renderer draws in:
64
+ * const jupiter = PLANETS.find((p) => p.id === 'jupiter');
65
+ * convertDistanceUnit(jupiter.orbit.a, 'au').value;
66
+ * ```
67
+ *
68
+ * @see normalizeDistanceUnit
69
+ */
70
+ export const convertDistanceUnit = (distance, targetUnit) => {
71
+ const unit = normalizeDistanceUnit(targetUnit);
72
+ const inMeters = distance.value * METERS_PER[distance.unit];
73
+ return { value: inMeters / METERS_PER[unit], unit };
74
+ };
75
+ //# sourceMappingURL=convert-distance-unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-distance-unit.js","sourceRoot":"","sources":["../../../src/categories/helpers/convert-distance-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,aAAa,EACb,aAAa,EACd,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,UAAU,GACrB,MAAM,CAAC,MAAM,CAAC;IACZ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,aAAa;IACjB,GAAG,EAAE,aAAa,GAAG,GAAG;IACxB,GAAG,EAAE,aAAa,GAAG,GAAG;IACxB,GAAG,EAAE,aAAa,GAAG,GAAG;IACxB,EAAE,EAAE,aAAa;IACjB,GAAG,EAAE,aAAa,GAAG,GAAG;IACxB,GAAG,EAAE,aAAa,GAAG,GAAG;IACxB,GAAG,EAAE,aAAa,GAAG,GAAG;CACzB,CAAC,CAAC;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAA2B,EAC3B,UAAoD,EACjC,EAAE;IACrB,MAAM,IAAI,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE5D,OAAO,EAAE,KAAK,EAAE,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;AACtD,CAAC,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { DistanceUnitType } from '@interstellar-tools/types';
2
+ /**
3
+ * Lookup table that **normalizes distance unit aliases** (and the canonical
4
+ * symbols themselves) to a single, canonical {@link DistanceUnitType}.
5
+ *
6
+ * - Canonical symbols map to themselves (`'au'` → `'au'`).
7
+ * - Aliases map to their symbol (`'AU'` → `'au'`, `'light-years'` → `'ly'`,
8
+ * `'kiloparsecs'` → `'kpc'`).
9
+ * - **Case-sensitive** and exact: `'AU'` and `'Au'` are accepted, `'aU'` is not.
10
+ * - The table is frozen: it can be read, but not changed at runtime.
11
+ *
12
+ * @group Helpers
13
+ * @see normalizeDistanceUnit
14
+ * @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 - astronomical unit, symbol "au")
15
+ */
16
+ export declare const NORMALIZE_DISTANCE_UNIT: Readonly<{
17
+ readonly m: "m";
18
+ readonly km: "km";
19
+ readonly au: "au";
20
+ readonly ly: "ly";
21
+ readonly kly: "kly";
22
+ readonly Mly: "Mly";
23
+ readonly Gly: "Gly";
24
+ readonly pc: "pc";
25
+ readonly kpc: "kpc";
26
+ readonly Mpc: "Mpc";
27
+ readonly Gpc: "Gpc";
28
+ readonly meter: "m";
29
+ readonly meters: "m";
30
+ readonly metre: "m";
31
+ readonly metres: "m";
32
+ readonly kilometer: "km";
33
+ readonly kilometers: "km";
34
+ readonly kilometre: "km";
35
+ readonly kilometres: "km";
36
+ readonly AU: "au";
37
+ readonly Au: "au";
38
+ readonly 'astronomical-unit': "au";
39
+ readonly 'astronomical-units': "au";
40
+ readonly 'astronomical unit': "au";
41
+ readonly 'astronomical units': "au";
42
+ readonly lightyear: "ly";
43
+ readonly lightyears: "ly";
44
+ readonly 'light-year': "ly";
45
+ readonly 'light-years': "ly";
46
+ readonly kilolightyear: "kly";
47
+ readonly kilolightyears: "kly";
48
+ readonly megalightyear: "Mly";
49
+ readonly megalightyears: "Mly";
50
+ readonly gigalightyear: "Gly";
51
+ readonly gigalightyears: "Gly";
52
+ readonly parsec: "pc";
53
+ readonly parsecs: "pc";
54
+ readonly kiloparsec: "kpc";
55
+ readonly kiloparsecs: "kpc";
56
+ readonly megaparsec: "Mpc";
57
+ readonly megaparsecs: "Mpc";
58
+ readonly gigaparsec: "Gpc";
59
+ readonly gigaparsecs: "Gpc";
60
+ }>;
61
+ /**
62
+ * Normalize a **distance unit string** into a canonical {@link DistanceUnitType}.
63
+ *
64
+ * - Trims surrounding whitespace.
65
+ * - Accepts canonical symbols (`'km'`, `'au'`, `'ly'`, `'kpc'`, ...) and aliases
66
+ * (`'AU'`, `'kilometres'`, `'light-years'`, `'parsecs'`, ...), using
67
+ * {@link NORMALIZE_DISTANCE_UNIT} as the single source of truth.
68
+ * - **Case-sensitive**: `'Parsecs'` is rejected; use `'parsecs'` or `'pc'`.
69
+ *
70
+ * @param u - The input unit string. Leading/trailing whitespace is ignored.
71
+ * @returns The canonical {@link DistanceUnitType}.
72
+ * @throws {RangeError} If `u` is not a known unit or alias.
73
+ * @group Helpers
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * normalizeDistanceUnit('AU'); // 'au'
78
+ * normalizeDistanceUnit(' light-years '); // 'ly'
79
+ * normalizeDistanceUnit('kiloparsecs'); // 'kpc'
80
+ * normalizeDistanceUnit('Mpc'); // 'Mpc' (already canonical)
81
+ * ```
82
+ */
83
+ export declare const normalizeDistanceUnit: (u: string) => DistanceUnitType;
84
+ //# sourceMappingURL=normalize-distance-unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-distance-unit.d.ts","sourceRoot":"","sources":["../../../src/categories/helpers/normalize-distance-unit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDlC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,qBAAqB,GAAI,GAAG,MAAM,KAAG,gBASjD,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Lookup table that **normalizes distance unit aliases** (and the canonical
3
+ * symbols themselves) to a single, canonical {@link DistanceUnitType}.
4
+ *
5
+ * - Canonical symbols map to themselves (`'au'` → `'au'`).
6
+ * - Aliases map to their symbol (`'AU'` → `'au'`, `'light-years'` → `'ly'`,
7
+ * `'kiloparsecs'` → `'kpc'`).
8
+ * - **Case-sensitive** and exact: `'AU'` and `'Au'` are accepted, `'aU'` is not.
9
+ * - The table is frozen: it can be read, but not changed at runtime.
10
+ *
11
+ * @group Helpers
12
+ * @see normalizeDistanceUnit
13
+ * @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 - astronomical unit, symbol "au")
14
+ */
15
+ export const NORMALIZE_DISTANCE_UNIT = Object.freeze({
16
+ // canonical already map to themselves:
17
+ m: 'm',
18
+ km: 'km',
19
+ au: 'au',
20
+ ly: 'ly',
21
+ kly: 'kly',
22
+ Mly: 'Mly',
23
+ Gly: 'Gly',
24
+ pc: 'pc',
25
+ kpc: 'kpc',
26
+ Mpc: 'Mpc',
27
+ Gpc: 'Gpc',
28
+ // aliases → canonical
29
+ meter: 'm',
30
+ meters: 'm',
31
+ metre: 'm',
32
+ metres: 'm',
33
+ kilometer: 'km',
34
+ kilometers: 'km',
35
+ kilometre: 'km',
36
+ kilometres: 'km',
37
+ AU: 'au',
38
+ Au: 'au',
39
+ 'astronomical-unit': 'au',
40
+ 'astronomical-units': 'au',
41
+ 'astronomical unit': 'au',
42
+ 'astronomical units': 'au',
43
+ lightyear: 'ly',
44
+ lightyears: 'ly',
45
+ 'light-year': 'ly',
46
+ 'light-years': 'ly',
47
+ kilolightyear: 'kly',
48
+ kilolightyears: 'kly',
49
+ megalightyear: 'Mly',
50
+ megalightyears: 'Mly',
51
+ gigalightyear: 'Gly',
52
+ gigalightyears: 'Gly',
53
+ parsec: 'pc',
54
+ parsecs: 'pc',
55
+ kiloparsec: 'kpc',
56
+ kiloparsecs: 'kpc',
57
+ megaparsec: 'Mpc',
58
+ megaparsecs: 'Mpc',
59
+ gigaparsec: 'Gpc',
60
+ gigaparsecs: 'Gpc'
61
+ });
62
+ /**
63
+ * Normalize a **distance unit string** into a canonical {@link DistanceUnitType}.
64
+ *
65
+ * - Trims surrounding whitespace.
66
+ * - Accepts canonical symbols (`'km'`, `'au'`, `'ly'`, `'kpc'`, ...) and aliases
67
+ * (`'AU'`, `'kilometres'`, `'light-years'`, `'parsecs'`, ...), using
68
+ * {@link NORMALIZE_DISTANCE_UNIT} as the single source of truth.
69
+ * - **Case-sensitive**: `'Parsecs'` is rejected; use `'parsecs'` or `'pc'`.
70
+ *
71
+ * @param u - The input unit string. Leading/trailing whitespace is ignored.
72
+ * @returns The canonical {@link DistanceUnitType}.
73
+ * @throws {RangeError} If `u` is not a known unit or alias.
74
+ * @group Helpers
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * normalizeDistanceUnit('AU'); // 'au'
79
+ * normalizeDistanceUnit(' light-years '); // 'ly'
80
+ * normalizeDistanceUnit('kiloparsecs'); // 'kpc'
81
+ * normalizeDistanceUnit('Mpc'); // 'Mpc' (already canonical)
82
+ * ```
83
+ */
84
+ export const normalizeDistanceUnit = (u) => {
85
+ const k = u.trim();
86
+ const v = Object.prototype.hasOwnProperty.call(NORMALIZE_DISTANCE_UNIT, k)
87
+ ? NORMALIZE_DISTANCE_UNIT[k]
88
+ : undefined;
89
+ if (!v)
90
+ throw new RangeError(`Unsupported unit: ${u}`);
91
+ return v;
92
+ };
93
+ //# sourceMappingURL=normalize-distance-unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-distance-unit.js","sourceRoot":"","sources":["../../../src/categories/helpers/normalize-distance-unit.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;IACnD,uCAAuC;IACvC,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IAEV,sBAAsB;IACtB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,mBAAmB,EAAE,IAAI;IACzB,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,IAAI;IACzB,oBAAoB,EAAE,IAAI;IAC1B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,KAAK;CAInB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAS,EAAoB,EAAE;IACnE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACxE,CAAC,CAAC,uBAAuB,CAAC,CAAyC,CAAC;QACpE,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;IAEvD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -12,9 +12,11 @@ export * from './categories/cartography/is-on-triaxial-ellipsoid-surface.js';
12
12
  export * from './categories/cartography/planetocentric-latitude.js';
13
13
  export * from './categories/cartography/planetographic-latitude-oblate.js';
14
14
  export * from './categories/helpers/apply-matrix-3.js';
15
+ export * from './categories/helpers/convert-distance-unit.js';
15
16
  export * from './categories/helpers/det-3.js';
16
17
  export * from './categories/helpers/mat-mul3.js';
17
18
  export * from './categories/helpers/misc.js';
19
+ export * from './categories/helpers/normalize-distance-unit.js';
18
20
  export * from './categories/helpers/radians.js';
19
21
  export * from './categories/helpers/rot-1.js';
20
22
  export * from './categories/helpers/rot-3.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,qCAAqC,CAAC;AAEpD,cAAc,kCAAkC,CAAC;AAIjD,cAAc,8DAA8D,CAAC;AAE7E,cAAc,kEAA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,cAAc,iDAAiD,CAAC;AAEhE,cAAc,sCAAsC,CAAC;AAErD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,gEAAgE,CAAC;AAE/E,cAAc,kDAAkD,CAAC;AAEjE,cAAc,mDAAmD,CAAC;AAElE,cAAc,mDAAmD,CAAC;AAElE,cAAc,uCAAuC,CAAC;AAItD,cAAc,kDAAkD,CAAC;AAEjE,cAAc,yDAAyD,CAAC;AAExE,cAAc,6CAA6C,CAAC;AAE5D,cAAc,+CAA+C,CAAC;AAE9D,cAAc,iDAAiD,CAAC;AAEhE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,mDAAmD,CAAC"}
package/dist/index.js CHANGED
@@ -15,9 +15,11 @@ export * from './categories/cartography/planetocentric-latitude.js';
15
15
  export * from './categories/cartography/planetographic-latitude-oblate.js';
16
16
  // categories/helpers
17
17
  export * from './categories/helpers/apply-matrix-3.js';
18
+ export * from './categories/helpers/convert-distance-unit.js';
18
19
  export * from './categories/helpers/det-3.js';
19
20
  export * from './categories/helpers/mat-mul3.js';
20
21
  export * from './categories/helpers/misc.js';
22
+ export * from './categories/helpers/normalize-distance-unit.js';
21
23
  export * from './categories/helpers/radians.js';
22
24
  export * from './categories/helpers/rot-1.js';
23
25
  export * from './categories/helpers/rot-3.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AAEpD,cAAc,kCAAkC,CAAC;AAEjD,yBAAyB;AAEzB,cAAc,8DAA8D,CAAC;AAE7E,cAAc,kEAAkE,CAAC;AAEjF,cAAc,wDAAwD,CAAC;AAEvE,cAAc,8DAA8D,CAAC;AAE7E,cAAc,qDAAqD,CAAC;AAEpE,cAAc,4DAA4D,CAAC;AAE3E,qBAAqB;AAErB,cAAc,wCAAwC,CAAC;AAEvD,c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c,oDAAoD,CAAC;AAEnE,cAAc,iDAAiD,CAAC;AAEhE,cAAc,sCAAsC,CAAC;AAErD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,gEAAgE,CAAC;AAE/E,cAAc,kDAAkD,CAAC;AAEjE,cAAc,mDAAmD,CAAC;AAElE,cAAc,mDAAmD,CAAC;AAElE,cAAc,uCAAuC,CAAC;AAEtD,wBAAwB;AAExB,cAAc,kDAAkD,CAAC;AAEjE,cAAc,yDAAyD,CAAC;AAExE,cAAc,6CAA6C,CAAC;AAE5D,cAAc,+CAA+C,CAAC;AAE9D,cAAc,iDAAiD,CAAC;AAEhE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,mDAAmD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interstellar-tools/equations",
3
- "version": "0.63.1",
3
+ "version": "0.64.0",
4
4
  "description": "Curated, well-tested orbital mechanics and dynamics formulas (e.g., Newtonian gravity, vis-viva, Kepler's 3rd law, escape/circular speeds, specific energy, specific angular momentum, peri/apoapsis radii).",
5
5
  "keywords": [
6
6
  "interstellar",
@@ -111,7 +111,7 @@
111
111
  },
112
112
  "dependencies": {
113
113
  "@interstellar-tools/constants": "^0.62.0",
114
- "@interstellar-tools/temporal": "^0.60.0",
114
+ "@interstellar-tools/temporal": "^0.61.0",
115
115
  "@interstellar-tools/types": "^0.62.0"
116
116
  },
117
117
  "devDependencies": {