ballistics-engine 0.43.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/ballistics_engine.d.ts +7 -1
- package/ballistics_engine.js +7 -1
- package/ballistics_engine_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ A high-performance ballistics trajectory calculation engine with comprehensive p
|
|
|
26
26
|
- **Unit Conversion** - Seamless switching between Imperial (default) and Metric units
|
|
27
27
|
- **BC Segmentation** - Velocity-dependent ballistic coefficient modeling with automatic estimation
|
|
28
28
|
- **Atmospheric Modeling** - Temperature, pressure, humidity, and altitude effects with ICAO standard atmosphere; also accepts a single **density altitude** reading (`trajectory --density-altitude`, feet imperial / meters metric) as a direct alternative to entering altitude/pressure/temperature separately — back-solves an ISA-equivalent atmosphere (preserving Mach/lapse-rate/segmented-atmosphere behavior, not a density-only shortcut) and supersedes `--altitude`/`--pressure`/`--pressure-type` entirely, with an explicit `--temperature` still honored for correct powder-temperature sensitivity — see [CLI_USAGE.md](CLI_USAGE.md#density-altitude-as-a-direct-input---density-altitude)
|
|
29
|
+
- **Density Altitude for Apps** - The `atmosphere.density_altitude` bridge command resolves a solve-json atmosphere exactly as a solve does and reports pressure altitude, the solver's CIPM-2007 air density, and density altitude under both of its field definitions by name — `faa_rule` (NWS pressure altitude plus the FAA 120 ft/°C rule, humidity-free, the same formula as the DOPE card header) and `density_matched` (ISA altitude of equal actual density, humidity included) — refusing air that cannot exist, which is what a unit mistake looks like; see [docs/ATMOSPHERE_DENSITY_ALTITUDE.md](docs/ATMOSPHERE_DENSITY_ALTITUDE.md)
|
|
29
30
|
- **Clock-Position Wind Entry** - Enter wind direction as the dominant field convention: marked clock positions (`--wind-direction 3oc`, `10h30`, or `10:30`; 12 o'clock = headwind, minutes count 0.5°) alongside plain degrees on every wind-direction flag and the WASM terminal; inside `--wind-segment` the colon-free forms apply (`10:3oc:400`) while `10:30:400` keeps its numeric SPEED:ANGLE:DIST meaning; bare numbers stay degrees everywhere — see [CLI_USAGE.md](CLI_USAGE.md#wind-direction-entry-degrees-clock-positions--mba-1367)
|
|
30
31
|
- **Earth-Fixed Compass Wind Bearings** - Store wind as absolute compass bearings and let the solver re-reference them against the shot azimuth (`--wind-ref compass` + `--shot-direction` on `trajectory`/`monte-carlo`; covers the single direction, location-CSV WIND_DIR, and every `--wind-segment` angle; Monte Carlo converts before dispersion sampling; solve-json `wind.wind_reference`; WASM builder `setWindReference`/`setShotDirection`; wind FROM north on a shot due north = pure headwind, pinned) — see [CLI_USAGE.md](CLI_USAGE.md#earth-fixed-compass-bearings---wind-ref-compass--mba-1368)
|
|
31
32
|
- **Wind Effects** - 3D wind calculations with altitude-dependent wind shear modeling, **downrange-segmented wind** (`--wind-segment SPEED:ANGLE:DIST[:VERTICAL]`, repeatable — model wind that varies along the path, e.g. muzzle plus downrange sensor readings), and **vertical wind** (`--wind-vertical <SPEED>` on `trajectory`/`monte-carlo`, or the segment's optional 4th field; positive = updraft, raises point of impact) — see [CLI_USAGE.md](CLI_USAGE.md#vertical-wind)
|
package/ballistics_engine.d.ts
CHANGED
|
@@ -18,7 +18,9 @@ export class Calculator {
|
|
|
18
18
|
addWindSegment(speed_mph: number, direction_deg: number, until_yards: number): Calculator;
|
|
19
19
|
/**
|
|
20
20
|
* Calculate trajectory and return result as JavaScript object
|
|
21
|
-
* Returns: { range_yards, drop_inches,
|
|
21
|
+
* Returns: { range_yards, drop_inches, drift_inches, velocity_fps, energy_ftlb, time_seconds }
|
|
22
|
+
* (`drift_inches`, not `windage_inches` -- the wrong name here is what a wasm test was
|
|
23
|
+
* written against, and it failed on a field that has never existed. MBA-1535.)
|
|
22
24
|
*/
|
|
23
25
|
calculateTrajectory(range_yards: number): any;
|
|
24
26
|
/**
|
|
@@ -30,6 +32,10 @@ export class Calculator {
|
|
|
30
32
|
/**
|
|
31
33
|
* Get full trajectory table as array of points
|
|
32
34
|
* Returns array of: [{ range_yards, drop_inches, windage_inches, velocity_fps, energy_ftlb, time_sec }, ...]
|
|
35
|
+
*
|
|
36
|
+
* ⚠️ DIFFERENT KEYS FROM [`Self::calculate_trajectory`], which answers `drift_inches`
|
|
37
|
+
* and `time_seconds`. The two have never agreed and the difference is load-bearing for
|
|
38
|
+
* existing embedders, so it is documented here rather than quietly unified (MBA-1535).
|
|
33
39
|
*/
|
|
34
40
|
getFullTrajectory(): any;
|
|
35
41
|
/**
|
package/ballistics_engine.js
CHANGED
|
@@ -39,7 +39,9 @@ export class Calculator {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Calculate trajectory and return result as JavaScript object
|
|
42
|
-
* Returns: { range_yards, drop_inches,
|
|
42
|
+
* Returns: { range_yards, drop_inches, drift_inches, velocity_fps, energy_ftlb, time_seconds }
|
|
43
|
+
* (`drift_inches`, not `windage_inches` -- the wrong name here is what a wasm test was
|
|
44
|
+
* written against, and it failed on a field that has never existed. MBA-1535.)
|
|
43
45
|
* @param {number} range_yards
|
|
44
46
|
* @returns {any}
|
|
45
47
|
*/
|
|
@@ -82,6 +84,10 @@ export class Calculator {
|
|
|
82
84
|
/**
|
|
83
85
|
* Get full trajectory table as array of points
|
|
84
86
|
* Returns array of: [{ range_yards, drop_inches, windage_inches, velocity_fps, energy_ftlb, time_sec }, ...]
|
|
87
|
+
*
|
|
88
|
+
* ⚠️ DIFFERENT KEYS FROM [`Self::calculate_trajectory`], which answers `drift_inches`
|
|
89
|
+
* and `time_seconds`. The two have never agreed and the difference is load-bearing for
|
|
90
|
+
* existing embedders, so it is documented here rather than quietly unified (MBA-1535).
|
|
85
91
|
* @returns {any}
|
|
86
92
|
*/
|
|
87
93
|
getFullTrajectory() {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Alex Jokela <email@tinycomputers.io>"
|
|
6
6
|
],
|
|
7
7
|
"description": "High-performance ballistics trajectory engine with professional physics (WASM build)",
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.44.0",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|